From 96a54802a173c56127d484325d8d73684c3f446e Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Mon, 11 Jun 2018 16:31:27 +0200 Subject: [PATCH 001/214] PS-4526: Last 3 Travis jobs after merge are always ignored Add jobs 25, 26, 27 to the job list. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a38247073f4..bbeb7392bc85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -149,7 +149,7 @@ script: echo --- JOB_NUMBER=$JOB_NUMBER TRAVIS_COMMIT=$TRAVIS_COMMIT TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG TRAVIS_BRANCH=$TRAVIS_BRANCH TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH - echo --- Perform all Travis jobs or only jobs that are included in ENV_VAR_JOB_NUMBERS list if it is defined; - JOB_NUMBERS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"; + JOB_NUMBERS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27"; if [[ "$ENV_VAR_JOB_NUMBERS" != "" ]]; then JOB_NUMBERS=$ENV_VAR_JOB_NUMBERS; fi; From b2ee29c728e48b90738506047fd944381250f03f Mon Sep 17 00:00:00 2001 From: Dmitriy Kostiuk Date: Thu, 14 Jun 2018 21:49:00 +0300 Subject: [PATCH 002/214] Fix for DOC-751 (mentioning Ubuntu 18.04) and DOC-752 (percona-release 0.1.6), 5.5 version (#2425) --- doc/source/installation/apt_repo.rst | 5 +++-- doc/source/installation/yum_repo.rst | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/source/installation/apt_repo.rst b/doc/source/installation/apt_repo.rst index 628ed271daae..1e4016d28e55 100644 --- a/doc/source/installation/apt_repo.rst +++ b/doc/source/installation/apt_repo.rst @@ -20,6 +20,7 @@ Supported Releases: * 16.04LTS (xenial) * 17.04 (zesty) * 17.10 (artful) + * 18.04 (bionic) Supported Platforms: @@ -52,13 +53,13 @@ Installing |Percona Server| from Percona ``apt`` repository .. code-block:: bash - wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb + wget https://repo.percona.com/apt/percona-release_0.1-6.$(lsb_release -sc)_all.deb 2. Install the downloaded package with :program:`dpkg`. To do that, run the following commands as root or with :program:`sudo`: .. code-block:: bash - dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb + dpkg -i percona-release_0.1-6.$(lsb_release -sc)_all.deb Once you install this package the Percona repositories should be added. You can check the repository setup in the :file:`/etc/apt/sources.list.d/percona-release.list` file. diff --git a/doc/source/installation/yum_repo.rst b/doc/source/installation/yum_repo.rst index ffcce6e69f18..315e890b6def 100644 --- a/doc/source/installation/yum_repo.rst +++ b/doc/source/installation/yum_repo.rst @@ -51,13 +51,13 @@ Installing |Percona Server| from Percona ``yum`` repository .. code-block:: bash - yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm + yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm You should see some output such as the following: .. code-block:: bash - Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm + Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm Preparing... ########################################### [100%] 1:percona-release ########################################### [100%] @@ -67,8 +67,8 @@ Installing |Percona Server| from Percona ``yum`` repository .. code-block:: bash - wget http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm - rpm -ivH percona-release-0.1-4.noarch.rpm + wget http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm + rpm -ivH percona-release-0.1-6.noarch.rpm 2. Testing the repository From cdbc0d8de5d1f6262e4e1537597641db9c7091a5 Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Tue, 31 Jul 2018 16:23:25 +0300 Subject: [PATCH 003/214] Implemented PS-4633 (Merge MySQL 5.6.41) (docs) https://jira.percona.com/browse/PS-4520 *** Updated man pages from MySQL Server 5.6.41 source tarball. *** Updated 'scripts/fill_help_tables.sql' from MySQL Server 5.6.41 source tarball. --- man/comp_err.1 | 4 +- man/innochecksum.1 | 4 +- man/msql2mysql.1 | 4 +- man/my_print_defaults.1 | 4 +- man/myisam_ftdump.1 | 4 +- man/myisamchk.1 | 10 +- man/myisamlog.1 | 17 +- man/myisampack.1 | 4 +- man/mysql.1 | 76 ++-- man/mysql.server.1 | 4 +- man/mysql_config.1 | 4 +- man/mysql_config_editor.1 | 4 +- man/mysql_convert_table_format.1 | 4 +- man/mysql_find_rows.1 | 4 +- man/mysql_fix_extensions.1 | 4 +- man/mysql_install_db.1 | 6 +- man/mysql_plugin.1 | 4 +- man/mysql_secure_installation.1 | 4 +- man/mysql_setpermission.1 | 4 +- man/mysql_tzinfo_to_sql.1 | 6 +- man/mysql_upgrade.1 | 6 +- man/mysql_waitpid.1 | 4 +- man/mysql_zap.1 | 4 +- man/mysqlaccess.1 | 4 +- man/mysqladmin.1 | 4 +- man/mysqlbinlog.1 | 135 +++--- man/mysqlbug.1 | 4 +- man/mysqlcheck.1 | 10 +- man/mysqld.8 | 4 +- man/mysqld_multi.1 | 4 +- man/mysqld_safe.1 | 6 +- man/mysqldump.1 | 23 +- man/mysqlhotcopy.1 | 4 +- man/mysqlimport.1 | 4 +- man/mysqlshow.1 | 4 +- man/mysqlslap.1 | 4 +- man/ndb-common-options.1 | 65 ++- man/ndb_blob_tool.1 | 18 +- man/ndb_config.1 | 89 ++-- man/ndb_cpcd.1 | 4 +- man/ndb_delete_all.1 | 8 +- man/ndb_desc.1 | 14 +- man/ndb_drop_index.1 | 10 +- man/ndb_drop_table.1 | 8 +- man/ndb_error_reporter.1 | 18 +- man/ndb_index_stat.1 | 106 ++--- man/ndb_mgm.1 | 26 +- man/ndb_mgmd.8 | 734 ++++++++++++++++--------------- man/ndb_move_data.1 | 30 +- man/ndb_print_backup_file.1 | 4 +- man/ndb_print_file.1 | 4 +- man/ndb_print_frag_file.1 | 4 +- man/ndb_print_schema_file.1 | 4 +- man/ndb_print_sys_file.1 | 4 +- man/ndb_redo_log_reader.1 | 42 +- man/ndb_restore.1 | 222 +++++----- man/ndb_select_all.1 | 10 +- man/ndb_select_count.1 | 8 +- man/ndb_setup.py.1 | 70 ++- man/ndb_show_tables.1 | 8 +- man/ndb_size.pl.1 | 12 +- man/ndb_waiter.1 | 10 +- man/ndbd.8 | 579 ++++++++++++------------ man/ndbinfo_select_all.1 | 20 +- man/ndbmtd.8 | 14 +- man/perror.1 | 4 +- man/replace.1 | 4 +- man/resolve_stack_dump.1 | 4 +- man/resolveip.1 | 4 +- scripts/fill_help_tables.sql | 24 +- 70 files changed, 1321 insertions(+), 1263 deletions(-) diff --git a/man/comp_err.1 b/man/comp_err.1 index 5cfe2f89c691..73cb6cff555c 100644 --- a/man/comp_err.1 +++ b/man/comp_err.1 @@ -2,12 +2,12 @@ .\" Title: \fBcomp_err\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBCOMP_ERR\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBCOMP_ERR\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/innochecksum.1 b/man/innochecksum.1 index fa9724fc31cd..ae31cbfd2cec 100644 --- a/man/innochecksum.1 +++ b/man/innochecksum.1 @@ -2,12 +2,12 @@ .\" Title: \fBinnochecksum\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBINNOCHECKSUM\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBINNOCHECKSUM\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/msql2mysql.1 b/man/msql2mysql.1 index a8db0559841a..e4545c256a9f 100644 --- a/man/msql2mysql.1 +++ b/man/msql2mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmsql2mysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMSQL2MYSQL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMSQL2MYSQL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/my_print_defaults.1 b/man/my_print_defaults.1 index c4a3f0a11e48..1e87c3ed3909 100644 --- a/man/my_print_defaults.1 +++ b/man/my_print_defaults.1 @@ -2,12 +2,12 @@ .\" Title: \fBmy_print_defaults\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMY_PRINT_DEFAULTS\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMY_PRINT_DEFAULTS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisam_ftdump.1 b/man/myisam_ftdump.1 index 3ab6216e157d..c24f73f4bfda 100644 --- a/man/myisam_ftdump.1 +++ b/man/myisam_ftdump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisam_ftdump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAM_FTDUMP\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAM_FTDUMP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisamchk.1 b/man/myisamchk.1 index 8b4c70533277..7d33394ae023 100644 --- a/man/myisamchk.1 +++ b/man/myisamchk.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamchk\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMCHK\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMCHK\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -495,7 +495,7 @@ T} T{ ft_max_word_len T}:T{ -version\-dependent +version-dependent T} T{ ft_min_word_len @@ -505,7 +505,7 @@ T} T{ ft_stopword_file T}:T{ -built\-in list +built-in list T} T{ key_buffer_size @@ -627,7 +627,7 @@ myisam_stats_method system variable\&. For more information, see the description of myisam_stats_method in -Section\ \&5.1.5, \(lqServer System Variables\(rq, and +Section\ \&5.1.7, \(lqServer System Variables\(rq, and Section\ \&8.3.7, \(lqInnoDB and MyISAM Index Statistics Collection\(rq\&. .PP ft_min_word_len diff --git a/man/myisamlog.1 b/man/myisamlog.1 index 7b4d058ae4cb..b464a2b07f11 100644 --- a/man/myisamlog.1 +++ b/man/myisamlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMLOG\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMLOG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -114,6 +114,19 @@ Specify the maximum number of open files\&. .sp -1 .IP \(bu 2.3 .\} +\fB\-F \fR\fB\fIfilepath/\fR\fR +.sp +Specify the file path with a trailing slash\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-i\fR .sp Display extra information before exiting\&. diff --git a/man/myisampack.1 b/man/myisampack.1 index 0ac04e7d898f..03bdeb2af6f1 100644 --- a/man/myisampack.1 +++ b/man/myisampack.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisampack\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMPACK\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMPACK\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql.1 b/man/mysql.1 index 401f68cc1acd..2ca5036d6202 100644 --- a/man/mysql.1 +++ b/man/mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -669,7 +669,7 @@ Produce HTML output\&. Ignore spaces after function names\&. The effect of this is described in the discussion for the IGNORE_SPACE SQL mode (see -Section\ \&5.1.8, \(lqServer SQL Modes\(rq)\&. +Section\ \&5.1.10, \(lqServer SQL Modes\(rq)\&. .RE .sp .RS 4 @@ -2332,87 +2332,87 @@ l l l l l l. T{ -\ec +\c T}:T{ A counter that increments for each statement you issue T} T{ -\eD +\D T}:T{ The full current date T} T{ -\ed +\d T}:T{ The default database T} T{ -\eh +\h T}:T{ The server host T} T{ -\el +\l T}:T{ The current delimiter T} T{ -\em +\m T}:T{ Minutes of the current time T} T{ -\en +\n T}:T{ A newline character T} T{ -\eO +\O T}:T{ -The current month in three\-letter format (Jan, Feb, \&...) +The current month in three-letter format (Jan, Feb, \&...) T} T{ -\eo +\o T}:T{ The current month in numeric format T} T{ -\eP +\P T}:T{ am/pm T} T{ -\ep +\p T}:T{ The current TCP/IP port or socket file T} T{ -\eR +\R T}:T{ -The current time, in 24\-hour military time (0\(en23) +The current time, in 24-hour military time (0\(en23) T} T{ -\er +\r T}:T{ -The current time, standard 12\-hour time (1\(en12) +The current time, standard 12-hour time (1\(en12) T} T{ -\eS +\S T}:T{ Semicolon T} T{ -\es +\s T}:T{ Seconds of the current time T} T{ -\et +\t T}:T{ A tab character T} T{ -\eU +\U T}:T{ .PP Your full @@ -2420,57 +2420,57 @@ Your full account name T} T{ -\eu +\u T}:T{ Your user name T} T{ -\ev +\v T}:T{ The server version T} T{ -\ew +\w T}:T{ -The current day of the week in three\-letter format (Mon, Tue, \&...) +The current day of the week in three-letter format (Mon, Tue, \&...) T} T{ -\eY +\Y T}:T{ The current year, four digits T} T{ -\ey +\y T}:T{ The current year, two digits T} T{ -\e_ +\_ T}:T{ A space T} T{ -\e\ \& +\\ \& T}:T{ A space (a space follows the backslash) T} T{ -\e\*(Aq +\' T}:T{ Single quote T} T{ -\e" +\" T}:T{ Double quote T} T{ -\e\e +\\ T}:T{ -A literal \e backslash character +A literal \ backslash character T} T{ -\e\fIx\fR +\\fIx\fR T}:T{ .PP \fIx\fR, for any @@ -2842,7 +2842,7 @@ command, uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. The proper operation of this command requires that the help tables in the mysql database be initialized with help topic information (see -Section\ \&5.1.11, \(lqServer-Side Help\(rq)\&. +Section\ \&5.1.13, \(lqServer-Side Help\(rq)\&. .PP If there is no match for the search string, the search fails: .sp @@ -3282,7 +3282,7 @@ SET sql_safe_updates=1, sql_select_limit=1000, max_join_size=1000000; .\} .PP See -Section\ \&5.1.5, \(lqServer System Variables\(rq\&. +Section\ \&5.1.7, \(lqServer System Variables\(rq\&. .PP The SET diff --git a/man/mysql.server.1 b/man/mysql.server.1 index cfd2a70821ea..f2663c9a216a 100644 --- a/man/mysql.server.1 +++ b/man/mysql.server.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql.server\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\&.SERVER\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\&.SERVER\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_config.1 b/man/mysql_config.1 index a72e7ac72bbd..5cb84138ccf9 100644 --- a/man/mysql_config.1 +++ b/man/mysql_config.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_config_editor.1 b/man/mysql_config_editor.1 index 0997ad552a61..09de78dbfdb0 100644 --- a/man/mysql_config_editor.1 +++ b/man/mysql_config_editor.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config_editor\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG_EDITOR\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG_EDITOR\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_convert_table_format.1 b/man/mysql_convert_table_format.1 index bbbd11b9dfea..225d46d8945e 100644 --- a/man/mysql_convert_table_format.1 +++ b/man/mysql_convert_table_format.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_convert_table_format\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONVERT_TABLE_FORMAT\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONVERT_TABLE_FORMAT\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_find_rows.1 b/man/mysql_find_rows.1 index 7d76a61cb104..892870700b2f 100644 --- a/man/mysql_find_rows.1 +++ b/man/mysql_find_rows.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_find_rows\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIND_ROWS\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIND_ROWS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_fix_extensions.1 b/man/mysql_fix_extensions.1 index 1f9085c8e9b8..a52743bd443f 100644 --- a/man/mysql_fix_extensions.1 +++ b/man/mysql_fix_extensions.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_fix_extensions\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIX_EXTENSIONS\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIX_EXTENSIONS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_install_db.1 b/man/mysql_install_db.1 index 75c3dc402c52..70242da8d2e3 100644 --- a/man/mysql_install_db.1 +++ b/man/mysql_install_db.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_install_db\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_INSTALL_DB\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_INSTALL_DB\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -63,7 +63,7 @@ With one exception, the settings in the default option file are commented and ha sql_mode system variable to NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES\&. This setting produces a server configuration that results in errors rather than warnings for bad data in operations that modify transactional tables\&. See -Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&. +Section\ \&5.1.10, \(lqServer SQL Modes\(rq\&. .PP To invoke \fBmysql_install_db\fR, use the following syntax: diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1 index c7fbebcdafd7..773f9a4ecf92 100644 --- a/man/mysql_plugin.1 +++ b/man/mysql_plugin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_plugin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_PLUGIN\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_PLUGIN\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_secure_installation.1 b/man/mysql_secure_installation.1 index 0c6b79b57027..ba3229e9df66 100644 --- a/man/mysql_secure_installation.1 +++ b/man/mysql_secure_installation.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_secure_installation\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SECURE_INSTALLATION\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SECURE_INSTALLATION\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_setpermission.1 b/man/mysql_setpermission.1 index 2617bea4613d..b994772a49e9 100644 --- a/man/mysql_setpermission.1 +++ b/man/mysql_setpermission.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_setpermission\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SETPERMISSION\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SETPERMISSION\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_tzinfo_to_sql.1 b/man/mysql_tzinfo_to_sql.1 index 629429bdc95c..f120c2dec5f4 100644 --- a/man/mysql_tzinfo_to_sql.1 +++ b/man/mysql_tzinfo_to_sql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_tzinfo_to_sql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_TZINFO_TO_SQL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_TZINFO_TO_SQL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -44,7 +44,7 @@ database (the set of files describing time zones)\&. Examples of such systems ar /usr/share/zoneinfo directory (/usr/share/lib/zoneinfo on Solaris)\&. If your system does not have a zoneinfo database, you can use the downloadable package described in -Section\ \&5.1.10, \(lqMySQL Server Time Zone Support\(rq\&. +Section\ \&5.1.12, \(lqMySQL Server Time Zone Support\(rq\&. .PP \fBmysql_tzinfo_to_sql\fR can be invoked several ways: diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index ba413036d620..b2a5d2a337ec 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_upgrade\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -241,7 +241,7 @@ option\&. .PP \fBmysql_upgrade\fR does not upgrade the contents of the help tables\&. For upgrade instructions, see -Section\ \&5.1.11, \(lqServer-Side Help\(rq\&. +Section\ \&5.1.13, \(lqServer-Side Help\(rq\&. .PP By default, \fBmysql_upgrade\fR diff --git a/man/mysql_waitpid.1 b/man/mysql_waitpid.1 index 40e989e81735..784509feea91 100644 --- a/man/mysql_waitpid.1 +++ b/man/mysql_waitpid.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_waitpid\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_WAITPID\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_WAITPID\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_zap.1 b/man/mysql_zap.1 index 8f5b8ba0b3d9..74e82441b455 100644 --- a/man/mysql_zap.1 +++ b/man/mysql_zap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_zap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_ZAP\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_ZAP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1 index a862645b775d..99b07210d072 100644 --- a/man/mysqlaccess.1 +++ b/man/mysqlaccess.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlaccess\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLACCESS\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLACCESS\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqladmin.1 b/man/mysqladmin.1 index e6865f222214..dae115e625a0 100644 --- a/man/mysqladmin.1 +++ b/man/mysqladmin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqladmin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLADMIN\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLADMIN\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1 index 77f92150f1e6..c5f0a13c846c 100644 --- a/man/mysqlbinlog.1 +++ b/man/mysqlbinlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbinlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -321,17 +321,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR (64-bit platforms) +\fBDefault Value\fR (64-bit platforms) T}:T{ 4294967040 T} T{ -\fBMinimum\fR (64-bit platforms) +\fBMinimum Value\fR (64-bit platforms) T}:T{ 256 T} T{ -\fBMaximum\fR (64-bit platforms) +\fBMaximum Value\fR (64-bit platforms) T}:T{ 18446744073709547520 T} @@ -1788,36 +1788,36 @@ T{ T}:T{ UNKNOWN_EVENT T}:T{ -This event should never be present in the log\&. +This event should never be present in the log. T} T{ 01 T}:T{ START_EVENT_V3 T}:T{ -This indicates the start of a log file written by MySQL 4 or earlier\&. +This indicates the start of a log file written by MySQL 4 or earlier. T} T{ 02 T}:T{ QUERY_EVENT T}:T{ -The most common type of events\&. These contain statements executed on the - master\&. +The most common type of events. These contain statements executed on the + master. T} T{ 03 T}:T{ STOP_EVENT T}:T{ -Indicates that master has stopped\&. +Indicates that master has stopped. T} T{ 04 T}:T{ ROTATE_EVENT T}:T{ -Written when the master switches to a new log file\&. +Written when the master switches to a new log file. T} T{ 05 @@ -1825,8 +1825,8 @@ T}:T{ INTVAR_EVENT T}:T{ Used for AUTO_INCREMENT values or when the - LAST_INSERT_ID() - function is used in the statement\&. + LAST_INSERT_ID() + function is used in the statement. T} T{ 06 @@ -1834,14 +1834,14 @@ T}:T{ LOAD_EVENT T}:T{ Used for LOAD DATA - INFILE in MySQL 3\&.23\&. + INFILE in MySQL 3.23. T} T{ 07 T}:T{ SLAVE_EVENT T}:T{ -Reserved for future use\&. +Reserved for future use. T} T{ 08 @@ -1849,9 +1849,9 @@ T}:T{ CREATE_FILE_EVENT T}:T{ Used for LOAD DATA - INFILE statements\&. This indicates the - start of execution of such a statement\&. A temporary - file is created on the slave\&. Used in MySQL 4 only\&. + INFILE statements. This indicates the start + of execution of such a statement. A temporary file is + created on the slave. Used in MySQL 4 only. T} T{ 09 @@ -1859,9 +1859,9 @@ T}:T{ APPEND_BLOCK_EVENT T}:T{ Contains data for use in a - LOAD DATA - INFILE statement\&. The data is stored in - the temporary file on the slave\&. + LOAD DATA + INFILE statement. The data is stored in the + temporary file on the slave. T} T{ 0a @@ -1869,9 +1869,9 @@ T}:T{ EXEC_LOAD_EVENT T}:T{ Used for LOAD DATA - INFILE statements\&. The contents of the - temporary file is stored in the table on the slave\&. - Used in MySQL 4 only\&. + INFILE statements. The contents of the + temporary file is stored in the table on the slave. + Used in MySQL 4 only. T} T{ 0b @@ -1879,8 +1879,8 @@ T}:T{ DELETE_FILE_EVENT T}:T{ Rollback of a LOAD DATA - INFILE statement\&. The temporary file - should be deleted on the slave\&. + INFILE statement. The temporary file should + be deleted on the slave. T} T{ 0c @@ -1888,7 +1888,7 @@ T}:T{ NEW_LOAD_EVENT T}:T{ Used for LOAD DATA - INFILE in MySQL 4 and earlier\&. + INFILE in MySQL 4 and earlier. T} T{ 0d @@ -1896,29 +1896,29 @@ T}:T{ RAND_EVENT T}:T{ Used to send information about random values if the - RAND() function is - used in the statement\&. + RAND() function is used + in the statement. T} T{ 0e T}:T{ USER_VAR_EVENT T}:T{ -Used to replicate user variables\&. +Used to replicate user variables. T} T{ 0f T}:T{ FORMAT_DESCRIPTION_EVENT T}:T{ -This indicates the start of a log file written by MySQL 5 or later\&. +This indicates the start of a log file written by MySQL 5 or later. T} T{ 10 T}:T{ XID_EVENT T}:T{ -Event indicating commit of an XA transaction\&. +Event indicating commit of an XA transaction. T} T{ 11 @@ -1926,7 +1926,7 @@ T}:T{ BEGIN_LOAD_QUERY_EVENT T}:T{ Used for LOAD DATA - INFILE statements in MySQL 5 and later\&. + INFILE statements in MySQL 5 and later. T} T{ 12 @@ -1934,69 +1934,69 @@ T}:T{ EXECUTE_LOAD_QUERY_EVENT T}:T{ Used for LOAD DATA - INFILE statements in MySQL 5 and later\&. + INFILE statements in MySQL 5 and later. T} T{ 13 T}:T{ TABLE_MAP_EVENT T}:T{ -Information about a table definition\&. Used in MySQL 5\&.1\&.5 and later\&. +Information about a table definition. Used in MySQL 5.1.5 and later. T} T{ 14 T}:T{ PRE_GA_WRITE_ROWS_EVENT T}:T{ -Row data for a single table that should be created\&. Used in MySQL 5\&.1\&.5 - to 5\&.1\&.17\&. +Row data for a single table that should be created. Used in MySQL 5.1.5 + to 5.1.17. T} T{ 15 T}:T{ PRE_GA_UPDATE_ROWS_EVENT T}:T{ -Row data for a single table that needs to be updated\&. Used in MySQL - 5\&.1\&.5 to 5\&.1\&.17\&. +Row data for a single table that needs to be updated. Used in MySQL + 5.1.5 to 5.1.17. T} T{ 16 T}:T{ PRE_GA_DELETE_ROWS_EVENT T}:T{ -Row data for a single table that should be deleted\&. Used in MySQL 5\&.1\&.5 - to 5\&.1\&.17\&. +Row data for a single table that should be deleted. Used in MySQL 5.1.5 + to 5.1.17. T} T{ 17 T}:T{ WRITE_ROWS_EVENT T}:T{ -Row data for a single table that should be created\&. Used in MySQL 5\&.1\&.18 - and later\&. +Row data for a single table that should be created. Used in MySQL 5.1.18 + and later. T} T{ 18 T}:T{ UPDATE_ROWS_EVENT T}:T{ -Row data for a single table that needs to be updated\&. Used in MySQL - 5\&.1\&.18 and later\&. +Row data for a single table that needs to be updated. Used in MySQL + 5.1.18 and later. T} T{ 19 T}:T{ DELETE_ROWS_EVENT T}:T{ -Row data for a single table that should be deleted\&. Used in MySQL 5\&.1\&.18 - and later\&. +Row data for a single table that should be deleted. Used in MySQL 5.1.18 + and later. T} T{ 1a T}:T{ INCIDENT_EVENT T}:T{ -Something out of the ordinary happened\&. Added in MySQL 5\&.1\&.18\&. +Something out of the ordinary happened. Added in MySQL 5.1.18. T} .TE .sp 1 @@ -2064,21 +2064,20 @@ T{ T}:T{ LOG_EVENT_BINLOG_IN_USE_F T}:T{ -Log file correctly closed\&. (Used only in - FORMAT_DESCRIPTION_EVENT\&.) If - this flag is set (if the flags are, for example, - \*(Aq01 00\*(Aq) in a - FORMAT_DESCRIPTION_EVENT, the log - file has not been properly closed\&. Most probably - this is because of a master crash (for example, due - to power failure)\&. +Log file correctly closed. (Used only in + FORMAT_DESCRIPTION_EVENT.) If this + flag is set (if the flags are, for example, + '01 00') in a + FORMAT_DESCRIPTION_EVENT, the log + file has not been properly closed. Most probably this + is because of a master crash (for example, due to + power failure). T} T{ 02 T}:T{ -\ \& T}:T{ -Reserved for future use\&. +Reserved for future use. T} T{ 04 @@ -2086,8 +2085,8 @@ T}:T{ LOG_EVENT_THREAD_SPECIFIC_F T}:T{ Set if the event is dependent on the connection it was executed in (for - example, \*(Aq04 00\*(Aq), for example, - if the event uses temporary tables\&. + example, '04 00'), for example, if + the event uses temporary tables. T} T{ 08 @@ -2095,7 +2094,7 @@ T}:T{ LOG_EVENT_SUPPRESS_USE_F T}:T{ Set in some circumstances when the event is not dependent on the default - database\&. + database. T} .TE .sp 1 @@ -2709,7 +2708,7 @@ value consists only of a directory name, the value must end with the pathname se allbox tab(:); lB lB. T{ -\fB\-\-result\-file\fR Option +\fB--result-file\fR Option T}:T{ Output File Names T} @@ -2718,19 +2717,19 @@ l l l l l l. T{ -\fB\-\-result\-file=x\fR +\fB--result-file=x\fR T}:T{ -xbinlog\&.000999 and up +xbinlog.000999 and up T} T{ -\fB\-\-result\-file=/tmp/\fR +\fB--result-file=/tmp/\fR T}:T{ -/tmp/binlog\&.000999 and up +/tmp/binlog.000999 and up T} T{ -\fB\-\-result\-file=/tmp/x\fR +\fB--result-file=/tmp/x\fR T}:T{ -/tmp/xbinlog\&.000999 and up +/tmp/xbinlog.000999 and up T} .TE .sp 1 diff --git a/man/mysqlbug.1 b/man/mysqlbug.1 index b0419f41db04..6ba8824eb660 100644 --- a/man/mysqlbug.1 +++ b/man/mysqlbug.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbug\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBUG\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBUG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1 index 65d18134a1c9..cf64f2c062b0 100644 --- a/man/mysqlcheck.1 +++ b/man/mysqlcheck.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlcheck\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLCHECK\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLCHECK\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -179,17 +179,17 @@ l l. T{ \fBmysqlrepair\fR T}:T{ -The default option is \fB\-\-repair\fR +The default option is \fB--repair\fR T} T{ \fBmysqlanalyze\fR T}:T{ -The default option is \fB\-\-analyze\fR +The default option is \fB--analyze\fR T} T{ \fBmysqloptimize\fR T}:T{ -The default option is \fB\-\-optimize\fR +The default option is \fB--optimize\fR T} .TE .sp 1 diff --git a/man/mysqld.8 b/man/mysqld.8 index 2f7fcd860e0a..389e26b0a385 100644 --- a/man/mysqld.8 +++ b/man/mysqld.8 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD\FR" "8" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD\FR" "8" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1 index d7c6fb5abbc7..30fc19325fee 100644 --- a/man/mysqld_multi.1 +++ b/man/mysqld_multi.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_multi\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_MULTI\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_MULTI\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1 index 63cb429e427d..455f6efc4841 100644 --- a/man/mysqld_safe.1 +++ b/man/mysqld_safe.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_safe\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_SAFE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_SAFE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -58,7 +58,7 @@ Many of the options to \fBmysqld_safe\fR are the same as the options to \fBmysqld\fR\&. See -Section\ \&5.1.4, \(lqServer Command Options\(rq\&. +Section\ \&5.1.6, \(lqServer Command Options\(rq\&. .PP Options unknown to \fBmysqld_safe\fR diff --git a/man/mysqldump.1 b/man/mysqldump.1 index b4d91017e318..890de050da6b 100644 --- a/man/mysqldump.1 +++ b/man/mysqldump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLDUMP\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLDUMP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1453,19 +1453,19 @@ l l. T{ OFF T}:T{ -Add no SET statement to the output\&. +Add no SET statement to the output. T} T{ ON T}:T{ -Add a SET statement to the output\&. An error occurs if - GTIDs are not enabled on the server\&. +Add a SET statement to the output. An error occurs if + GTIDs are not enabled on the server. T} T{ AUTO T}:T{ Add a SET statement to the output if GTIDs are - enabled on the server\&. + enabled on the server. T} .TE .sp 1 @@ -1580,13 +1580,11 @@ maxdb, no_key_options, no_table_options, or no_field_options\&. To use several values, separate them by commas\&. These values have the same meaning as the corresponding options for setting the server SQL mode\&. See -Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&. +Section\ \&5.1.10, \(lqServer SQL Modes\(rq\&. .sp This option does not guarantee compatibility with other servers\&. It only enables those SQL mode values that are currently available for making dump output more compatible\&. For example, \fB\-\-compatible=oracle\fR does not map data types to Oracle types or use Oracle comment syntax\&. -.sp -\fIThis option requires a server version of 4\&.1\&.0 or higher\fR\&. With older servers, it does nothing\&. .RE .sp .RS 4 @@ -1846,16 +1844,19 @@ l l. T{ NULL (\fIunknown value\fR) T}:T{ +.PP T} T{ -\*(Aq\*(Aq (\fIempty string\fR) +'' (\fIempty string\fR) T}:T{ +.PP T} T{ -\*(AqNULL\*(Aq (\fIstring value\fR) +'NULL' (\fIstring value\fR) T}:T{ +.PP NULL T} .TE diff --git a/man/mysqlhotcopy.1 b/man/mysqlhotcopy.1 index b9b8d29b808f..29a45ea6527d 100644 --- a/man/mysqlhotcopy.1 +++ b/man/mysqlhotcopy.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlhotcopy\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLHOTCOPY\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLHOTCOPY\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlimport.1 b/man/mysqlimport.1 index 274e1d4ce684..ea870f72db74 100644 --- a/man/mysqlimport.1 +++ b/man/mysqlimport.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlimport\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLIMPORT\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLIMPORT\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlshow.1 b/man/mysqlshow.1 index 42200e85e7fe..d162af7a21ed 100644 --- a/man/mysqlshow.1 +++ b/man/mysqlshow.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlshow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSHOW\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSHOW\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlslap.1 b/man/mysqlslap.1 index c93e88f0138d..b3379ae07365 100644 --- a/man/mysqlslap.1 +++ b/man/mysqlslap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlslap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSLAP\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSLAP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb-common-options.1 b/man/ndb-common-options.1 index dafbbb247e42..a23da1cec28b 100644 --- a/man/ndb-common-options.1 +++ b/man/ndb-common-options.1 @@ -2,12 +2,12 @@ .\" Title: Options Common to NDB Cluster Programs .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "OPTIONS COMMON TO NDB CLUSTER PROGRAMS" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "OPTIONS COMMON TO NDB CLUSTER PROGRAMS" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -105,7 +105,7 @@ The options in the following table are common to all NDB Cluster executables (ex .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.96.\ \& This table describes command\-line options common to all MySQL NDB Cluster programs +.B Table\ \&18.319.\ \&Command\-line options common to all MySQL NDB Cluster programs .TS allbox tab(:); lB lB lB. @@ -114,7 +114,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -175,7 +175,7 @@ T{ --debug=options T}:T{ Enable output from debug calls. Can be used only for versions compiled - with debugging enabled + with debugging enabled T}:T{ .PP All MySQL 5.6 based releases @@ -238,8 +238,9 @@ T{ -c T}:T{ Set connection string for connecting to ndb_mgmd. Syntax: - [nodeid=;][host=][:]. - Overrides entries specified in NDB_CONNECTSTRING or my.cnf. + [nodeid=;][host=][:]. + Overrides entries specified in NDB_CONNECTSTRING or + my.cnf. T}:T{ .PP All MySQL 5.6 based releases @@ -343,7 +344,7 @@ T}:T{ directory name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -391,17 +392,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR (>= 5.6.28-ndb-7.4.9) +\fBDefault Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 12 T} T{ -\fBMinimum\fR (>= 5.6.28-ndb-7.4.9) +\fBMinimum Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 0 T} T{ -\fBMaximum\fR (>= 5.6.28-ndb-7.4.9) +\fBMaximum Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 4294967295 T} @@ -469,17 +470,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR (>= 5.6.28-ndb-7.4.9) +\fBDefault Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 5 T} T{ -\fBMinimum\fR (>= 5.6.28-ndb-7.4.9) +\fBMinimum Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 0 T} T{ -\fBMaximum\fR (>= 5.6.28-ndb-7.4.9) +\fBMaximum Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 4294967295 T} @@ -523,7 +524,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -576,7 +577,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ d:t:O,/tmp/ndb_restore.trace T} @@ -619,7 +620,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -660,7 +661,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -701,7 +702,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -730,15 +731,13 @@ T}:T{ Value T} .T& -l l l l. T{ \fBCommand-Line Format\fR T}:T{ +.PP --help -T} -T{ -T}:T{ +.PP --usage T} .TE @@ -778,7 +777,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -809,15 +808,13 @@ T} .T& l l l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ +.PP --ndb-connectstring=connectstring -T} -T{ -T}:T{ +.PP --connect-string=connectstring T} T{ @@ -826,7 +823,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ localhost:1186 T} @@ -880,7 +877,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ localhost:1186 T} @@ -923,7 +920,7 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} @@ -966,7 +963,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} @@ -1007,7 +1004,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} @@ -1048,7 +1045,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} diff --git a/man/ndb_blob_tool.1 b/man/ndb_blob_tool.1 index c54a330eebfd..cc6aca2676a6 100644 --- a/man/ndb_blob_tool.1 +++ b/man/ndb_blob_tool.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_blob_tool\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_BLOB_TOOL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_BLOB_TOOL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -93,7 +93,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.79.\ \& This table describes command\-line options for the ndb_blob_tool program +.B Table\ \&18.300.\ \&Command\-line options for the ndb_blob_tool program .TS allbox tab(:); lB lB lB. @@ -102,7 +102,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -194,7 +194,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -236,7 +236,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -277,7 +277,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -318,7 +318,7 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -360,7 +360,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} diff --git a/man/ndb_config.1 b/man/ndb_config.1 index 99b7f2189030..b6a5486b17f4 100644 --- a/man/ndb_config.1 +++ b/man/ndb_config.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_CONFIG\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_CONFIG\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -68,7 +68,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.80.\ \& This table describes command\-line options for the ndb_config program +.B Table\ \&18.301.\ \&Command\-line options for the ndb_config program .TS allbox tab(:); lB lB lB. @@ -77,7 +77,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -111,7 +111,7 @@ T{ --config_from_node=# T}:T{ Obtain configuration data from the node having this ID (must be a data - node). + node). T}:T{ .PP All MySQL 5.6 based releases @@ -121,8 +121,8 @@ T{ --configinfo T}:T{ Dumps information about all NDB configuration parameters in text format - with default, maximum, and minimum values. Use with --xml to - obtain XML output. + with default, maximum, and minimum values. Use with --xml + to obtain XML output. T}:T{ .PP All MySQL 5.6 based releases @@ -132,9 +132,9 @@ T{ --connections T}:T{ Print connections information ([tcp], [tcp default], [sci], [sci - default], [shm], or [shm default] sections of cluster - configuration file) only. Cannot be used with --system or - --nodes. + default], [shm], or [shm default] sections of cluster + configuration file) only. Cannot be used with --system or + --nodes. T}:T{ .PP All MySQL 5.6 based releases @@ -193,8 +193,8 @@ T{ --nodes T}:T{ Print node information ([ndbd] or [ndbd default] section of cluster - configuration file) only. Cannot be used with --system or - --connections. + configuration file) only. Cannot be used with --system or + --connections. T}:T{ .PP All MySQL 5.6 based releases @@ -246,7 +246,7 @@ T{ --system T}:T{ Print SYSTEM section information only (see ndb_config --configinfo - output). Cannot be used with --nodes or --connections. + output). Cannot be used with --nodes or --connections. T}:T{ .PP All MySQL 5.6 based releases @@ -265,8 +265,8 @@ T{ --configinfo --xml T}:T{ Use --xml with --configinfo to obtain a dump of all NDB configuration - parameters in XML format with default, maximum, and minimum - values. + parameters in XML format with default, maximum, and + minimum values. T}:T{ .PP All MySQL 5.6 based releases @@ -416,7 +416,7 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -460,17 +460,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ none T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 1 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 48 T} @@ -515,7 +515,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -581,7 +581,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR (>= 5.6.36-ndb-7.4.16) +\fBDefault Value\fR (>= 5.6.36-ndb-7.4.16) T}:T{ FALSE T} @@ -624,7 +624,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -687,7 +687,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -757,7 +757,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -801,7 +801,7 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} @@ -844,7 +844,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -886,15 +886,13 @@ T} .T& l l l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ +.PP --ndb-connectstring=connectstring -T} -T{ -T}:T{ +.PP --connect-string=connectstring T} T{ @@ -903,7 +901,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ localhost:1186 T} @@ -948,7 +946,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1050,7 +1048,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1111,7 +1109,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -1153,8 +1151,6 @@ T} l l l l l l -l l -l l l l. T{ \fBCommand-Line Format\fR @@ -1167,21 +1163,18 @@ T}:T{ enumeration T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} T{ \fBValid Values\fR T}:T{ +.PP ndbd -T} -T{ -T}:T{ +.PP mysqld -T} -T{ -T}:T{ +.PP ndb_mgmd T} .TE @@ -1213,15 +1206,13 @@ T}:T{ Value T} .T& -l l l l. T{ \fBCommand-Line Format\fR T}:T{ +.PP --help -T} -T{ -T}:T{ +.PP --usage T} .TE @@ -1296,7 +1287,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} @@ -1312,7 +1303,7 @@ to provide output as XML by adding this option\&. A portion of such output is sh .\} .nf shell> \fBndb_config \-\-configinfo \-\-xml\fR -
diff --git a/man/ndb_cpcd.1 b/man/ndb_cpcd.1 index 0064c3e63108..4ddaf69c030e 100644 --- a/man/ndb_cpcd.1 +++ b/man/ndb_cpcd.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_cpcd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_CPCD\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_CPCD\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_delete_all.1 b/man/ndb_delete_all.1 index 0b870160d20d..6cae9d5df815 100644 --- a/man/ndb_delete_all.1 +++ b/man/ndb_delete_all.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_delete_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DELETE_ALL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DELETE_ALL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -69,7 +69,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.81.\ \& This table describes command\-line options for the ndb_delete_all program +.B Table\ \&18.302.\ \&Command\-line options for the ndb_delete_all program .TS allbox tab(:); lB lB lB. @@ -78,7 +78,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l diff --git a/man/ndb_desc.1 b/man/ndb_desc.1 index 233763cb623c..9d7e50064394 100644 --- a/man/ndb_desc.1 +++ b/man/ndb_desc.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_desc\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DESC\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DESC\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -324,7 +324,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.82.\ \& This table describes command\-line options for the ndb_desc program +.B Table\ \&18.303.\ \&Command\-line options for the ndb_desc program .TS allbox tab(:); lB lB lB. @@ -333,7 +333,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -350,7 +350,7 @@ T{ -b T}:T{ Include partition information for BLOB tables in output. Requires that - the -p option also be used + the -p option also be used T}:T{ .PP All MySQL 5.6 based releases @@ -373,7 +373,7 @@ T{ -n T}:T{ Include partition-to-data-node mappings in output. Requires that the -p - option also be used + option also be used T}:T{ .PP All MySQL 5.6 based releases @@ -407,7 +407,7 @@ T{ -t T}:T{ Specify the table in which to find an index. When this option is used, - -p and -n have no effect and are ignored. + -p and -n have no effect and are ignored. T}:T{ .PP All MySQL 5.6 based releases diff --git a/man/ndb_drop_index.1 b/man/ndb_drop_index.1 index 6742d360aed5..e9ed30e3edf9 100644 --- a/man/ndb_drop_index.1 +++ b/man/ndb_drop_index.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_drop_index\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DROP_INDEX\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DROP_INDEX\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -67,7 +67,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.83.\ \& This table describes command\-line options for the ndb_drop_index program +.B Table\ \&18.304.\ \&Command\-line options for the ndb_drop_index program .TS allbox tab(:); lB lB lB. @@ -76,7 +76,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l. @@ -122,7 +122,7 @@ Enter password: ******* Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with \-A Welcome to the MySQL monitor\&. Commands end with ; or \eg\&. -Your MySQL connection id is 7 to server version: 5\&.6\&.39\-ndb\-7\&.3\&.21 +Your MySQL connection id is 7 to server version: 5\&.6\&.41\-ndb\-7\&.3\&.22 Type \*(Aqhelp;\*(Aq or \*(Aq\eh\*(Aq for help\&. Type \*(Aq\ec\*(Aq to clear the buffer\&. mysql> \fBSHOW TABLES;\fR +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ diff --git a/man/ndb_drop_table.1 b/man/ndb_drop_table.1 index 340f5319b80d..4b0bbf08cb85 100644 --- a/man/ndb_drop_table.1 +++ b/man/ndb_drop_table.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_drop_table\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DROP_TABLE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DROP_TABLE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -65,7 +65,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.84.\ \& This table describes command\-line options for the ndb_drop_table program +.B Table\ \&18.305.\ \&Command\-line options for the ndb_drop_table program .TS allbox tab(:); lB lB lB. @@ -74,7 +74,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l. diff --git a/man/ndb_error_reporter.1 b/man/ndb_error_reporter.1 index 39588f2ca4bb..553222dfb4d9 100644 --- a/man/ndb_error_reporter.1 +++ b/man/ndb_error_reporter.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_error_reporter\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_ERROR_REPORTER\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_ERROR_REPORTER\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -56,7 +56,7 @@ options were also added in this release (Bug #16602002)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.85.\ \& This table describes command\-line options for the ndb_error_reporter program +.B Table\ \&18.306.\ \&Command\-line options for the ndb_error_reporter program .TS allbox tab(:); lB lB lB. @@ -65,7 +65,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -95,7 +95,7 @@ T{ --fs T}:T{ Include file system data in error report; can use a large amount of disk - space + space T}:T{ .PP All MySQL 5.6 based releases @@ -172,7 +172,7 @@ T}:T{ integer T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} @@ -219,7 +219,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} @@ -262,7 +262,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -313,7 +313,7 @@ T}:T{ integer T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} diff --git a/man/ndb_index_stat.1 b/man/ndb_index_stat.1 index 28d56e6906a2..a2ce3cfc4061 100644 --- a/man/ndb_index_stat.1 +++ b/man/ndb_index_stat.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_index_stat\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_INDEX_STAT\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_INDEX_STAT\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -176,7 +176,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.86.\ \& This table describes command\-line options for the ndb_index_stat program +.B Table\ \&18.307.\ \&Command\-line options for the ndb_index_stat program .TS allbox tab(:); lB lB lB. @@ -185,7 +185,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -218,7 +218,7 @@ T{ --delete T}:T{ Delete index statistics for the given table, stopping any auto-update - previously configured. + previously configured. T}:T{ .PP All MySQL 5.6 based releases @@ -228,7 +228,7 @@ T{ --update T}:T{ Update index statistics for the given table, restarting any auto-update - previously configured. + previously configured. T}:T{ .PP All MySQL 5.6 based releases @@ -247,7 +247,7 @@ T{ --query=# T}:T{ Perform a number of random range queries on first key attr (must be int - unsigned). + unsigned). T}:T{ .PP All MySQL 5.6 based releases @@ -257,7 +257,7 @@ T{ --sys-drop T}:T{ Drop any statistics tables and events in NDB kernel (all statistics are - lost) + lost) T}:T{ .PP All MySQL 5.6 based releases @@ -267,7 +267,7 @@ T{ --sys-create T}:T{ Create all statistics tables and events in NDB kernel, if none of them - already exist + already exist T}:T{ .PP All MySQL 5.6 based releases @@ -277,7 +277,7 @@ T{ --sys-create-if-not-exist T}:T{ Create any statistics tables and events in NDB kernel that do not - already exist. + already exist. T}:T{ .PP All MySQL 5.6 based releases @@ -287,7 +287,7 @@ T{ --sys-create-if-not-valid T}:T{ Create any statistics tables or events that do not already exist in the - NDB kernel. after dropping any that are invalid. + NDB kernel. after dropping any that are invalid. T}:T{ .PP All MySQL 5.6 based releases @@ -380,16 +380,16 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -431,16 +431,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -482,16 +482,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -533,16 +533,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -584,17 +584,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ MAX_INT T} @@ -640,16 +640,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -692,16 +692,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -743,16 +743,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -794,16 +794,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -845,16 +845,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -896,16 +896,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -949,16 +949,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -1002,16 +1002,16 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ false T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ T} .TE @@ -1053,17 +1053,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ MAX_INT T} diff --git a/man/ndb_mgm.1 b/man/ndb_mgm.1 index f5e8cb4f62c6..259d9dc00398 100644 --- a/man/ndb_mgm.1 +++ b/man/ndb_mgm.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_mgm\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MGM\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MGM\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -76,7 +76,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.78.\ \& This table describes command\-line options for the ndb_mgm program +.B Table\ \&18.299.\ \&Command\-line options for the ndb_mgm program .TS allbox tab(:); lB lB lB. @@ -85,7 +85,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -96,7 +96,7 @@ T{ --connect-retries=# T}:T{ Set the number of times to retry a connection before giving up; 0 means - 1 attempt only (and no retries) + 1 attempt only (and no retries) T}:T{ .PP ADDED: NDB 7.4.9 @@ -108,10 +108,10 @@ T{ -t T}:T{ Set the number of times to retry a connection before giving up; synonym - for --connect-retries + for --connect-retries T}:T{ .PP -All MySQL 5.6 based releases +DEPRECATED: NDB 7.4.9 T} T{ .PP @@ -167,17 +167,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR (>= 5.6.28-ndb-7.4.9) +\fBDefault Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 3 T} T{ -\fBMinimum\fR (>= 5.6.28-ndb-7.4.9) +\fBMinimum Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 0 T} T{ -\fBMaximum\fR (>= 5.6.28-ndb-7.4.9) +\fBMaximum Value\fR (>= 5.6.28-ndb-7.4.9) T}:T{ 4294967295 T} @@ -305,17 +305,17 @@ T}:T{ integer T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 3 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 4294967295 T} diff --git a/man/ndb_mgmd.8 b/man/ndb_mgmd.8 index ba73ae5ad1c7..b2c5dc82d085 100644 --- a/man/ndb_mgmd.8 +++ b/man/ndb_mgmd.8 @@ -2,12 +2,12 @@ .\" Title: \fBndb_mgmd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MGMD\FR" "8" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MGMD\FR" "8" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.77.\ \& This table describes command\-line options for the ndb_mgmd program +.B Table\ \&18.298.\ \&Command\-line options for the ndb_mgmd program .TS allbox tab(:); lB lB lB. @@ -54,7 +54,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -72,56 +72,58 @@ l l l l l l l l l l l l +l l l l l l. T{ .PP ---config-file=file, -.PP --f +\fB \fR\fB--bind-address=host\fR\fB \fR T}:T{ -Specify the cluster configuration file; in NDB-6.4.0 and later, needs - --reload or --initial to override configuration cache if - present +Local bind address T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---configdir=directory, -.PP ---config-dir=directory +\fB \fR\fB--config-cache[=TRUE|FALSE]\fR\fB \fR T}:T{ -Specify the cluster management server's configuration cache directory +Enable the management server configuration cache; TRUE by default. T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---bind-address=host +\fB--config-file=file\fR +(>=), +.PP +\fB-f\fR +(>=) T}:T{ -Local bind address +Specify the cluster configuration file; in NDB-6.4.0 and later, needs + --reload or --initial to override configuration cache if + present T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---print-full-config, +\fB--configdir=directory\fR, .PP --P +\fB--config-dir=directory\fR +(>=7.0.8) T}:T{ -Print full configuration and exit +Specify the cluster management server's configuration cache directory T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---daemon, +\fB--daemon\fR, .PP --d +\fB \fR\fB-d\fR\fB \fR T}:T{ Run ndb_mgmd in daemon mode (default) T}:T{ @@ -130,45 +132,47 @@ All MySQL 5.6 based releases T} T{ .PP ---nodaemon +\fB \fR\fB--initial\fR\fB \fR T}:T{ -Do not run ndb_mgmd as a daemon +Causes the management server reload its configuration data from the + configuration file, bypassing the configuration cache T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---interactive +\fB \fR\fB--install[=name]\fR\fB \fR T}:T{ -Run ndb_mgmd in interactive mode (not officially supported in - production; for testing purposes only) +Used to install the management server process as a Windows service. Does + not apply on non-Windows platforms. T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---log-name=name +\fB \fR\fB--interactive\fR\fB \fR T}:T{ -A name to use when writing messages applying to this node in the cluster - log. +Run ndb_mgmd in interactive mode (not officially supported in + production; for testing purposes only) T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---no-nodeid-checks +\fB \fR\fB--log-name=name\fR\fB \fR T}:T{ -Do not provide any node id checks +A name to use when writing messages applying to this node in the cluster + log. T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---mycnf +\fB \fR\fB--mycnf\fR\fB \fR T}:T{ Read cluster configuration data from the my.cnf file T}:T{ @@ -177,61 +181,72 @@ All MySQL 5.6 based releases T} T{ .PP ---reload +\fB \fR\fB--no-nodeid-checks\fR\fB \fR T}:T{ -Causes the management server to compare the configuration file with its - configuration cache +Do not provide any node id checks T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---initial +\fB \fR\fB--nodaemon\fR\fB \fR T}:T{ -Causes the management server reload its configuration data from the - configuration file, bypassing the configuration cache +Do not run ndb_mgmd as a daemon T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---nowait-nodes=list +\fB \fR\fB--nowait-nodes=list\fR\fB \fR T}:T{ Do not wait for these management nodes when starting this management - server. Also requires --ndb-nodeid to be used. + server. Also requires --ndb-nodeid to be used. T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---config-cache[=TRUE|FALSE] +\fB--print-full-config\fR, +.PP +\fB \fR\fB-P\fR\fB \fR T}:T{ -Enable the management server configuration cache; TRUE by default. +Print full configuration and exit T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---install[=name] +\fB \fR\fB--reload\fR\fB \fR T}:T{ -Used to install the management server process as a Windows service. Does - not apply on non-Windows platforms. +Causes the management server to compare the configuration file with its + configuration cache T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---remove[=name] +\fB \fR\fB--remove[=name]\fR\fB \fR T}:T{ Used to remove a management server process that was previously installed - as a Windows service, optionally specifying the name of the - service to be removed. Does not apply on non-Windows - platforms. + as a Windows service, optionally specifying the name of + the service to be removed. Does not apply on non-Windows + platforms. +T}:T{ +.PP +All MySQL 5.6 based releases +T} +T{ +.PP +\fB--verbose\fR, +.PP +\fB \fR\fB-v\fR\fB \fR +T}:T{ +Write additional information to the log. T}:T{ .PP All MySQL 5.6 based releases @@ -271,7 +286,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -288,95 +303,6 @@ Causes the management server to bind to a specific network interface (host name .sp -1 .IP \(bu 2.3 .\} -\fB\-\-no\-nodeid\-checks\fR -.TS -allbox tab(:); -lB lB. -T{ -Property -T}:T{ -Value -T} -.T& -l l -l l -l l. -T{ -\fBCommand-Line Format\fR -T}:T{ ---no-nodeid-checks -T} -T{ -\fBType\fR -T}:T{ -boolean -T} -T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Do not perform any checks of node IDs\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-configdir=\fR\fB\fIdir_name\fR\fR -.TS -allbox tab(:); -lB lB. -T{ -Property -T}:T{ -Value -T} -.T& -l l -l l -l l -l l. -T{ -\fBCommand-Line Format\fR -T}:T{ ---configdir=directory -T} -T{ -T}:T{ ---config-dir=directory -T} -T{ -\fBType\fR -T}:T{ -file name -T} -T{ -\fBDefault\fR -T}:T{ -$INSTALLDIR/mysql-cluster -T} -.TE -.sp 1 -Specifies the cluster management server\*(Aqs configuration cache directory\&. -\fB\-\-config\-dir\fR -is an alias for this option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} \fB\-\-config\-cache\fR .TS allbox tab(:); @@ -401,7 +327,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} @@ -556,7 +482,7 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -593,7 +519,7 @@ caused removal of the configuration cache even if the file was not found\&. This .sp -1 .IP \(bu 2.3 .\} -\fB\-\-mycnf\fR +\fB\-\-configdir=\fR\fB\fIdir_name\fR\fR .TS allbox tab(:); lB lB. @@ -609,23 +535,26 @@ l l. T{ \fBCommand-Line Format\fR T}:T{ ---mycnf +.PP +--configdir=directory +.PP +--config-dir=directory T} T{ \fBType\fR T}:T{ -boolean +file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -FALSE +$INSTALLDIR/mysql-cluster T} .TE .sp 1 -Read configuration data from the -my\&.cnf -file\&. +Specifies the cluster management server\*(Aqs configuration cache directory\&. +\fB\-\-config\-dir\fR +is an alias for this option\&. .RE .sp .RS 4 @@ -661,7 +590,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} @@ -684,51 +613,6 @@ on Windows platforms\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-interactive\fR -.TS -allbox tab(:); -lB lB. -T{ -Property -T}:T{ -Value -T} -.T& -l l -l l -l l. -T{ -\fBCommand-Line Format\fR -T}:T{ ---interactive -T} -T{ -\fBType\fR -T}:T{ -boolean -T} -T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Starts -\fBndb_mgmd\fR -in interactive mode; that is, an -\fBndb_mgm\fR -client session is started as soon as the management server is running\&. This option does not start any other NDB Cluster nodes\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} \fB\-\-initial\fR .TS allbox tab(:); @@ -753,7 +637,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -798,7 +682,7 @@ option caused removal of the configuration cache even if the file was not found\ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-log\-name=\fR\fB\fIname\fR\fR +\fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR .TS allbox tab(:); lB lB. @@ -810,11 +694,17 @@ T} .T& l l l l +l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---log-name=name +--install[=name] +T} +T{ +\fBPlatform Specific\fR +T}:T{ +Windows T} T{ \fBType\fR @@ -822,13 +712,35 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -MgmtSrvr +ndb_mgmd T} .TE .sp 1 -Provides a name to be used for this node in the cluster log\&. +Causes +\fBndb_mgmd\fR +to be installed as a Windows service\&. Optionally, you can specify a name for the service; if not set, the service name defaults to +ndb_mgmd\&. Although it is preferable to specify other +\fBndb_mgmd\fR +program options in a +my\&.ini +or +my\&.cnf +configuration file, it is possible to use them together with +\fB\-\-install\fR\&. However, in such cases, the +\fB\-\-install\fR +option must be specified first, before any other options are given, for the Windows service installation to succeed\&. +.sp +It is generally not advisable to use this option together with the +\fB\-\-initial\fR +option, since this causes the configuration cache to be wiped and rebuilt every time the service is stopped and started\&. Care should also be taken if you intend to use any other +\fBndb_mgmd\fR +options that affect the starting of the management server, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so\&. +.sp +The +\fB\-\-install\fR +option has no effect on non\-Windows platforms\&. .RE .sp .RS 4 @@ -839,7 +751,7 @@ Provides a name to be used for this node in the cluster log\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-nodaemon\fR +\fB\-\-interactive\fR .TS allbox tab(:); lB lB. @@ -855,7 +767,7 @@ l l. T{ \fBCommand-Line Format\fR T}:T{ ---nodaemon +--interactive T} T{ \fBType\fR @@ -863,19 +775,17 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} .TE .sp 1 -Instructs -\fBndb_mgmd\fR -not to start as a daemon process\&. -.sp -The default behavior for +Starts \fBndb_mgmd\fR -on Windows is to run in the foreground, making this option unnecessary on Windows platforms\&. +in interactive mode; that is, an +\fBndb_mgm\fR +client session is started as soon as the management server is running\&. This option does not start any other NDB Cluster nodes\&. .RE .sp .RS 4 @@ -886,8 +796,7 @@ on Windows is to run in the foreground, making this option unnecessary on Window .sp -1 .IP \(bu 2.3 .\} -\fB\-\-print\-full\-config\fR, -\fB\-P\fR +\fB\-\-log\-name=\fR\fB\fIname\fR\fR .TS allbox tab(:); lB lB. @@ -903,25 +812,21 @@ l l. T{ \fBCommand-Line Format\fR T}:T{ ---print-full-config +--log-name=name T} T{ \fBType\fR T}:T{ -boolean +string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -FALSE +MgmtSrvr T} .TE .sp 1 -Shows extended information regarding the configuration of the cluster\&. With this option on the command line the -\fBndb_mgmd\fR -process prints information about the cluster setup including an extensive list of the cluster configuration sections as well as parameters and their values\&. Normally used together with the -\fB\-\-config\-file\fR -(\fB\-f\fR) option\&. +Provides a name to be used for this node in the cluster log\&. .RE .sp .RS 4 @@ -932,7 +837,7 @@ process prints information about the cluster setup including an extensive list o .sp -1 .IP \(bu 2.3 .\} -\fB\-\-reload\fR +\fB\-\-mycnf\fR .TS allbox tab(:); lB lB. @@ -948,7 +853,7 @@ l l. T{ \fBCommand-Line Format\fR T}:T{ ---reload +--mycnf T} T{ \fBType\fR @@ -956,33 +861,103 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} .TE .sp 1 -In NDB Cluster 7\&.3, configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache\&. Existing configuration cache files are preserved, but not used\&. +Read configuration data from the +my\&.cnf +file\&. +.RE .sp -This differs in two ways from the -\fB\-\-initial\fR -option\&. First, -\fB\-\-initial\fR -causes all cache files to be deleted\&. Second, -\fB\-\-initial\fR -forces the management server to re\-read the global configuration file and construct a new cache\&. +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-no\-nodeid\-checks\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--no-nodeid-checks +T} +T{ +\fBType\fR +T}:T{ +boolean +T} +T{ +\fBDefault Value\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Do not perform any checks of node IDs\&. +.RE .sp -If the management server cannot find a global configuration file, then the -\fB\-\-reload\fR -option is ignored\&. +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-nodaemon\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--nodaemon +T} +T{ +\fBType\fR +T}:T{ +boolean +T} +T{ +\fBDefault Value\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Instructs +\fBndb_mgmd\fR +not to start as a daemon process\&. .sp -When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server\*(Aqs configuration data; +The default behavior for \fBndb_mgmd\fR -ignores -\fB\-\-reload\fR -unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&. +on Windows is to run in the foreground, making this option unnecessary on Windows platforms\&. .RE .sp .RS 4 @@ -1019,16 +994,16 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 1 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 255 T} @@ -1143,23 +1118,6 @@ management server, its configuration must match that of the management server th .sp .5v .RE .RE -.PP -It is not strictly necessary to specify a connection string when starting the management server\&. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly\&. -.PP -See -Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for information about using connection strings\&. -\fBndb_mgmd\fR(8), describes other options for -\fBndb_mgmd\fR\&. -.PP -The following files are created or used by -\fBndb_mgmd\fR -in its starting directory, and are placed in the -DataDir -as specified in the -config\&.ini -configuration file\&. In the list that follows, -\fInode_id\fR -is the unique node identifier\&. .sp .RS 4 .ie n \{\ @@ -1169,9 +1127,42 @@ is the unique node identifier\&. .sp -1 .IP \(bu 2.3 .\} -config\&.ini -is the configuration file for the cluster as a whole\&. This file is created by the user and read by the management server\&. -Section\ \&18.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up this file\&. +\fB\-\-print\-full\-config\fR, +\fB\-P\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--print-full-config +T} +T{ +\fBType\fR +T}:T{ +boolean +T} +T{ +\fBDefault Value\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Shows extended information regarding the configuration of the cluster\&. With this option on the command line the +\fBndb_mgmd\fR +process prints information about the cluster setup including an extensive list of the cluster configuration sections as well as parameters and their values\&. Normally used together with the +\fB\-\-config\-file\fR +(\fB\-f\fR) option\&. .RE .sp .RS 4 @@ -1182,45 +1173,57 @@ Section\ \&18.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up t .sp -1 .IP \(bu 2.3 .\} -ndb_\fInode_id\fR_cluster\&.log -is the cluster events log file\&. Examples of such events include checkpoint startup and completion, node startup events, node failures, and levels of memory usage\&. A complete listing of cluster events with descriptions may be found in -Section\ \&18.5, \(lqManagement of NDB Cluster\(rq\&. +\fB\-\-reload\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--reload +T} +T{ +\fBType\fR +T}:T{ +boolean +T} +T{ +\fBDefault Value\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +In NDB Cluster 7\&.3, configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see +Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache\&. Existing configuration cache files are preserved, but not used\&. .sp -By default, when the size of the cluster log reaches one million bytes, the file is renamed to -ndb_\fInode_id\fR_cluster\&.log\&.\fIseq_id\fR, where -\fIseq_id\fR -is the sequence number of the cluster log file\&. (For example: If files with the sequence numbers 1, 2, and 3 already exist, the next log file is named using the number -4\&.) You can change the size and number of files, and other characteristics of the cluster log, using the -LogDestination -configuration parameter\&. -.RE +This differs in two ways from the +\fB\-\-initial\fR +option\&. First, +\fB\-\-initial\fR +causes all cache files to be deleted\&. Second, +\fB\-\-initial\fR +forces the management server to re\-read the global configuration file and construct a new cache\&. .sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR_out\&.log -is the file used for -stdout -and -stderr -when running the management server as a daemon\&. -.RE +If the management server cannot find a global configuration file, then the +\fB\-\-reload\fR +option is ignored\&. .sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR\&.pid -is the process ID file used when running the management server as a daemon\&. +When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server\*(Aqs configuration data; +\fBndb_mgmd\fR +ignores +\fB\-\-reload\fR +unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See +Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&. .RE .sp .RS 4 @@ -1231,7 +1234,7 @@ is the process ID file used when running the management server as a daemon\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR +\fB\-\-remove{=name]\fR .TS allbox tab(:); lB lB. @@ -1248,7 +1251,7 @@ l l. T{ \fBCommand-Line Format\fR T}:T{ ---install[=name] +--remove[=name] T} T{ \fBPlatform Specific\fR @@ -1261,35 +1264,13 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ ndb_mgmd T} .TE .sp 1 -Causes -\fBndb_mgmd\fR -to be installed as a Windows service\&. Optionally, you can specify a name for the service; if not set, the service name defaults to -ndb_mgmd\&. Although it is preferable to specify other -\fBndb_mgmd\fR -program options in a -my\&.ini -or -my\&.cnf -configuration file, it is possible to use them together with -\fB\-\-install\fR\&. However, in such cases, the -\fB\-\-install\fR -option must be specified first, before any other options are given, for the Windows service installation to succeed\&. -.sp -It is generally not advisable to use this option together with the -\fB\-\-initial\fR -option, since this causes the configuration cache to be wiped and rebuilt every time the service is stopped and started\&. Care should also be taken if you intend to use any other -\fBndb_mgmd\fR -options that affect the starting of the management server, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so\&. -.sp -The -\fB\-\-install\fR -option has no effect on non\-Windows platforms\&. +Remove a management server process that has been installed as a Windows service, optionally specifying the name of the service to be removed\&. Applies only to Windows platforms\&. .RE .sp .RS 4 @@ -1300,7 +1281,8 @@ option has no effect on non\-Windows platforms\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR +\fB\-\-verbose\fR, +\fB\-v\fR .TS allbox tab(:); lB lB. @@ -1312,38 +1294,104 @@ T} .T& l l l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---remove[=name] -T} -T{ -\fBPlatform Specific\fR -T}:T{ -Windows +--verbose T} T{ \fBType\fR T}:T{ -string +boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -ndb_mgmd +FALSE T} .TE .sp 1 -Causes an +Remove a management server process that has been installed as a Windows service, optionally specifying the name of the service to be removed\&. Applies only to Windows platforms\&. +.RE +.PP +It is not strictly necessary to specify a connection string when starting the management server\&. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly\&. +.PP +See +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for information about using connection strings\&. +\fBndb_mgmd\fR(8), describes other options for +\fBndb_mgmd\fR\&. +.PP +The following files are created or used by \fBndb_mgmd\fR -process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to -ndb_mgmd\&. +in its starting directory, and are placed in the +DataDir +as specified in the +config\&.ini +configuration file\&. In the list that follows, +\fInode_id\fR +is the unique node identifier\&. .sp -The -\fB\-\-remove\fR -option has no effect on non\-Windows platforms\&. +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +config\&.ini +is the configuration file for the cluster as a whole\&. This file is created by the user and read by the management server\&. +Section\ \&18.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up this file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ndb_\fInode_id\fR_cluster\&.log +is the cluster events log file\&. Examples of such events include checkpoint startup and completion, node startup events, node failures, and levels of memory usage\&. A complete listing of cluster events with descriptions may be found in +Section\ \&18.5, \(lqManagement of NDB Cluster\(rq\&. +.sp +By default, when the size of the cluster log reaches one million bytes, the file is renamed to +ndb_\fInode_id\fR_cluster\&.log\&.\fIseq_id\fR, where +\fIseq_id\fR +is the sequence number of the cluster log file\&. (For example: If files with the sequence numbers 1, 2, and 3 already exist, the next log file is named using the number +4\&.) You can change the size and number of files, and other characteristics of the cluster log, using the +LogDestination +configuration parameter\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ndb_\fInode_id\fR_out\&.log +is the file used for +stdout +and +stderr +when running the management server as a daemon\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ndb_\fInode_id\fR\&.pid +is the process ID file used when running the management server as a daemon\&. .RE .SH "COPYRIGHT" .br diff --git a/man/ndb_move_data.1 b/man/ndb_move_data.1 index bb3de524b932..4a4562f23cc5 100644 --- a/man/ndb_move_data.1 +++ b/man/ndb_move_data.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_move_data\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MOVE_DATA\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MOVE_DATA\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -58,7 +58,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.87.\ \& This table describes command\-line options for the ndb_move_data program +.B Table\ \&18.308.\ \&Command\-line options for the ndb_move_data program .TS allbox tab(:); lB lB lB. @@ -67,7 +67,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -163,7 +163,7 @@ T{ --staging-tries=x[,y[,z]] T}:T{ Specify tries on temporary errors. Format is x[,y[,z]] where x=max tries - (0=no limit), y=min delay (ms), z=max delay (ms) + (0=no limit), y=min delay (ms), z=max delay (ms) T}:T{ .PP All MySQL 5.6 based releases @@ -212,7 +212,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -253,7 +253,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -295,7 +295,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TEST_DB T} @@ -336,7 +336,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -377,7 +377,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -418,7 +418,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -460,7 +460,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -502,7 +502,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -543,7 +543,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0,1000,60000 T} @@ -584,7 +584,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} diff --git a/man/ndb_print_backup_file.1 b/man/ndb_print_backup_file.1 index 72d686d1c4af..19fc1ae84eb1 100644 --- a/man/ndb_print_backup_file.1 +++ b/man/ndb_print_backup_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_backup_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_BACKUP_FILE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_BACKUP_FILE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_file.1 b/man/ndb_print_file.1 index fbe0f315308c..d5968fa34c1d 100644 --- a/man/ndb_print_file.1 +++ b/man/ndb_print_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_FILE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_FILE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_frag_file.1 b/man/ndb_print_frag_file.1 index 93a4b6afd53b..b3b4a1d161f0 100644 --- a/man/ndb_print_frag_file.1 +++ b/man/ndb_print_frag_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_frag_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_FRAG_FILE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_FRAG_FILE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_schema_file.1 b/man/ndb_print_schema_file.1 index e72524d17fc2..3998c350b64d 100644 --- a/man/ndb_print_schema_file.1 +++ b/man/ndb_print_schema_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_schema_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_SCHEMA_FILE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_SCHEMA_FILE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_sys_file.1 b/man/ndb_print_sys_file.1 index 12960a39f03c..208f2489d1ff 100644 --- a/man/ndb_print_sys_file.1 +++ b/man/ndb_print_sys_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_sys_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_SYS_FILE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_SYS_FILE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_redo_log_reader.1 b/man/ndb_redo_log_reader.1 index 5f86cd488841..ad5dd7c1e72e 100644 --- a/man/ndb_redo_log_reader.1 +++ b/man/ndb_redo_log_reader.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_redo_log_reader\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_REDO_LOG_READER\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_REDO_LOG_READER\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -71,7 +71,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.88.\ \& This table describes command\-line options for the ndb_redo_log_reader program +.B Table\ \&18.309.\ \&Command\-line options for the ndb_redo_log_reader program .TS allbox tab(:); lB lB lB. @@ -80,7 +80,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -266,7 +266,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -306,7 +306,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -383,7 +383,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -425,17 +425,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 15 T} @@ -478,7 +478,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -518,7 +518,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -558,7 +558,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -600,17 +600,17 @@ T}:T{ integer T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 31 T} @@ -653,7 +653,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -695,17 +695,17 @@ T}:T{ integer T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 12 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 12 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 8191 T} @@ -749,7 +749,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} diff --git a/man/ndb_restore.1 b/man/ndb_restore.1 index 1e1ee1f9fa33..56042de553af 100644 --- a/man/ndb_restore.1 +++ b/man/ndb_restore.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_restore\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_RESTORE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_RESTORE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -72,7 +72,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.89.\ \& This table describes command\-line options for the ndb_restore program +.B Table\ \&18.310.\ \&Command\-line options for the ndb_restore program .TS allbox tab(:); lB lB lB. @@ -81,7 +81,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -172,7 +172,7 @@ T{ --disable-indexes T}:T{ Causes indexes from a backup to be ignored; may decrease time needed to - restore data. + restore data. T}:T{ .PP All MySQL 5.6 based releases @@ -184,7 +184,7 @@ T{ -f T}:T{ Do not ignore system table during restore. Experimental only; not for - production use + production use T}:T{ .PP All MySQL 5.6 based releases @@ -203,8 +203,8 @@ T{ --exclude-intermediate-sql-tables[=TRUE|FALSE] T}:T{ If TRUE (the default), do not restore any intermediate tables (having - names prefixed with '#sql-') that were left over from copying - ALTER TABLE operations. + names prefixed with '#sql-') that were left over from + copying ALTER TABLE operations. T}:T{ .PP ADDED: NDB 7.3.6 @@ -214,7 +214,7 @@ T{ --exclude-missing-columns T}:T{ Causes columns from the backup version of a table that are missing from - the version of the table in the database to be ignored. + the version of the table in the database to be ignored. T}:T{ .PP All MySQL 5.6 based releases @@ -224,7 +224,7 @@ T{ --exclude-missing-tables T}:T{ Causes tables from the backup that are missing from the database to be - ignored. + ignored. T}:T{ .PP ADDED: NDB 7.3.7 @@ -234,8 +234,8 @@ T{ --exclude-tables=table-list T}:T{ List of one or more tables to exclude (includes those in the same - database that are not named); each table reference must - include the database name + database that are not named); each table reference must + include the database name T}:T{ .PP All MySQL 5.6 based releases @@ -290,8 +290,8 @@ T{ --include-tables=table-list T}:T{ List of one or more tables to restore (excludes those in same database - that are not named); each table reference must include the - database name + that are not named); each table reference must include the + database name T}:T{ .PP All MySQL 5.6 based releases @@ -312,7 +312,7 @@ T{ -L T}:T{ Allow lossy conversions of column values (type demotions or changes in - sign) when restoring data from backup + sign) when restoring data from backup T}:T{ .PP All MySQL 5.6 based releases @@ -322,7 +322,7 @@ T{ --no-binlog T}:T{ If a mysqld is connected and using binary logging, do not log the - restored data + restored data T}:T{ .PP All MySQL 5.6 based releases @@ -345,7 +345,7 @@ T{ -u T}:T{ Do not upgrade array type for varsize attributes which do not already - resize VAR data, and do not change column attributes + resize VAR data, and do not change column attributes T}:T{ .PP All MySQL 5.6 based releases @@ -357,7 +357,7 @@ T{ -z T}:T{ Nodegroup map for NDBCLUSTER storage engine. Syntax: list of - (source_nodegroup, destination_nodegroup) + (source_nodegroup, destination_nodegroup) T}:T{ .PP All MySQL 5.6 based releases @@ -391,7 +391,7 @@ T{ -P T}:T{ Allow preservation of trailing spaces (including padding) when promoting - fixed-width string types to variable-width types + fixed-width string types to variable-width types T}:T{ .PP All MySQL 5.6 based releases @@ -401,7 +401,7 @@ T{ --print T}:T{ Print metadata, data and log to stdout (equivalent to --print_meta - --print_data --print_log) + --print_data --print_log) T}:T{ .PP All MySQL 5.6 based releases @@ -457,9 +457,9 @@ T{ .PP --rebuild-indexes T}:T{ -Causes multi-threaded rebuilding of ordered indexes found in the backup. - Number of threads used is determined by setting - BuildIndexThreads parameter. +Causes multithreaded rebuilding of ordered indexes found in the backup. + Number of threads used is determined by setting + BuildIndexThreads parameter. T}:T{ .PP All MySQL 5.6 based releases @@ -482,8 +482,8 @@ T{ -e T}:T{ Restore epoch info into the status table. Convenient on a MySQL Cluster - replication slave for starting replication. The row in - mysql.ndb_apply_status with id 0 will be updated/inserted. + replication slave for starting replication. The row in + mysql.ndb_apply_status with id 0 will be updated/inserted. T}:T{ .PP All MySQL 5.6 based releases @@ -542,8 +542,8 @@ T{ --skip-unknown-objects T}:T{ Causes schema objects not recognized by ndb_restore to be ignored when - restoring a backup made from a newer MySQL Cluster version to - an older version. + restoring a backup made from a newer MySQL Cluster version + to an older version. T}:T{ .PP All MySQL 5.6 based releases @@ -734,7 +734,7 @@ T}:T{ directory name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ ./ T} @@ -781,9 +781,9 @@ It is not possible to restore a backup made from a newer version of NDB Cluster \fBndb_restore\fR from the newer NDB Cluster version to do so\&. .sp -For example, to restore a cluster backup taken from a cluster running NDB Cluster 7\&.4\&.20 to a cluster running NDB Cluster 7\&.3\&.21, you must use the +For example, to restore a cluster backup taken from a cluster running NDB Cluster 7\&.4\&.21 to a cluster running NDB Cluster 7\&.3\&.22, you must use the \fBndb_restore\fR -that comes with the NDB Cluster 7\&.4\&.20 distribution\&. +that comes with the NDB Cluster 7\&.4\&.21 distribution\&. .sp .5v .RE For more rapid restoration, the data may be restored in parallel, provided that there is a sufficient number of cluster connections available\&. That is, when restoring to multiple nodes in parallel, you must have an @@ -830,7 +830,7 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ none T} @@ -890,7 +890,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ localhost:1186 T} @@ -928,7 +928,7 @@ T} .sp 1 Disable restoration of indexes during restoration of the data from a native NDB -backup\&. Afterwards, you can restore indexes for all tables at once with multi\-threaded building of indexes using +backup\&. Afterwards, you can restore indexes for all tables at once with multithreaded building of indexes using \fB\-\-rebuild\-indexes\fR, which should be faster than rebuilding indexes concurrently for very large tables\&. .RE .sp @@ -1001,7 +1001,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1050,7 +1050,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ TRUE T} @@ -1179,7 +1179,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1199,11 +1199,17 @@ This table shows several invocations of usng \fB\-\-exclude\-*\fR options (other options possibly required have been omitted for clarity), and the effects these options have on restoring from an NDB Cluster backup: +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&18.311.\ \&Several invocations of ndb_restore using \-\-exclude\-* options, and the effects these options have on restoring from an NDB Cluster backup\&. .TS allbox tab(:); lB lB. T{ -Option Used +Option T}:T{ Result T} @@ -1213,41 +1219,41 @@ l l l l l l. T{ -\fB\-\-exclude\-databases=db1\fR +\fB--exclude-databases=db1\fR T}:T{ All tables in all databases except db1 are restored; - no tables in db1 are restored + no tables in db1 are restored T} T{ -\fB\-\-exclude\-databases=db1,db2\fR (or - \fB\-\-exclude\-databases=db1\fR - \fB\-\-exclude\-databases=db2\fR) +\fB--exclude-databases=db1,db2\fR (or + \fB--exclude-databases=db1\fR + \fB--exclude-databases=db2\fR) T}:T{ All tables in all databases except db1 and - db2 are restored; no tables in - db1 or db2 are - restored + db2 are restored; no tables in + db1 or db2 are + restored T} T{ -\fB\-\-exclude\-tables=db1\&.t1\fR +\fB--exclude-tables=db1.t1\fR T}:T{ All tables except t1 in database - db1 are restored; all other - tables in db1 are restored; all - tables in all other databases are restored + db1 are restored; all other tables + in db1 are restored; all tables in + all other databases are restored T} T{ -\fB\-\-exclude\-tables=db1\&.t2,db2\&.t1\fR (or - \fB\-\-exclude\-tables=db1\&.t2\fR - \fB\-\-exclude\-tables=db2\&.t1)\fR +\fB--exclude-tables=db1.t2,db2.t1\fR (or + \fB--exclude-tables=db1.t2\fR + \fB--exclude-tables=db2.t1)\fR T}:T{ All tables in database db1 except for - t2 and all tables in database - db2 except for table - t1 are restored; no other tables - in db1 or db2 - are restored; all tables in all other databases are - restored + t2 and all tables in database + db2 except for table + t1 are restored; no other tables in + db1 or db2 are + restored; all tables in all other databases are + restored T} .TE .sp 1 @@ -1395,7 +1401,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1436,7 +1442,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1481,7 +1487,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ \t (tab) T} @@ -1551,7 +1557,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1592,7 +1598,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -1611,11 +1617,17 @@ The following table shows several invocations of using \fB\-\-include\-*\fR options (other options possibly required have been omitted for clarity), and the effects these have on restoring from an NDB Cluster backup: +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&18.312.\ \&Several invocations of ndb_restore using \-\-include\-* options, and their effects on restoring from an NDB Cluster backup\&. .TS allbox tab(:); lB lB. T{ -Option Used +Option T}:T{ Result T} @@ -1625,37 +1637,37 @@ l l l l l l. T{ -\fB\-\-include\-databases=db1\fR +\fB--include-databases=db1\fR T}:T{ Only tables in database db1 are restored; all tables - in all other databases are ignored + in all other databases are ignored T} T{ -\fB\-\-include\-databases=db1,db2\fR (or - \fB\-\-include\-databases=db1\fR - \fB\-\-include\-databases=db2\fR) +\fB--include-databases=db1,db2\fR (or + \fB--include-databases=db1\fR + \fB--include-databases=db2\fR) T}:T{ Only tables in databases db1 and - db2 are restored; all tables in - all other databases are ignored + db2 are restored; all tables in all + other databases are ignored T} T{ -\fB\-\-include\-tables=db1\&.t1\fR +\fB--include-tables=db1.t1\fR T}:T{ Only table t1 in database db1 is - restored; no other tables in db1 - or in any other database are restored + restored; no other tables in db1 or + in any other database are restored T} T{ -\fB\-\-include\-tables=db1\&.t2,db2\&.t1\fR (or - \fB\-\-include\-tables=db1\&.t2\fR - \fB\-\-include\-tables=db2\&.t1\fR) +\fB--include-tables=db1.t2,db2.t1\fR (or + \fB--include-tables=db1.t2\fR + \fB--include-tables=db2.t1\fR) T}:T{ Only the table t2 in database db1 - and the table t1 in database - db2 are restored; no other tables - in db1, db2, - or any other database are restored + and the table t1 in database + db2 are restored; no other tables + in db1, db2, or + any other database are restored T} .TE .sp 1 @@ -1753,7 +1765,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ \n (linebreak) T} @@ -1795,9 +1807,9 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -FALSE +FALSE (If option is not used) T} .TE .sp 1 @@ -1876,7 +1888,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -1987,7 +1999,7 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ none T} @@ -2034,17 +2046,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 128 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 1 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 1024 T} @@ -2157,7 +2169,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -2227,7 +2239,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -2283,7 +2295,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -2327,7 +2339,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -2371,17 +2383,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 0 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 65535 T} @@ -2543,7 +2555,7 @@ T}:T{ T} .TE .sp 1 -Enable multi\-threaded rebuilding of the ordered indexes while restoring a native +Enable multithreaded rebuilding of the ordered indexes while restoring a native NDB backup\&. The number of threads used for building ordered indexes by \fBndb_restore\fR @@ -2605,7 +2617,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -2686,7 +2698,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -2754,9 +2766,9 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -FALSE +FALSE (If option is not used) T} .TE .sp 1 @@ -2803,7 +2815,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ none T} @@ -3111,17 +3123,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 1 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 255 T} diff --git a/man/ndb_select_all.1 b/man/ndb_select_all.1 index b3050dd16a40..f64135f97051 100644 --- a/man/ndb_select_all.1 +++ b/man/ndb_select_all.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_select_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SELECT_ALL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SELECT_ALL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -60,7 +60,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.90.\ \& This table describes command\-line options for the ndb_select_all program +.B Table\ \&18.313.\ \&Command\-line options for the ndb_select_all program .TS allbox tab(:); lB lB lB. @@ -69,7 +69,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -179,7 +179,7 @@ T{ --disk T}:T{ Print disk references (useful only for Disk Data tables having - nonindexed columns) + nonindexed columns) T}:T{ .PP All MySQL 5.6 based releases diff --git a/man/ndb_select_count.1 b/man/ndb_select_count.1 index a8a881c1db23..8b1d578f76de 100644 --- a/man/ndb_select_count.1 +++ b/man/ndb_select_count.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_select_count\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SELECT_COUNT\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SELECT_COUNT\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -60,7 +60,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.91.\ \& This table describes command\-line options for the ndb_select_count program +.B Table\ \&18.314.\ \&Command\-line options for the ndb_select_count program .TS allbox tab(:); lB lB lB. @@ -69,7 +69,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l diff --git a/man/ndb_setup.py.1 b/man/ndb_setup.py.1 index e32334c4bc51..59aeeca0e99f 100644 --- a/man/ndb_setup.py.1 +++ b/man/ndb_setup.py.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_setup.py\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SETUP\&.PY\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SETUP\&.PY\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -91,7 +91,7 @@ The following table includes all options that are supported by the NDB Cluster i .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.92.\ \& This table describes command\-line options for the ndb_setup\&.py program +.B Table\ \&18.315.\ \&Command\-line options for the ndb_setup\&.py program .TS allbox tab(:); lB lB lB. @@ -100,7 +100,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -132,7 +132,7 @@ T{ -a T}:T{ File containing list of client certificates allowed to connect to the - server + server T}:T{ .PP All MySQL 5.6 based releases @@ -144,7 +144,7 @@ T{ -c T}:T{ File containing X509 certificate that identifies the server. (Default: - cfg.pem) + cfg.pem) T}:T{ .PP All MySQL 5.6 based releases @@ -156,7 +156,7 @@ T{ -d T}:T{ Python logging module debug level. One of DEBUG, INFO, WARNING - (default), ERROR, or CRITICAL. + (default), ERROR, or CRITICAL. T}:T{ .PP All MySQL 5.6 based releases @@ -274,7 +274,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ index.html T} @@ -317,7 +317,7 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -359,7 +359,7 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ cfg.pem T} @@ -391,10 +391,6 @@ T} l l l l l l -l l -l l -l l -l l l l. T{ \fBCommand-Line Format\fR @@ -407,29 +403,22 @@ T}:T{ enumeration T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ WARNING T} T{ \fBValid Values\fR T}:T{ +.PP WARNING -T} -T{ -T}:T{ +.PP DEBUG -T} -T{ -T}:T{ +.PP INFO -T} -T{ -T}:T{ +.PP ERROR -T} -T{ -T}:T{ +.PP CRITICAL T} .TE @@ -507,7 +496,7 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ [none] T} @@ -581,17 +570,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 8081 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 1 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ 65535 T} @@ -622,16 +611,13 @@ T} l l l l l l -l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ +.PP --server-log-file=file -T} -T{ -T}:T{ +.PP o T} T{ @@ -640,18 +626,18 @@ T}:T{ file name T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ ndb_setup.log T} T{ \fBValid Values\fR T}:T{ +.PP ndb_setup.log -T} -T{ -T}:T{ -- (Log to stderr) +.PP +- +(Log to stderr) T} .TE .sp 1 @@ -695,7 +681,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ localhost T} diff --git a/man/ndb_show_tables.1 b/man/ndb_show_tables.1 index b526aeeec1ff..dd145f7527b8 100644 --- a/man/ndb_show_tables.1 +++ b/man/ndb_show_tables.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_show_tables\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SHOW_TABLES\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SHOW_TABLES\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,7 +51,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.93.\ \& This table describes command\-line options for the ndb_show_tables program +.B Table\ \&18.316.\ \&Command\-line options for the ndb_show_tables program .TS allbox tab(:); lB lB lB. @@ -60,7 +60,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l diff --git a/man/ndb_size.pl.1 b/man/ndb_size.pl.1 index 076ed89ba8f5..5d15d5b80e02 100644 --- a/man/ndb_size.pl.1 +++ b/man/ndb_size.pl.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_size.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SIZE\&.PL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SIZE\&.PL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -101,7 +101,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.94.\ \& This table describes command\-line options for the ndb_size\&.pl program +.B Table\ \&18.317.\ \&Command\-line options for the ndb_size\&.pl program .TS allbox tab(:); lB lB lB. @@ -110,7 +110,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -129,7 +129,7 @@ T{ --database=dbname T}:T{ The database or databases to examine; accepts a comma-delimited list; - the default is ALL (use all databases found on the server) + the default is ALL (use all databases found on the server) T}:T{ .PP All MySQL 5.6 based releases @@ -211,7 +211,7 @@ T{ --loadqueries=file T}:T{ Loads all queries from the file specified; does not connect to a - database + database T}:T{ .PP All MySQL 5.6 based releases diff --git a/man/ndb_waiter.1 b/man/ndb_waiter.1 index 54b736942298..026153a95c31 100644 --- a/man/ndb_waiter.1 +++ b/man/ndb_waiter.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_waiter\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_WAITER\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_WAITER\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -141,7 +141,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.95.\ \& This table describes command\-line options for the ndb_waiter program +.B Table\ \&18.318.\ \&Command\-line options for the ndb_waiter program .TS allbox tab(:); lB lB lB. @@ -150,7 +150,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -195,7 +195,7 @@ T{ -t T}:T{ Wait this many seconds, then exit whether or not cluster has reached - desired state; default is 2 minutes (120 seconds) + desired state; default is 2 minutes (120 seconds) T}:T{ .PP All MySQL 5.6 based releases diff --git a/man/ndbd.8 b/man/ndbd.8 index 379529649102..c148ebd6d15a 100644 --- a/man/ndbd.8 +++ b/man/ndbd.8 @@ -2,12 +2,12 @@ .\" Title: \fBndbd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBD\FR" "8" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBD\FR" "8" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -50,7 +50,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.75.\ \& This table describes command\-line options for the ndbd program +.B Table\ \&18.296.\ \&Command\-line options for the ndbd program .TS allbox tab(:); lB lB lB. @@ -59,7 +59,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -78,80 +78,79 @@ l l l l l l. T{ .PP ---initial +--bind-address=name T}:T{ -Perform initial start of ndbd, including cleaning the file system. - Consult the documentation before using this option +Local bind address T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---nostart, -.PP --n +--connect-delay=# T}:T{ -Don't start ndbd immediately; ndbd waits for command to start from - ndb_mgmd +Time to wait between attempts to contact a management server, in + seconds; 0 means do not wait between attempts T}:T{ .PP -All MySQL 5.6 based releases +DEPRECATED: NDB 7.4.9 T} T{ .PP ---daemon, -.PP --d +--connect-retries=# T}:T{ -Start ndbd as daemon (default); override with --nodaemon +Set the number of times to retry a connection before giving up; 0 means + 1 attempt only (and no retries) T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---nodaemon +--connect-retry-delay=# T}:T{ -Do not start ndbd as daemon; provided for testing purposes +Time to wait between attempts to contact a management server, in + seconds; 0 means do not wait between attempts T}:T{ .PP -All MySQL 5.6 based releases +ADDED: NDB 7.4.9 T} T{ .PP ---foreground +--daemon, +.PP +-d T}:T{ -Run ndbd in foreground, provided for debugging purposes (implies - --nodaemon) +Start ndbd as daemon (default); override with --nodaemon T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---nowait-nodes=list +--foreground T}:T{ -Do not wait for these data nodes to start (takes comma-separated list of - node IDs). Also requires --ndb-nodeid to be used. +Run ndbd in foreground, provided for debugging purposes (implies + --nodaemon) T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---initial-start +--initial T}:T{ -Perform partial initial start (requires --nowait-nodes) +Perform initial start of ndbd, including cleaning the file system. + Consult the documentation before using this option T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---bind-address=name +--initial-start T}:T{ -Local bind address +Perform partial initial start (requires --nowait-nodes) T}:T{ .PP All MySQL 5.6 based releases @@ -161,57 +160,60 @@ T{ --install[=name] T}:T{ Used to install the data node process as a Windows service. Does not - apply on non-Windows platforms. + apply on non-Windows platforms. T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---remove[=name] +--nostart, +.PP +-n T}:T{ -Used to remove a data node process that was previously installed as a - Windows service. Does not apply on non-Windows platforms. +Don't start ndbd immediately; ndbd waits for command to start from + ndb_mgmd T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---connect-retries=# +--nodaemon T}:T{ -Set the number of times to retry a connection before giving up; 0 means - 1 attempt only (and no retries) +Do not start ndbd as daemon; provided for testing purposes T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---connect-delay=# +--nowait-nodes=list T}:T{ -Time to wait between attempts to contact a management server, in - seconds; 0 means do not wait between attempts +Do not wait for these data nodes to start (takes comma-separated list of + node IDs). Also requires --ndb-nodeid to be used. T}:T{ .PP All MySQL 5.6 based releases T} T{ .PP ---connect-retry-delay=# +--remove[=name] T}:T{ -Time to wait between attempts to contact a management server, in - seconds; 0 means do not wait between attempts +Used to remove a data node process that was previously installed as a + Windows service. Does not apply on non-Windows platforms. T}:T{ .PP -ADDED: NDB 7.4.9 +All MySQL 5.6 based releases T} T{ .PP -\m[blue]\fB--verbose\fR\m[], -\m[blue]\fB-v\fR\m[] +--verbose, +.PP +-v T}:T{ -Write extra debug output to node log +Causes the data log to write extra debugging information to the node + log. T}:T{ .PP All MySQL 5.6 based releases @@ -231,7 +233,7 @@ T} .ps -1 .br .PP -All of these options also apply to the multi\-threaded version of this program (\fBndbmtd\fR) and you may substitute +All of these options also apply to the multithreaded version of this program (\fBndbmtd\fR) and you may substitute \(lq\fBndbmtd\fR\(rq for \(lq\fBndbd\fR\(rq @@ -271,7 +273,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ T} .TE @@ -289,8 +291,7 @@ to bind to a specific network interface (host name or IP address)\&. This option .sp -1 .IP \(bu 2.3 .\} -\fB\-\-daemon\fR, -\fB\-d\fR +\fB\-\-connect\-delay=\fR\fB\fI#\fR\fR .TS allbox tab(:); lB lB. @@ -302,37 +303,49 @@ T} .T& l l l l +l l +l l +l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---daemon +--connect-delay=# +T} +T{ +\fBDeprecated\fR +T}:T{ +5.6.28-ndb-7.4.9 T} T{ \fBType\fR T}:T{ -boolean +numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -TRUE +5 +T} +T{ +\fBMinimum Value\fR +T}:T{ +0 +T} +T{ +\fBMaximum Value\fR +T}:T{ +3600 T} .TE .sp 1 -Instructs -\fBndbd\fR -or -\fBndbmtd\fR -to execute as a daemon process\&. This is the default behavior\&. -\fB\-\-nodaemon\fR -can be used to prevent the process from running as a daemon\&. +Determines the time to wait between attempts to contact a management server when starting (the number of attempts is controlled by the +\fB\-\-connect\-retries\fR +option)\&. The default is 5 seconds\&. .sp -This option has no effect when running -\fBndbd\fR -or -\fBndbmtd\fR -on Windows platforms\&. +This option is deprecated in NDB 7\&.4\&.9, and is subject to removal in a future release of NDB Cluster\&. Use +\fB\-\-connect\-retry\-delay\fR +instead\&. .RE .sp .RS 4 @@ -343,7 +356,7 @@ on Windows platforms\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-nodaemon\fR +\fB\-\-connect\-retries=\fR\fB\fI#\fR\fR .TS allbox tab(:); lB lB. @@ -355,11 +368,133 @@ T} .T& l l l l +l l +l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---nodaemon +--connect-retries=# +T} +T{ +\fBType\fR +T}:T{ +numeric +T} +T{ +\fBDefault Value\fR +T}:T{ +12 +T} +T{ +\fBMinimum Value\fR +T}:T{ +0 +T} +T{ +\fBMaximum Value\fR +T}:T{ +65535 +T} +.TE +.sp 1 +Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries)\&. The default is 12 attempts\&. The time to wait between attempts is controlled by the +\fB\-\-connect\-retry\-delay\fR +option in MySQL NDB 7\&.4\&.9 and later (previously, this was +\fB\-\-connect\-delay\fR)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-connect\-retry\-delay=\fR\fB\fI#\fR\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--connect-retry-delay=# +T} +T{ +\fBIntroduced\fR +T}:T{ +5.6.28-ndb-7.4.9 +T} +T{ +\fBType\fR (>= 5.6.28-ndb-7.4.9) +T}:T{ +numeric +T} +T{ +\fBDefault Value\fR (>= 5.6.28-ndb-7.4.9) +T}:T{ +5 +T} +T{ +\fBMinimum Value\fR (>= 5.6.28-ndb-7.4.9) +T}:T{ +0 +T} +T{ +\fBMaximum Value\fR (>= 5.6.28-ndb-7.4.9) +T}:T{ +4294967295 +T} +.TE +.sp 1 +Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the +\fB\-\-connect\-retries\fR +option)\&. The default is 5 seconds\&. +.sp +This option was added in NDB 7\&.4\&.9, and is intended to take the place of the +\fB\-\-connect\-delay\fR +option, which is now deprecated and subject to removal in a future release of NDB Cluster\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-daemon\fR, +\fB\-d\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--daemon T} T{ \fBType\fR @@ -367,25 +502,25 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -FALSE +TRUE T} .TE .sp 1 -Prevents +Instructs \fBndbd\fR or \fBndbmtd\fR -from executing as a daemon process\&. This option overrides the -\fB\-\-daemon\fR -option\&. This is useful for redirecting output to the screen when debugging the binary\&. +to execute as a daemon process\&. This is the default behavior\&. +\fB\-\-nodaemon\fR +can be used to prevent the process from running as a daemon\&. .sp -The default behavior for +This option has no effect when running \fBndbd\fR -and +or \fBndbmtd\fR -on Windows is to run in the foreground, making this option unnecessary on Windows platforms, where it has no effect\&. +on Windows platforms\&. .RE .sp .RS 4 @@ -420,7 +555,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -473,7 +608,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -638,7 +773,7 @@ T}:T{ boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ FALSE T} @@ -692,109 +827,6 @@ option for .sp -1 .IP \(bu 2.3 .\} -\fB\-\-nowait\-nodes=\fR\fB\fInode_id_1\fR\fR\fB[, \fR\fB\fInode_id_2\fR\fR\fB[, \&.\&.\&.]]\fR -.TS -allbox tab(:); -lB lB. -T{ -Property -T}:T{ -Value -T} -.T& -l l -l l -l l. -T{ -\fBCommand-Line Format\fR -T}:T{ ---nowait-nodes=list -T} -T{ -\fBType\fR -T}:T{ -string -T} -T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -This option takes a list of data nodes which for which the cluster will not wait for before starting\&. -.sp -This can be used to start the cluster in a partitioned state\&. For example, to start the cluster with only half of the data nodes (nodes 2, 3, 4, and 5) running in a 4\-node cluster, you can start each -\fBndbd\fR -process with -\fB\-\-nowait\-nodes=3,5\fR\&. In this case, the cluster starts as soon as nodes 2 and 4 connect, and does -\fInot\fR -wait -StartPartitionedTimeout -milliseconds for nodes 3 and 5 to connect as it would otherwise\&. -.sp -If you wanted to start up the same cluster as in the previous example without one -\fBndbd\fR -(say, for example, that the host machine for node 3 has suffered a hardware failure) then start nodes 2, 4, and 5 with -\fB\-\-nowait\-nodes=3\fR\&. Then the cluster will start as soon as nodes 2, 4, and 5 connect and will not wait for node 3 to start\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-nostart\fR, -\fB\-n\fR -.TS -allbox tab(:); -lB lB. -T{ -Property -T}:T{ -Value -T} -.T& -l l -l l -l l. -T{ -\fBCommand-Line Format\fR -T}:T{ ---nostart -T} -T{ -\fBType\fR -T}:T{ -boolean -T} -T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Instructs -\fBndbd\fR -not to start automatically\&. When this option is used, -\fBndbd\fR -connects to the management server, obtains configuration data from it, and initializes communication objects\&. However, it does not actually start the execution engine until specifically requested to do so by the management server\&. This can be accomplished by issuing the proper -START -command in the management client (see -Section\ \&18.5.2, \(lqCommands in the NDB Cluster Management Client\(rq)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} \fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR .TS allbox tab(:); @@ -825,7 +857,7 @@ T}:T{ string T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ ndbd T} @@ -868,7 +900,7 @@ option has no effect on non\-Windows platforms\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR +\fB\-\-nodaemon\fR .TS allbox tab(:); lB lB. @@ -880,38 +912,37 @@ T} .T& l l l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---remove[=name] -T} -T{ -\fBPlatform Specific\fR -T}:T{ -Windows +--nodaemon T} T{ \fBType\fR T}:T{ -string +boolean T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ -ndbd +FALSE T} .TE .sp 1 -Causes an +Prevents \fBndbd\fR -process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to -ndbd\&. +or +\fBndbmtd\fR +from executing as a daemon process\&. This option overrides the +\fB\-\-daemon\fR +option\&. This is useful for redirecting output to the screen when debugging the binary\&. .sp -The -\fB\-\-remove\fR -option has no effect on non\-Windows platforms\&. +The default behavior for +\fBndbd\fR +and +\fBndbmtd\fR +on Windows is to run in the foreground, making this option unnecessary on Windows platforms, where it has no effect\&. .RE .sp .RS 4 @@ -922,7 +953,8 @@ option has no effect on non\-Windows platforms\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-connect\-retries=\fR\fB\fI#\fR\fR +\fB\-\-nostart\fR, +\fB\-n\fR .TS allbox tab(:); lB lB. @@ -934,40 +966,32 @@ T} .T& l l l l -l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---connect-retries=# +--nostart T} T{ \fBType\fR T}:T{ -numeric -T} -T{ -\fBDefault\fR -T}:T{ -12 -T} -T{ -\fBMinimum\fR -T}:T{ -0 +boolean T} T{ -\fBMaximum\fR +\fBDefault Value\fR T}:T{ -65535 +FALSE T} .TE .sp 1 -Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries)\&. The default is 12 attempts\&. The time to wait between attempts is controlled by the -\fB\-\-connect\-retry\-delay\fR -option in MySQL NDB 7\&.4\&.9 and later (previously, this was -\fB\-\-connect\-delay\fR)\&. +Instructs +\fBndbd\fR +not to start automatically\&. When this option is used, +\fBndbd\fR +connects to the management server, obtains configuration data from it, and initializes communication objects\&. However, it does not actually start the execution engine until specifically requested to do so by the management server\&. This can be accomplished by issuing the proper +START +command in the management client (see +Section\ \&18.5.2, \(lqCommands in the NDB Cluster Management Client\(rq)\&. .RE .sp .RS 4 @@ -978,7 +1002,7 @@ option in MySQL NDB 7\&.4\&.9 and later (previously, this was .sp -1 .IP \(bu 2.3 .\} -\fB\-\-connect\-delay=\fR\fB\fI#\fR\fR +\fB\-\-nowait\-nodes=\fR\fB\fInode_id_1\fR\fR\fB[, \fR\fB\fInode_id_2\fR\fR\fB[, \&.\&.\&.]]\fR .TS allbox tab(:); lB lB. @@ -990,49 +1014,38 @@ T} .T& l l l l -l l -l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---connect-delay=# -T} -T{ -\fBDeprecated\fR -T}:T{ -5.6.28-ndb-7.4.9 +--nowait-nodes=list T} T{ \fBType\fR T}:T{ -numeric -T} -T{ -\fBDefault\fR -T}:T{ -5 -T} -T{ -\fBMinimum\fR -T}:T{ -0 +string T} T{ -\fBMaximum\fR +\fBDefault Value\fR T}:T{ -3600 T} .TE .sp 1 -Determines the time to wait between attempts to contact a management server when starting (the number of attempts is controlled by the -\fB\-\-connect\-retries\fR -option)\&. The default is 5 seconds\&. +This option takes a list of data nodes which for which the cluster will not wait for before starting\&. .sp -This option is deprecated in NDB 7\&.4\&.9, and is subject to removal in a future release of NDB Cluster\&. Use -\fB\-\-connect\-retry\-delay\fR -instead\&. +This can be used to start the cluster in a partitioned state\&. For example, to start the cluster with only half of the data nodes (nodes 2, 3, 4, and 5) running in a 4\-node cluster, you can start each +\fBndbd\fR +process with +\fB\-\-nowait\-nodes=3,5\fR\&. In this case, the cluster starts as soon as nodes 2 and 4 connect, and does +\fInot\fR +wait +StartPartitionedTimeout +milliseconds for nodes 3 and 5 to connect as it would otherwise\&. +.sp +If you wanted to start up the same cluster as in the previous example without one +\fBndbd\fR +(say, for example, that the host machine for node 3 has suffered a hardware failure) then start nodes 2, 4, and 5 with +\fB\-\-nowait\-nodes=3\fR\&. Then the cluster will start as soon as nodes 2, 4, and 5 connect and will not wait for node 3 to start\&. .RE .sp .RS 4 @@ -1043,7 +1056,7 @@ instead\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-connect\-retry\-delay=\fR\fB\fI#\fR\fR +\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR .TS allbox tab(:); lB lB. @@ -1056,48 +1069,51 @@ T} l l l l l l -l l -l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---connect-retry-delay=# -T} -T{ -\fBIntroduced\fR -T}:T{ -5.6.28-ndb-7.4.9 -T} -T{ -\fBType\fR (>= 5.6.28-ndb-7.4.9) -T}:T{ -numeric +--remove[=name] T} T{ -\fBDefault\fR (>= 5.6.28-ndb-7.4.9) +\fBPlatform Specific\fR T}:T{ -5 +Windows T} T{ -\fBMinimum\fR (>= 5.6.28-ndb-7.4.9) +\fBType\fR T}:T{ -0 +string T} T{ -\fBMaximum\fR (>= 5.6.28-ndb-7.4.9) +\fBDefault Value\fR T}:T{ -4294967295 +ndbd T} .TE .sp 1 -Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the -\fB\-\-connect\-retries\fR -option)\&. The default is 5 seconds\&. +Causes an +\fBndbd\fR +process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to +ndbd\&. .sp -This option was added in NDB 7\&.4\&.9, and is intended to take the place of the -\fB\-\-connect\-delay\fR -option, which is now deprecated and subject to removal in a future release of NDB Cluster\&. +The +\fB\-\-remove\fR +option has no effect on non\-Windows platforms\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-verbose\fR, +\fB\-v\fR +.sp +Causes extra debug output to be written to the node log\&. .RE .PP \fBndbd\fR @@ -1149,7 +1165,7 @@ TraceFile: ndb_2_trace\&.log\&.2 Listings of possible \fBndbd\fR exit codes and messages generated when a data node process shuts down prematurely can be found in -\m[blue]\fBData Node Error Messages\fR\m[]\&\s-2\u[2]\d\s+2\&. +\m[blue]\fBData Node Error Messages\fR\m[]\&\s-2\u[1]\d\s+2\&. .if n \{\ .sp .\} @@ -1304,11 +1320,6 @@ You should have received a copy of the GNU General Public License along with the .sp .SH "NOTES" .IP " 1." 4 ---verbose -.RS 4 -\%http://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-programs-ndbd.html#option_ndbd_verbose -.RE -.IP " 2." 4 Data Node Error Messages .RS 4 \%http://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html diff --git a/man/ndbinfo_select_all.1 b/man/ndbinfo_select_all.1 index 165efc825bf7..0803fed1cc1d 100644 --- a/man/ndbinfo_select_all.1 +++ b/man/ndbinfo_select_all.1 @@ -2,12 +2,12 @@ .\" Title: \fBndbinfo_select_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBINFO_SELECT_ALL\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBINFO_SELECT_ALL\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -114,7 +114,7 @@ Options Common to NDB Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.76.\ \& This table describes command\-line options for the ndbinfo_select_all program +.B Table\ \&18.297.\ \&Command\-line options for the ndbinfo_select_all program .TS allbox tab(:); lB lB lB. @@ -123,7 +123,7 @@ Format T}:T{ Description T}:T{ -Added or Removed +Added, Deprecated, or Removed T} .T& l l l @@ -209,17 +209,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 5 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ MAX_INT T} @@ -265,17 +265,17 @@ T}:T{ numeric T} T{ -\fBDefault\fR +\fBDefault Value\fR T}:T{ 1 T} T{ -\fBMinimum\fR +\fBMinimum Value\fR T}:T{ 0 T} T{ -\fBMaximum\fR +\fBMaximum Value\fR T}:T{ MAX_INT T} diff --git a/man/ndbmtd.8 b/man/ndbmtd.8 index 3335f627b041..e4ecbeb74090 100644 --- a/man/ndbmtd.8 +++ b/man/ndbmtd.8 @@ -2,12 +2,12 @@ .\" Title: \fBndbmtd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBMTD\FR" "8" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBMTD\FR" "8" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,14 +28,14 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndbmtd \- the NDB Cluster data node daemon (multi\-threaded version) +ndbmtd \- the NDB Cluster data node daemon (multithreaded version) .SH "SYNOPSIS" .HP \w'\fBndbmtd\ \fR\fB\fIoptions\fR\fR\ 'u \fBndbmtd \fR\fB\fIoptions\fR\fR .SH "DESCRIPTION" .PP \fBndbmtd\fR -is a multi\-threaded version of +is a multithreaded version of \fBndbd\fR, the process that is used to handle all the data in tables using the NDBCLUSTER storage engine\&. @@ -47,7 +47,7 @@ functions in the same way as \fBndbmtd\fR differs from \fBndbd\fR, and you should consult -\fBndbd\fR(8), for additional information about running NDB Cluster data nodes that apply to both the single\-threaded and multi\-threaded versions of the data node process\&. +\fBndbd\fR(8), for additional information about running NDB Cluster data nodes that apply to both the single\-threaded and multithreaded versions of the data node process\&. .PP Command\-line options and configuration parameters used with \fBndbd\fR @@ -65,13 +65,13 @@ can be stopped, the binary replaced with MaxNoOfExecutionThreads is set to an apppriate value before restarting the node if you wish for \fBndbmtd\fR -to run in multi\-threaded fashion\&.) Similarly, an +to run in multithreaded fashion\&.) Similarly, an \fBndbmtd\fR binary can be replaced with \fBndbd\fR simply by stopping the node and then starting \fBndbd\fR -in place of the multi\-threaded binary\&. It is not necessary when switching between the two to start the data node binary using +in place of the multithreaded binary\&. It is not necessary when switching between the two to start the data node binary using \fB\-\-initial\fR\&. .PP Using diff --git a/man/perror.1 b/man/perror.1 index ebbef4211105..87d4130475ec 100644 --- a/man/perror.1 +++ b/man/perror.1 @@ -2,12 +2,12 @@ .\" Title: \fBperror\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBPERROR\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBPERROR\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/replace.1 b/man/replace.1 index 6d2cb25cd9b8..e082a2cea011 100644 --- a/man/replace.1 +++ b/man/replace.1 @@ -2,12 +2,12 @@ .\" Title: \fBreplace\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBREPLACE\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBREPLACE\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/resolve_stack_dump.1 b/man/resolve_stack_dump.1 index cb40d622f672..9f13ad2bcfa6 100644 --- a/man/resolve_stack_dump.1 +++ b/man/resolve_stack_dump.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolve_stack_dump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVE_STACK_DUMP\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVE_STACK_DUMP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/resolveip.1 b/man/resolveip.1 index 8797d5df7e32..40b8625b653f 100644 --- a/man/resolveip.1 +++ b/man/resolveip.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolveip\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/25/2018 +.\" Date: 06/15/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVEIP\FR" "1" "02/25/2018" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVEIP\FR" "1" "06/15/2018" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index 5c432d5714e2..5416818c1e55 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -17,9 +17,9 @@ -- team. If you require changes to the format of this file, contact the -- docs team. --- File generation date: 2018-02-25 +-- File generation date: 2018-06-15 -- MySQL series: 5.6 --- Document repository revision: 56139 +-- Document repository revision: 57704 -- To use this file, load its contents into the mysql database. For example, -- with the mysql client program, process the file like this, where @@ -147,7 +147,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (67,27,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n [PARTITION (partition_list | ALL)]\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE 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: http://dev.mysql.com/doc/refman/5.6/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cache-index.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (68,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (69,28,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for InnoDB and MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/handler.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (70,9,'HELP_DATE','This help information was generated from the MySQL 5.6 Reference Manual\non: 2018-02-25\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (70,9,'HELP_DATE','This help information was generated from the MySQL 5.6 Reference Manual\non: 2018-06-15\n','',''); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (71,40,'RENAME TABLE','Syntax:\nRENAME TABLE\n tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nRENAME TABLE renames one or more tables. You must have ALTER and DROP\nprivileges for the original table, and CREATE and INSERT privileges for\nthe new table.\n\nFor example, to rename a table named old_table to to new_table, use\nthis statement:\n\nRENAME TABLE old_table TO new_table;\n\nThat statement is equivalent to the following ALTER TABLE statement:\n\nALTER TABLE old_table RENAME new_table;\n\nRENAME TABLE, unlike ALTER TABLE, can rename multiple tables within a\nsingle statement:\n\nRENAME TABLE old_table1 TO new_table1,\n old_table2 TO new_table2,\n old_table3 TO new_table3;\n\nRenaming operations are performed left to right. Thus, to swap two\ntable names, do this (assuming that a table with the intermediary name\ntmp_table does not already exist):\n\nRENAME TABLE old_table TO tmp_table,\n new_table TO old_table,\n tmp_table TO new_table;\n\nWhen you execute RENAME TABLE, you cannot have any locked tables or\nactive transactions. With that condition satisfied, the rename\noperation is done atomically; no other session can access any of the\ntables while the rename is in progress.\n\nIf any errors occur during a RENAME TABLE, the statement fails and no\nchanges are made.\n\nYou can use RENAME TABLE to move a table from one database to another:\n\nRENAME TABLE current_db.tbl_name TO other_db.tbl_name;\n\nUsing this method to move all tables from one database to a different\none in effect renames the database (an operation for which MySQL has no\nsingle statement), except that the original database continues to\nexist, albeit with no tables.\n\nLike RENAME TABLE, ALTER TABLE ... RENAME can also be used to move a\ntable to a different database. Regardless of the statement used, if the\nrename operation would move the table to a database located on a\ndifferent file system, the success of the outcome is platform specific\nand depends on the underlying operating system calls used to move the\ntable files.\n\nIf a table has triggers, attempts to rename the table into a different\ndatabase fail with a Trigger in wrong schema error.\n\nRENAME TABLE does not work for TEMPORARY tables. However, you can use\nALTER TABLE to rename TEMPORARY tables.\n\nRENAME TABLE works for views, except that views cannot be renamed into\na different database.\n\nAny privileges granted specifically for a renamed table or view are not\nmigrated to the new name. They must be changed manually.\n\nRENAME TABLE changes internally generated foreign key constraint names\nand user-defined foreign key constraint names that contain the string\n"tbl_name_ibfk_" to reflect the new table name. InnoDB interprets\nforeign key constraint names that contain the string "tbl_name_ibfk_"\nas internally generated names.\n\nForeign key constraint names that point to the renamed table are\nautomatically updated unless there is a conflict, in which case, the\nstatement fails with an error. A conflict occurs if the renamed\nconstraint name already exists. In such cases, you must drop and\nre-create the foreign keys in order for them to function properly.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/rename-table.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (72,23,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (73,3,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); @@ -176,7 +176,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (96,3,'RAND','Syntax:\nRAND([N])\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. To\nobtain a random integer R in the range i <= R < j, use the expression\nFLOOR(i + RAND() * (j − i)). For example, to obtain a random integer\nin the range the range 7 <= R < 12, use the following statement:\n\nSELECT FLOOR(7 + (RAND() * 5));\n\nIf an integer argument N is specified, it is used as the seed value:\n\no With a constant initializer argument, the seed is initialized once\n when the statement is prepared, prior to execution.\n\no With a nonconstant initializer argument (such as a column name), the\n seed is initialized with the value for each invocation of RAND().\n\nOne implication of this behavior is that for equal argument values,\nRAND(N) returns the same value each time, and thus produces a\nrepeatable sequence of column values. In the following example, the\nsequence of values produced by RAND(3) is the same both places it\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (97,38,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (98,23,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (99,38,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'ej\'\nmysql> SELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'foo\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (99,38,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'Aa\', \'Bb\', \'Cc\', \'Dd\');\n -> \'Aa\'\nmysql> SELECT ELT(4, \'Aa\', \'Bb\', \'Cc\', \'Dd\');\n -> \'Dd\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (100,40,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW see [HELP CREATE VIEW]). This\nstatement requires the CREATE VIEW and DROP privileges for the view,\nand some privilege for each column referred to in the SELECT statement.\nALTER VIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-view.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (101,27,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-databases.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (102,32,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); @@ -190,7 +190,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (110,8,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (111,7,'MBREQUAL','MBREqual(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (112,34,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nA PROCEDURE clause is not permitted in a UNION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (113,9,'HELP_VERSION','This help information was generated from the MySQL 5.6 Reference Manual\non: 2018-02-25 (revision: 56139)\n\nThis information applies to MySQL 5.6 through 5.6.40.\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (113,9,'HELP_VERSION','This help information was generated from the MySQL 5.6 Reference Manual\non: 2018-06-15 (revision: 57704)\n\nThis information applies to MySQL 5.6 through 5.6.42.\n','',''); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (114,38,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (115,27,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (116,40,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n ADD DATAFILE \'file_name\'\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] comment_text]\n ENGINE [=] engine_name\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for tables. One data file is\ncreated and added to the tablespace using this statement. Additional\ndata files may be added to the tablespace by using the ALTER TABLESPACE\nstatement (see [HELP ALTER TABLESPACE]). For rules covering the naming\nof tablespaces, see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see [HELP CREATE LOGFILE GROUP]). Multiple tablespaces\nmay use the same log file group for UNDO logging.\n\nThe EXTENT_SIZE sets the size, in bytes, of the extents used by any\nfiles belonging to the tablespace. The default value is 1M. The minimum\nsize is 32K, and theoretical maximum is 2G, although the practical\nmaximum size depends on a number of factors. In most cases, changing\nthe extent size does not have any measurable effect on performance, and\nthe default value is recommended for all but the most unusual\nsituations.\n\nAn extent is a unit of disk space allocation. One extent is filled with\nas much data as that extent can contain before another extent is used.\nIn theory, up to 65,535 (64K) extents may used per data file; however,\nthe recommended maximum is 32,768 (32K). The recommended maximum size\nfor a single data file is 32G---that is, 32K extents x 1 MB per extent.\nIn addition, once an extent is allocated to a given partition, it\ncannot be used to store data from a different partition; an extent\ncannot store data from more than one partition. This means, for example\nthat a tablespace having a single datafile whose INITIAL_SIZE is 256 MB\nand whose EXTENT_SIZE is 128M has just two extents, and so can be used\nto store data from at most two different disk data table partitions.\n\nYou can see how many extents remain free in a given data file by\nquerying the INFORMATION_SCHEMA.FILES table, and so derive an estimate\nfor how much space remains free in the file. For further discussion and\nexamples, see http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nThe INITIAL_SIZE parameter sets the data file\'s total size in bytes.\nOnce the file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using ALTER TABLESPACE\n... ADD DATAFILE. See [HELP ALTER TABLESPACE].\n\nINITIAL_SIZE is optional; its default value is 134217728 (128 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nWhen setting EXTENT_SIZE, you may optionally follow the number with a\none-letter abbreviation for an order of magnitude, similar to those\nused in my.cnf. Generally, this is one of the letters M (for megabytes)\nor G (for gigabytes). In MySQL NDB Cluster 7.3.2 and later, these\nabbreviations are also supported when specifying INITIAL_SIZE as well.\n(Bug #13116514, Bug #16104705, Bug #62858)\n\nINITIAL_SIZE, EXTENT_SIZE, and UNDO_BUFFER_SIZE are subject to rounding\nas follows:\n\no EXTENT_SIZE and UNDO_BUFFER_SIZE are each rounded up to the nearest\n whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K.\n\n For data files, INITIAL_SIZE is subject to further rounding; the\n result just obtained is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nAUTOEXTEND_SIZE, MAX_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but\nignored, and so currently have no effect. These options are intended\nfor future expansion.\n\nThe ENGINE parameter determines the storage engine which uses this\ntablespace, with engine_name being the name of the storage engine.\nCurrently, engine_name must be one of the values NDB or NDBCLUSTER.\n\nWhen CREATE TABLESPACE is used with ENGINE = NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+-------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+-------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n+--------------------+-------------+----------------+\n2 rows in set (0.01 sec)\n\n(See http://dev.mysql.com/doc/refman/5.6/en/files-table.html.)\n\nCREATE TABLESPACE is useful only with Disk Data storage for NDB\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html'); @@ -216,7 +216,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (136,24,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n -> BEGIN\n -> SET @x = 0;\n -> REPEAT\n -> SET @x = @x + 1;\n -> UNTIL @x > p1 END REPEAT;\n -> END\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/repeat.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (137,23,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (138,23,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (139,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multibyte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 2562) ...\n\nIf the leftmost character is not a multibyte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (139,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multibyte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 256^2) ...\n\nIf the leftmost character is not a multibyte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (140,37,'ENVELOPE','Envelope(g)\n\nST_Envelope() and Envelope() are synonyms. For more information, see\nthe description of ST_Envelope().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (141,37,'ST_ISEMPTY','ST_IsEmpty(g)\n\nThis function is a placeholder that returns 0 for any valid geometry\nvalue, 1 for any invalid geometry value, or NULL if the argument is\nNULL.\n\nMySQL does not support GIS EMPTY values such as POINT EMPTY.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (142,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n -> 167773449\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); @@ -228,7 +228,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (148,10,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL [PRIVILEGES], GRANT OPTION\n FROM user [, user] ...\n\nREVOKE PROXY ON user\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts.\n\nWhen the read_only system variable is enabled, REVOKE requires the\nSUPER privilege in addition to any other required privileges described\nin the following discussion.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type, priv_level, and object_type values, and the syntax for\nspecifying users and passwords, see [HELP GRANT]\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege, or the UPDATE privilege for the mysql database.\n\nUser accounts from which privileges are to be revoked must exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/revoke.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (149,32,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (150,23,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (151,12,'RANDOM_BYTES','Syntax:\nRANDOM_BYTES(len)\n\nThis function returns a binary string of len random bytes generated\nusing the random number generator of the SSL library (OpenSSL or\nyaSSL). Permitted values of len range from 1 to 1024. For values\noutside that range, RANDOM_BYTES() generates a warning and returns\nNULL.\n\nRANDOM_BYTES() can be used to provide the initialization vector for the\nAES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len\nmust be at least 16. Larger values are permitted, but bytes in excess\nof 16 are ignored.\n\nRANDOM_BYTES() generates a random value, which makes its result\nnondeterministic. Consequently, statements that use this function are\nunsafe for statement-based replication and cannot be stored in the\nquery cache.\n\nThis function is available as of MySQL 5.6.17.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (151,12,'RANDOM_BYTES','Syntax:\nRANDOM_BYTES(len)\n\nThis function returns a binary string of len random bytes generated\nusing the random number generator of the SSL library. Permitted values\nof len range from 1 to 1024. For values outside that range,\nRANDOM_BYTES() generates a warning and returns NULL.\n\nRANDOM_BYTES() can be used to provide the initialization vector for the\nAES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len\nmust be at least 16. Larger values are permitted, but bytes in excess\nof 16 are ignored.\n\nRANDOM_BYTES() generates a random value, which makes its result\nnondeterministic. Consequently, statements that use this function are\nunsafe for statement-based replication and cannot be stored in the\nquery cache.\n\nThis function is available as of MySQL 5.6.17.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (152,38,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (153,29,'EXPLAIN','Syntax:\n{EXPLAIN | DESCRIBE | DESC}\n tbl_name [col_name | wild]\n\n{EXPLAIN | DESCRIBE | DESC}\n [explain_type]\n explainable_stmt\n\nexplain_type: {\n EXTENDED\n | PARTITIONS\n | FORMAT = format_name\n}\n\nformat_name: {\n TRADITIONAL\n | JSON\n}\n\nexplainable_stmt: {\n SELECT statement\n | DELETE statement\n | INSERT statement\n | REPLACE statement\n | UPDATE statement\n}\n\nThe DESCRIBE and EXPLAIN statements are synonyms. In practice, the\nDESCRIBE keyword is more often used to obtain information about table\nstructure, whereas EXPLAIN is used to obtain a query execution plan\n(that is, an explanation of how MySQL would execute a query).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/explain.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (154,3,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); @@ -381,7 +381,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (301,23,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (302,27,'SHOW COLUMNS','Syntax:\nSHOW [FULL] {COLUMNS | FIELDS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. SHOW COLUMNS displays information only for\nthose columns for which you have some privilege.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nThe optional FULL keyword causes the output to include the column\ncollation and comments, as well as the privileges you have for each\ncolumn.\n\nThe LIKE clause, if present, indicates which column names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nmysql> SHOW 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| CountryCode | char(3) | NO | MUL | | |\n| District | char(20) | NO | | | |\n| Population | int(11) | NO | | 0 | |\n+-------------+----------+------+-----+---------+----------------+\n\nThe data types may differ from what you expect them to be based on a\nCREATE TABLE statement because MySQL sometimes changes data types when\nyou create or alter a table. The conditions under which this occurs are\ndescribed in\nhttp://dev.mysql.com/doc/refman/5.6/en/silent-column-changes.html.\n\nSHOW COLUMNS displays the following values for each table column:\n\no Field\n\n The column name.\n\no Type\n\n The column data type.\n\no Collation\n\n The collation for nonbinary string columns, or NULL for other\n columns. This value is displayed only if you use the FULL keyword.\n\no Null\n\n Column nullability. The value is YES if NULL values can be stored in\n the column, NO if not.\n\no Key\n\n Whether the column is indexed:\n\n o If Key is empty, the column either is not indexed or is indexed\n only as a secondary column in a multiple-column, nonunique index.\n\n o If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\n o If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index permits multiple NULL values, but you can tell whether\n the column permits NULL by checking the Null field.)\n\n o If Key is MUL, the column is the first column of a nonunique index\n in which multiple occurrences of a given value are permitted within\n the column.\n\n If more than one of the Key values applies to a given column of a\n table, Key displays the one with the highest priority, in the order\n PRI, UNI, MUL.\n\n A UNIQUE index may be displayed as PRI if it cannot contain NULL\n values and there is no PRIMARY KEY in the table. A UNIQUE index may\n display as MUL if several columns form a composite UNIQUE index;\n although the combination of the columns is unique, each column can\n still hold multiple occurrences of a given value.\n\no Default\n\n The default value for the column. This is NULL if the column has an\n explicit default of NULL, or if the column definition includes no\n DEFAULT clause.\n\no Extra\n\n Any additional information that is available about a given column.\n The value is nonempty in these cases: auto_increment for columns that\n have the AUTO_INCREMENT attribute; on update CURRENT_TIMESTAMP for\n TIMESTAMP or DATETIME columns that have the ON UPDATE\n CURRENT_TIMESTAMP attribute.\n\no Privileges\n\n The privileges you have for the column. This value is displayed only\n if you use the FULL keyword.\n\no Comment\n\n Any comment included in the column definition. This value is\n displayed only if you use the FULL keyword.\n\nYou can also obtain information about table columns from\nINFORMATION_SCHEMA, which contains a COLUMNS table. See\nhttp://dev.mysql.com/doc/refman/5.6/en/columns-table.html.\n\nYou can list a table\'s columns with the mysqlshow db_name tbl_name\ncommand.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee http://dev.mysql.com/doc/refman/5.6/en/describe.html.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-columns.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (303,23,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (304,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nOn a multi-threaded slave, the function waits until expiry of the limit\nset by the slave_checkpoint_group or slave_checkpoint_period system\nvariable, when the checkpoint operation is called to update the status\nof the slave. Depending on the setting for the system variables, the\nfunction might therefore return some time after the specified position\nwas reached.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (304,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nOn a multithreaded slave, the function waits until expiry of the limit\nset by the slave_checkpoint_group or slave_checkpoint_period system\nvariable, when the checkpoint operation is called to update the status\nof the slave. Depending on the setting for the system variables, the\nfunction might therefore return some time after the specified position\nwas reached.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (305,19,'^','Syntax:\n^\n\nBitwise XOR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (306,40,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view.\n\nIf any views named in the argument list do not exist, the statement\nreturns an error indicating by name which nonexisting views it was\nunable to drop, but also drops all views in the list that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-view.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (307,32,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); @@ -544,7 +544,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (464,32,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (465,40,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n back. See\n http://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table or NDB table if there are\n any FOREIGN KEY constraints from other tables that reference the\n table. Foreign key constraints between columns of the same table are\n permitted.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n even for MyISAM and InnoDB, which normally do not reuse sequence\n values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (466,2,'AREA','Area(poly)\n\nST_Area() and Area() are synonyms. For more information, see the\ndescription of ST_Area().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (467,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type:\n IO_THREAD | SQL_THREAD\n\nuntil_option:\n UNTIL { {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n | MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n | RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n | SQL_AFTER_MTS_GAPS }\n\nconnection_options:\n [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\ngtid_set:\n uuid_set [, uuid_set] ...\n | \'\'\n\nuuid_set:\n uuid:interval[:interval]...\n\nuuid:\n hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n [0-9,A-F]\n\ninterval:\n n[-n]\n\n (n >= 1)\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.6.7 and later, START SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nMySQL 5.6.4 and later supports pluggable user-password authentication\nwith START SLAVE with the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR\noptions, as described in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nStarting with MySQL 5.6.4, you cannot use the SQL_THREAD option when\nspecifying any of USER, PASSWORD, DEFAULT_AUTH, or PLUGIN_DIR, unless\nthe IO_THREAD option is also provided (Bug #13083642).\n\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nStarting with MySQL 5.6.6, START SLAVE ... UNTIL supports two\nadditional options for use with global transaction identifiers (GTIDs)\n(see http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html).\nEach of these takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses the slave SQL thread to process transactions until it has\nreached the first transaction whose GTID is listed in the gtid_set.\nSTART SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to process\nall transactions until the last transaction in the gtid_set has been\nprocessed by both threads. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS causes the slave SQL thread to process all\ntransactions occurring before the first GTID in the gtid_set is\nreached, and START SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads\nto handle all transactions, including those whose GTIDs are found in\ngtid_set, until each has encountered a transaction whose GTID is not\npart of the set. SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the\nSQL_THREAD and IO_THREAD options, although using IO_THREAD with them\ncurrently has no effect.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE SQL_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave SQL thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave SQL\nthread.\n\nPrior to MySQL 5.6.14, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction was completed, but waited until another GTID\nevent was received (Bug #14767986).\n\n*Note*:\n\nThe SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS keywords are present in the\nMySQL 5.6.5 server; however, neither of them functioned correctly as\noptions with START SLAVE [SQL_THREAD | IO_THREAD] UNTIL in that\nversion, and are therefore supported beginning only with MySQL 5.6.6.\n(Bug#13810456)\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS is available in MySQL 5.6.6 or\nlater. This statement causes a multi-threaded slave\'s SQL threads to\nrun until no more gaps are found in the relay log, and then to stop.\nThis statement can take an SQL_THREAD option, but the effects of the\nstatement remain unchanged. It has no effect on the slave I/O thread\n(and cannot be used with the IO_THREAD option). START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS should be used before switching the slave from\nmulti-threaded mode to single-threaded mode (that is, when resetting\nslave_parallel_workers back to 0 from a positive, nonzero value) after\nslave has failed with errors in multi-threaded mode.\n\nTo change a failed multi-threaded slave to single-threaded mode, you\ncan issue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\nIf you were running the failed multi-threaded slave with\nrelay_log_recovery enabled, then you must issue START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS prior to executing CHANGE MASTER TO. Otherwise the\nlatter statement fails.\n\n*Note*:\n\nIt is possible to view the entire text of a running START SLAVE ...\nstatement, including any USER or PASSWORD values used, in the output of\nSHOW PROCESSLIST. This is also true for the text of a running CHANGE\nMASTER TO statement, including any values it employs for MASTER_USER or\nMASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/start-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (467,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type:\n IO_THREAD | SQL_THREAD\n\nuntil_option:\n UNTIL { {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n | MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n | RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n | SQL_AFTER_MTS_GAPS }\n\nconnection_options:\n [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\ngtid_set:\n uuid_set [, uuid_set] ...\n | \'\'\n\nuuid_set:\n uuid:interval[:interval]...\n\nuuid:\n hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n [0-9,A-F]\n\ninterval:\n n[-n]\n\n (n >= 1)\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.6.7 and later, START SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nMySQL 5.6.4 and later supports pluggable user-password authentication\nwith START SLAVE with the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR\noptions, as described in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nStarting with MySQL 5.6.4, you cannot use the SQL_THREAD option when\nspecifying any of USER, PASSWORD, DEFAULT_AUTH, or PLUGIN_DIR, unless\nthe IO_THREAD option is also provided (Bug #13083642).\n\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nStarting with MySQL 5.6.6, START SLAVE ... UNTIL supports two\nadditional options for use with global transaction identifiers (GTIDs)\n(see http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html).\nEach of these takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses the slave SQL thread to process transactions until it has\nreached the first transaction whose GTID is listed in the gtid_set.\nSTART SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to process\nall transactions until the last transaction in the gtid_set has been\nprocessed by both threads. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS causes the slave SQL thread to process all\ntransactions occurring before the first GTID in the gtid_set is\nreached, and START SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads\nto handle all transactions, including those whose GTIDs are found in\ngtid_set, until each has encountered a transaction whose GTID is not\npart of the set. SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the\nSQL_THREAD and IO_THREAD options, although using IO_THREAD with them\ncurrently has no effect.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE SQL_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave SQL thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave SQL\nthread.\n\nPrior to MySQL 5.6.14, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction was completed, but waited until another GTID\nevent was received (Bug #14767986).\n\n*Note*:\n\nThe SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS keywords are present in the\nMySQL 5.6.5 server; however, neither of them functioned correctly as\noptions with START SLAVE [SQL_THREAD | IO_THREAD] UNTIL in that\nversion, and are therefore supported beginning only with MySQL 5.6.6.\n(Bug#13810456)\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS is available in MySQL 5.6.6 or\nlater. This statement causes a multithreaded slave\'s SQL threads to run\nuntil no more gaps are found in the relay log, and then to stop. This\nstatement can take an SQL_THREAD option, but the effects of the\nstatement remain unchanged. It has no effect on the slave I/O thread\n(and cannot be used with the IO_THREAD option). START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS should be used before switching the slave from\nmultithreaded mode to single-threaded mode (that is, when resetting\nslave_parallel_workers back to 0 from a positive, nonzero value) after\nslave has failed with errors in multithreaded mode.\n\nTo change a failed multithreaded slave to single-threaded mode, you can\nissue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\nIf you were running the failed multithreaded slave with\nrelay_log_recovery enabled, then you must issue START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS prior to executing CHANGE MASTER TO. Otherwise the\nlatter statement fails.\n\n*Note*:\n\nIt is possible to view the entire text of a running START SLAVE ...\nstatement, including any USER or PASSWORD values used, in the output of\nSHOW PROCESSLIST. This is also true for the text of a running CHANGE\nMASTER TO statement, including any values it employs for MASTER_USER or\nMASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/start-slave.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (468,27,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS is a diagnostic statement that displays information about\nthe conditions (errors, warnings, and notes) resulting from executing a\nstatement in the current session. Warnings are generated for DML\nstatements such as INSERT, UPDATE, and LOAD DATA INFILE as well as DDL\nstatements such as CREATE TABLE and ALTER TABLE.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nSHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the\nextra information generated by EXPLAIN when the EXTENDED keyword is\nused. See http://dev.mysql.com/doc/refman/5.6/en/explain-extended.html.\n\nSHOW WARNINGS displays information about the conditions resulting from\nthe most recent statement in the current session that generated\nmessages. It shows nothing if the most recent statement used a table\nand generated no messages. (That is, statements that use a table but\ngenerate no messages clear the message list.) Statements that do not\nuse tables and do not generate messages have no effect on the message\nlist.\n\nThe SHOW COUNT(*) WARNINGS diagnostic statement displays the total\nnumber of errors, warnings, and notes. You can also retrieve this\nnumber from the warning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nA related diagnostic statement, SHOW ERRORS, shows only error\nconditions (it excludes warnings and notes), and SHOW COUNT(*) ERRORS\nstatement displays the total number of errors. See [HELP SHOW ERRORS].\nGET DIAGNOSTICS can be used to examine information for individual\nconditions. See [HELP GET DIAGNOSTICS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (469,4,'ST_LINEFROMTEXT','ST_LineFromText(wkt[, srid]), ST_LineStringFromText(wkt[, srid])\n\nConstructs a LineString value using its WKT representation and SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (470,10,'DROP USER','Syntax:\nDROP USER user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables. An error occurs for accounts that do not exist.\n\nTo use DROP USER, you must have the global CREATE USER privilege, or\nthe DELETE privilege for the mysql database. When the read_only system\nvariable is enabled, DROP USER additionally requires the SUPER\nprivilege.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-user.html'); @@ -618,7 +618,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (538,37,'DIMENSION','Dimension(g)\n\nST_Dimension() and Dimension() are synonyms. For more information, see\nthe description of ST_Dimension().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (539,23,'BIT','BIT[(M)]\n\nA bit-value type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (540,7,'EQUALS','Equals(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (541,8,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (X\'6162\', 0x6162), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nFor XA START xid starts an XA transaction with the given xid value.\nEach XA transaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------+\n| 7 | 3 | 3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (541,8,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (X\'6162\', 0x6162), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nXA START xid starts an XA transaction with the given xid value. Each XA\ntransaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------+\n| 7 | 3 | 3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (542,2,'CENTROID','Centroid(mpoly)\n\nST_Centroid() and Centroid() are synonyms. For more information, see\nthe description of ST_Centroid().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (543,38,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (544,32,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP([fsp])\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether the function\nis used in a string or numeric context.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); @@ -644,7 +644,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (564,20,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (565,21,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n\nANALYZE TABLE performs a key distribution analysis and stores the\ndistribution for the named table or tables. For MyISAM tables, this\nstatement is equivalent to using myisamchk --analyze.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE works with InnoDB, NDB, and MyISAM tables. It does not\nwork with views.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM.\n\nBy default, the server writes ANALYZE TABLE statements to the binary\nlog so that they replicate to replication slaves. To suppress logging,\nspecify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (566,2,'ST_EXTERIORRING','ST_ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly)));\n+----------------------------------------------------+\n| ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly))) |\n+----------------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (567,38,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 2\nmysql> SELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (567,38,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIELD(\'Bb\', \'Aa\', \'Bb\', \'Cc\', \'Dd\', \'Ff\');\n -> 2\nmysql> SELECT FIELD(\'Gg\', \'Aa\', \'Bb\', \'Cc\', \'Dd\', \'Ff\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (568,40,'CONSTRAINT','MySQL supports foreign keys, which let you cross-reference related data\nacross tables, and foreign key constraints, which help keep this\nspread-out data consistent. The essential syntax for a foreign key\nconstraint definition in a CREATE TABLE or ALTER TABLE statement looks\nlike this:\n\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 | SET DEFAULT\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html\n\n','CREATE TABLE product (\n category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)\n) ENGINE=INNODB;\n\nCREATE TABLE customer (\n id INT NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=INNODB;\n\nCREATE TABLE product_order (\n 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\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n INDEX (customer_id),\n\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)\n) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (569,7,'CREATE_ASYMMETRIC_PRIV_KEY','Syntax:\nCREATE_ASYMMETRIC_PRIV_KEY(algorithm, {key_len|dh_secret})\n\nCreates a private key using the given algorithm and key length or DH\nsecret, and returns the key as a binary string in PEM format. If key\ngeneration fails, the result is NULL.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nSupported key_len values: The minimum key length in bits is 1,024. The\nmaximum key length depends on the algorithm: 16,384 for RSA and 10,000\nfor DSA. These key-length limits are constraints imposed by OpenSSL.\nServer administrators can impose additional limits on maximum key\nlength by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-usage.html\n.\n\nFor DH keys, pass a shared DH secret instead of a key length. To create\nthe secret, pass the key length to CREATE_DH_PARAMETERS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'DSA\', 2048);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'DSA\', @priv);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (570,40,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 134217728 (128 MB). Prior to MySQL NDB Cluster 7.3.2, this\nvalue was required to be specified using digits (Bug #13116514, Bug\n#16104705, Bug #62858); in MySQL NDB Cluster 7.3.2 and later, you may\noptionally follow size with a one-letter abbreviation for an order of\nmagnitude, similar to those used in my.cnf. Generally, this is one of\nthe letters M (megabytes) or G (gigabytes).\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an data file with the same name, or an undo log file and\na tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.6. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for NDB Cluster.\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html'); @@ -661,7 +661,7 @@ INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example, INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (581,3,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians.\n\n*Note*:\n\nπ radians equals 180 degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (582,17,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (583,20,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nThe return type of COALESCE() is the aggregated type of the argument\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (584,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.6.40-standard\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (584,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.6.42-standard\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (0,'JOIN'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (1,'HOST'); From 10928452b149b876c9bde8cf6e449da3ffc61979 Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Thu, 2 Aug 2018 16:57:14 +0300 Subject: [PATCH 004/214] Implemented PS-4633 (Merge MySQL 5.6.41) (conflicts resolved) https://jira.percona.com/browse/PS-4520 *** Our fix in for PS-1076 "LP #1673656: SSL Certificate Subject ALT Names with IPs or DNS: not respected with --ssl-verify-server-cert" (https://jira.percona.com/browse/PS-1076) (commit 910f29e) left intact as it completely covers the upstream fix for Bug #16211011 / #68052 "SSL Certificate Subject ALT Names with IPs not respected with --ssl-verify-serve" (https://bugs.mysql.com/bug.php?id=68052) (commit mysql/mysql-server@ce42784). Moreover, our fix also provides SAN validation functionality for SSL certificates on platforms where 'X509_check_host()' / 'X509_check_ip()' functions are not available in OpenSSL (OpenSSL version < 1.0.2: Ubuntu Trusty, CentOS 6, Debian Jessie, etc.). In addition, it operates faster as it knows exactly which function to call 'X509_check_host()' or 'X509_check_ip()' rather than trying the first one and then, if not succeed, try the second one. Both Percona's ('main.ssl_san' and 'main.ssl_san_ipv6') and upstream's ('main.ssl_verify_identity') with corresponding certificates and keys are kept as our tests also check IP v6 connections and there is no way to update Oracle's 'server-cert-verify-san.pem' to include '0000:0000:0000:0000:0000:0000:0000:0001' in the SAN list as Oracle did not include a corresponding private key for the committed 'ca-cert-verify-san.pem' CA certificate. Removed 'mysql-test/include/check_openssl.inc' MTR include file introduced by us in favor of upstream's 'mysql-test/include/have_openssl_support.inc'. 'main.ssl_san' and 'main.ssl_san_ipv6' MTR test cases updated correspondingly. *** Conflicting changes in 'storage/innobase/row/row0import.cc' caused by our fix to PS-1697 "LP #1548597: InnoDB tablespace import fails when importing table w/ different data directory" (https://jira.percona.com/browse/PS-1697) (commit ee75a7f) and Oracle's fix to Bug #27542720 "SCHEMA MISMATCH - TABLE FLAGS DON'T MATCH, BUT FLAGS ARE NUMBERS" (commit mysql/mysql-server@e484ab3) resolved with combining both fixes: comparing only relevant flags and human readable table flags diagnostics. Re-recorded 'innodb.innodb-wl5522' MTR test case because of the numeric flags changed to human readable strings. *** Our fix in for PS-1806 "LP #1690011: pfs unit test ASan error in 5.6.36" (https://jira.percona.com/browse/PS-1806) (commit d7a4c9c) left intact as it is identical to the upstream fix for Bug #27440735 / #89384 "Memory leak in 'pfs-t' unit test ('test_locker_disabled()')" (https://bugs.mysql.com/bug.php?id=89384) (commit mysql/mysql-server@c1bc6c0). *** VERSION raised to "5.6.41-84.1". univ.i version raised to "84.1". --- VERSION | 7 +-- client/mysqldump.c | 7 +-- mysql-test/include/check_openssl.inc | 5 -- .../suite/innodb/r/innodb-wl5522.result | 24 --------- mysql-test/t/ssl_san.test | 2 +- mysql-test/t/ssl_san_ipv6.test | 2 +- mysql-test/t/ssl_verify_identity.test | 8 ++- sql-common/client.c | 54 ------------------- storage/innobase/include/univ.i | 2 +- storage/innobase/row/row0import.cc | 19 +++---- 10 files changed, 15 insertions(+), 115 deletions(-) delete mode 100644 mysql-test/include/check_openssl.inc diff --git a/VERSION b/VERSION index 9e9a3e83023a..d82328d4b8d5 100644 --- a/VERSION +++ b/VERSION @@ -1,9 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=6 -<<<<<<< HEAD -MYSQL_VERSION_PATCH=40 -MYSQL_VERSION_EXTRA=-84.0 -======= MYSQL_VERSION_PATCH=41 -MYSQL_VERSION_EXTRA= ->>>>>>> mysql-5.6.41 +MYSQL_VERSION_EXTRA=-84.1 diff --git a/client/mysqldump.c b/client/mysqldump.c index bc17a03a2df8..ec47ebe1c140 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3345,16 +3345,13 @@ static uint get_table_structure(char *table, char *db, char *table_type, /* Make an sql-file, if path was given iow. option -T was given */ char buff[20+FN_REFLEN]; MYSQL_FIELD *field; -<<<<<<< HEAD + my_bool freemem= FALSE; + char const *text; my_bool old_ignore_errors=ignore_errors; //fprintf(stderr, "ignore create table %d\n", opt_ignore_show_create_table_error); if (opt_ignore_show_create_table_error) ignore_errors=1; -======= - my_bool freemem= FALSE; - char const *text; ->>>>>>> mysql-5.6.41 my_snprintf(buff, sizeof(buff), "show create table %s", result_table); diff --git a/mysql-test/include/check_openssl.inc b/mysql-test/include/check_openssl.inc deleted file mode 100644 index ee8900f9c44b..000000000000 --- a/mysql-test/include/check_openssl.inc +++ /dev/null @@ -1,5 +0,0 @@ -# Only run this test if the server was built with OpenSSL ---let $rsa_var = query_get_value("SHOW STATUS LIKE 'Rsa_public_key'", Variable_name, 1) -if ($rsa_var != 'Rsa_public_key'){ - --skip Need OpenSSL support -} diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result index 75d5cc9f65da..0b624d633c68 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522.result @@ -580,11 +580,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -<<<<<<< HEAD -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x0) -======= ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_COMPACT and the meta-data file has ROW_TYPE_REDUNDANT) ->>>>>>> mysql-5.6.41 unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -596,11 +592,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -<<<<<<< HEAD -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x0) -======= ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_DYNAMIC and the meta-data file has ROW_TYPE_REDUNDANT) ->>>>>>> mysql-5.6.41 unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -774,11 +766,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -<<<<<<< HEAD -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x1) -======= ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_REDUNDANT and the meta-data file has ROW_TYPE_COMPACT) ->>>>>>> mysql-5.6.41 unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -790,11 +778,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -<<<<<<< HEAD -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1) -======= ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_DYNAMIC and the meta-data file has ROW_TYPE_COMPACT) ->>>>>>> mysql-5.6.41 unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -971,11 +955,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -<<<<<<< HEAD -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x21) -======= ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_COMPACT and the meta-data file has ROW_TYPE_DYNAMIC) ->>>>>>> mysql-5.6.41 unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -987,11 +967,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -<<<<<<< HEAD -ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x21) -======= ERROR HY000: Schema mismatch (Table flags don't match,server table has ROW_TYPE_REDUNDANT and the meta-data file has ROW_TYPE_DYNAMIC) ->>>>>>> mysql-5.6.41 unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; diff --git a/mysql-test/t/ssl_san.test b/mysql-test/t/ssl_san.test index beb20d8c17e6..cc57476cca43 100644 --- a/mysql-test/t/ssl_san.test +++ b/mysql-test/t/ssl_san.test @@ -4,7 +4,7 @@ # As YaSSL does not implement 'X509_get_ext_d2i()' function and always # returns NULL, '--ssl-verify-server-cert' can only check commonName ('CN') # entry in the certificate and therefore this test won't pass. ---source include/check_openssl.inc +--source include/have_openssl_support.inc --source include/count_sessions.inc diff --git a/mysql-test/t/ssl_san_ipv6.test b/mysql-test/t/ssl_san_ipv6.test index b49a54c47fee..461e2233b9df 100644 --- a/mysql-test/t/ssl_san_ipv6.test +++ b/mysql-test/t/ssl_san_ipv6.test @@ -4,7 +4,7 @@ # As YaSSL does not implement 'X509_get_ext_d2i()' function and always # returns NULL, '--ssl-verify-server-cert' can only check commonName ('CN') # entry in the certificate and therefore this test won't pass. ---source include/check_openssl.inc +--source include/have_openssl_support.inc --source include/count_sessions.inc diff --git a/mysql-test/t/ssl_verify_identity.test b/mysql-test/t/ssl_verify_identity.test index 28c96c8857f7..0396d5336c4a 100644 --- a/mysql-test/t/ssl_verify_identity.test +++ b/mysql-test/t/ssl_verify_identity.test @@ -3,17 +3,15 @@ # when ssl-verify-server-cert option is provided, the DNS/IPs provided # in the Subject Alternative Names field (which can be provided as an # extension in X509) are also checked for apart from the Common Name in -# the subject. Applicable for openssl versions 1.0.2 and greater. +# the subject. When openssl versions is 1.0.2 and greater, +# 'X509_check_host()' / 'X509_check_ip()' functions are used. Otherwise, +# manual traversal of SAN records is performed. # # === Related bugs and/or worklogs === # Bug #16211011 - SSL CERTIFICATE SUBJECT ALT NAMES WITH IPS NOT RESPECTED WITH --SSL-VERIFY-SERVER-CERT -# -# Note that these test cases are written keeping in mind that the openssl version used by the system will -# be 1.0.2+. For older versions of openssl, the test will be skipped. --source include/have_openssl.inc --source include/have_openssl_support.inc ---source include/check_openssl_version.inc --source include/not_embedded.inc --echo ### Trying to connect without ssl. This should establish an unencrypted connection. diff --git a/sql-common/client.c b/sql-common/client.c index 089a0819e8d3..dcc0246f1568 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -97,10 +97,6 @@ my_bool net_flush(NET *net); #define SOCKET_ERROR -1 #endif -#ifdef HAVE_OPENSSL -#include -#endif - #include "client_settings.h" #include #include @@ -2069,29 +2065,19 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c { SSL *ssl; X509 *server_cert= NULL; -<<<<<<< HEAD #ifndef HAVE_X509_CHECK_FUNCTIONS const char *cn= NULL; -======= - int ret_validation= 1; - -#if !(OPENSSL_VERSION_NUMBER >= 0x10002000L) - char *cn= NULL; ->>>>>>> mysql-5.6.41 int cn_loc= -1; ASN1_STRING *cn_asn1= NULL; X509_NAME_ENTRY *cn_entry= NULL; X509_NAME *subject= NULL; #endif -<<<<<<< HEAD #ifndef HAVE_YASSL ASN1_OCTET_STRING *server_ip_address= NULL; const unsigned char *ipout= NULL; size_t iplen= 0; #endif int ret_validation= 1; -======= ->>>>>>> mysql-5.6.41 DBUG_ENTER("ssl_verify_server_cert"); DBUG_PRINT("enter", ("server_hostname: %s", server_hostname)); @@ -2125,39 +2111,10 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c are what we expect. */ -<<<<<<< HEAD #ifndef HAVE_YASSL /* Checking if the provided server_hostname is a V4/V6 IP address */ server_ip_address= a2i_IPADDRESS(server_hostname); if(server_ip_address != NULL) -======= - /* - Use OpenSSL certificate matching functions instead of our own if we - have OpenSSL. The X509_check_* functions return 1 on success. - */ -#if OPENSSL_VERSION_NUMBER >= 0x10002000L || defined(HAVE_WOLFSSL) - if ((X509_check_host(server_cert, server_hostname, strlen(server_hostname), - 0, 0) != 1) && - (X509_check_ip_asc(server_cert, server_hostname, 0) != 1)) { - *errptr = "Failed to verify the server certificate via X509 certificate " - "matching functions"; - goto error; - - } else { - /* Success */ - ret_validation = 0; - } -#else /* OPENSSL_VERSION_NUMBER < 0x10002000L */ - /* - OpenSSL prior to 1.0.2 do not support X509_check_host() function. - Use deprecated X509_get_subject_name() instead. - */ - - subject= X509_get_subject_name((X509 *) server_cert); - // Find the CN location in the subject - cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1); - if (cn_loc < 0) ->>>>>>> mysql-5.6.41 { iplen= ASN1_STRING_length(server_ip_address); #if OPENSSL_VERSION_NUMBER < 0x10100000L @@ -2212,7 +2169,6 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c goto error; } -<<<<<<< HEAD #if OPENSSL_VERSION_NUMBER < 0x10100000L cn= (const char *) ASN1_STRING_data(cn_asn1); #else @@ -2240,16 +2196,6 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c } #endif *errptr= ret_validation != 0 ? "SSL certificate validation failure" : ""; -======= - DBUG_PRINT("info", ("Server hostname in cert: %s", cn)); - if (!strcmp(cn, server_hostname)) - { - /* Success */ - ret_validation= 0; - } -#endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */ - *errptr= "SSL certificate validation failure"; ->>>>>>> mysql-5.6.41 error: #ifndef HAVE_YASSL diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index aab1b735d912..f625ea464336 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 84.0 +#define PERCONA_INNODB_VERSION 84.1 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index faea47345d8c..92bcd2697c0f 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -1339,30 +1339,23 @@ row_import::match_schema( const unsigned relevant_table_flags = m_table->flags & ~DICT_TF_MASK_DATA_DIR; -<<<<<<< HEAD if (relevant_flags != relevant_table_flags) { - ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Table flags don't match, server table has 0x%x " - "and the meta-data file has 0x%x", - relevant_table_flags, relevant_flags); - -======= - if (m_flags != m_table->flags) { - if (dict_tf_to_row_format_string(m_flags) != - dict_tf_to_row_format_string(m_table->flags)) { + if (dict_tf_to_row_format_string(relevant_flags) != + dict_tf_to_row_format_string(relevant_table_flags)) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, "Table flags don't match," "server table has %s " "and the meta-data file has %s", - dict_tf_to_row_format_string(m_table->flags), - dict_tf_to_row_format_string(m_flags)); + dict_tf_to_row_format_string( + relevant_table_flags), + dict_tf_to_row_format_string( + relevant_flags)); } else { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, "Table flags don't match"); } ->>>>>>> mysql-5.6.41 return(DB_ERROR); } else if (m_table->n_cols != m_n_cols) { ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, From 3f6f61c498607fed4a208c4bc72517c4618c482b Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Tue, 14 Aug 2018 15:15:23 +0200 Subject: [PATCH 005/214] PS-4722: Use clang-format-5.0 for TravisCI --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3477b311d4e9..040127ac829b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,13 @@ matrix: # Common - env: COMMAND=clang-test script: - - wget https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py + - curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -; + - echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" | sudo tee -a /etc/apt/sources.list > /dev/null; + - sudo -E apt-get -yq update >> ~/apt-get-update.log 2>&1; + - sudo -E apt-get -yq --no-install-suggests --no-install-recommends install clang-format-5.0 || travis_terminate 1 + - wget https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py || travis_terminate 1 - chmod a+x clang-format-diff.py - - git diff -U0 --no-color HEAD^1 *.c *.cc *.cpp *.h *.hpp *.i *.ic *.ih | ./clang-format-diff.py -style=file -p1 >_GIT_DIFF + - git diff -U0 --no-color HEAD^1 *.c *.cc *.cpp *.h *.hpp *.i *.ic *.ih | ./clang-format-diff.py -binary=clang-format-5.0 -style=file -p1 >_GIT_DIFF - '[ ! -s _GIT_DIFF ] && { echo The last git commit is clang-formatted; travis_terminate 0; } || { cat _GIT_DIFF; travis_terminate 1; }' From f712bbadb7ebf23446822b959e81b1e2166b047a Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Fri, 17 Aug 2018 12:59:09 +0200 Subject: [PATCH 006/214] PS-4745: Travis CI refactoring 1. Remove `osx_image: xcode9.3` to use default version of XCode (which is 9.4 now for Travis, and 10.0 is in beta). 2. Add `allow_failures:` for the `clang-format` job. When only `clang-format` will fail the whole build still will be green. --- .travis.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 040127ac829b..d0da0f487efb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,8 @@ env: - CCACHE_CPP2=1 matrix: + allow_failures: + - env: COMMAND=clang-test include: # Common - env: COMMAND=clang-test @@ -37,7 +39,6 @@ matrix: env: BUILD=Debug compiler: clang os: osx - osx_image: xcode9.3 # 2 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=6.0 BUILD=RelWithDebInfo @@ -78,7 +79,6 @@ matrix: env: BUILD=RelWithDebInfo compiler: clang os: osx - osx_image: xcode9.3 # 2 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) env: VERSION=6.0 BUILD=Debug @@ -149,7 +149,9 @@ matrix: script: - - JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:'); + - INIT_TIME=$SECONDS; + JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:'); + echo --- Initialization time $INIT_TIME seconds; echo --- JOB_NUMBER=$JOB_NUMBER TRAVIS_COMMIT=$TRAVIS_COMMIT TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG TRAVIS_BRANCH=$TRAVIS_BRANCH TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH - echo --- Perform all Travis jobs or only jobs that are included in ENV_VAR_JOB_NUMBERS list if it is defined; @@ -207,7 +209,9 @@ script: brew install ccache; brew link ccache; export PATH="/usr/local/opt/ccache/libexec:$PATH"; - fi + fi; + UPDATE_TIME=$(($SECONDS - $INIT_TIME)); + echo --- Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds. - mkdir bin; cd bin; - $CC -v @@ -264,9 +268,10 @@ script: - echo --- Perform Debug or RelWithDebInfo compilation; echo --- CMAKE_OPT=\"$CMAKE_OPT\"; echo --- ENV_VAR_CMAKE_OPT=\"$ENV_VAR_CMAKE_OPT\"; - cmake .. - $CMAKE_OPT - $ENV_VAR_CMAKE_OPT - - make -j2 || travis_terminate 1 - - ccache --show-stats - + cmake .. $CMAKE_OPT $ENV_VAR_CMAKE_OPT; + CMAKE_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME)); + echo --- CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds. + - make -j2 + - ccache --show-stats; + BUILD_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME - $CMAKE_TIME)); + echo --- Total time $SECONDS seconds. Build time $BUILD_TIME seconds. CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds. From b5b2e8b740bbd9ad0e00d348b9ab517fd9e7f6eb Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Fri, 17 Aug 2018 17:07:53 +0000 Subject: [PATCH 007/214] PS-4367 : Prepare TokuDB for 8.0 PS-4381 : PerconaFT needs different libraries to link to 8.0 debug sync and PFS PS-4372 : PerconaFT needs more 8.0 conditional compilation to pull in proper pfs headers PS-4386 : Fix various places where macros are redefined or used when undefined - Advance git submodule commit pointer for PerconaFT to pull in changes for issues listed above. This will be cherry-picked to 5.7. --- storage/tokudb/PerconaFT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/tokudb/PerconaFT b/storage/tokudb/PerconaFT index 8ff18ff1d135..9f020f358c11 160000 --- a/storage/tokudb/PerconaFT +++ b/storage/tokudb/PerconaFT @@ -1 +1 @@ -Subproject commit 8ff18ff1d135a8a5d6e745cf2c4dbf5684fcebd9 +Subproject commit 9f020f358c113aaa1760d693d27ddb34189db11c From 2e416edb44ba39fe1f345c3eb41db70ecabd1b4a Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Fri, 17 Aug 2018 17:16:24 +0300 Subject: [PATCH 008/214] Release notes for 5.6.41-84.1 (5.6) --- doc/source/conf.py | 2 +- .../Percona-Server-5.6.40-84.0.rst | 159 ++++++++++++++++++ .../Percona-Server-5.6.41-84.1.rst | 39 +++++ .../release-notes/release-notes_index.rst | 1 + 4 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 doc/source/release-notes/Percona-Server-5.6.40-84.0.rst create mode 100644 doc/source/release-notes/Percona-Server-5.6.41-84.1.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index 2e077eca5286..02a657c5f110 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -54,7 +54,7 @@ # The short X.Y version. version = '5.6' # The full version, including alpha/beta/rc tags. -release = '5.6.39-83.1' +release = '5.6.41-84.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/release-notes/Percona-Server-5.6.40-84.0.rst b/doc/source/release-notes/Percona-Server-5.6.40-84.0.rst new file mode 100644 index 000000000000..9ce668de4094 --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.6.40-84.0.rst @@ -0,0 +1,159 @@ +.. rn:: 5.6.40-84.0 + +============================ +|Percona Server| 5.6.40-84.0 +============================ + +Percona is glad to announce the release of |Percona Server| 5.6.40-84.0 on +May 30, 2018 (Downloads are available `here +`_ +and from the :doc:`Percona Software Repositories `). + +Based on `MySQL 5.6.40 +`_, including +all the bug fixes in it, |Percona Server| 5.6.40-84.0 is the current GA release +in the |Percona Server| 5.6 series. All of |Percona|'s software is open-source +and free. + +New Features +============ + +* A new string variable :variable:`version_suffix` allows to change suffix + for the |Percona Server| version string returned by the read-only + :variable:`version` variable. This allows to append the version number for + the server with a custom suffix to reflect some build or configuration + specifics. Also :variable:`version_comment` (default value of which is taken + from the CMake ``COMPILATION_COMMENT`` option) is converted from a global + read-only to a global read-write variable and thereby it is now cutomizable. + +* Query response time plugin now can be disabled at session level with use + of a new variable :variable:`query_response_time_session_stats`. + +Bugs Fixed +========== + +* Compilation warning was fixed for ``-DWITH_QUERY_RESPONSE_TIME=ON`` CMake + compilation option, which makes QRT to be linked statically. Bug fixed + :psbug:`3841`. + +* A code clean-up was done to fix clang 6 specific compilation + warnings and errors (bug fixed :psbug:`3893`, upstream :mysqlbug:`90111`). + +* Using ``-DWITHOUT_=ON`` CMake variable to exclude a plugin from the + build didn't work for some plugins, including a number of storage engines. + Bug fixed :psbug:`3901`. + +* A clean-up in |Percona Server| binlog-related code was made to avoid + uninitialized memory comparison. Bug fixed :psbug:`3925` (upstream + :mysqlbug:`90238`). + +* Temporary file I/O was not instrumented for Performance Schema. Bug fixed + :psbug:`3937` (upstream :mysqlbug:`90264`). + +* A ``key_block_size`` value was set automatically by the Improved MEMORY + Storage Engine, which resulted in warnings when changing the engine type to + |InnoDB|, and constantly growing ``key_block_size`` during alter operations. + Bugs fixed :psbug:`3936`, :psbug:`3940`, and :psbug:`3943`. + +* |Percona Server| Debian packages description included reference to + ``/etc/mysql/my.cnf`` file, which is not actually present in these packages. + Bug fixed :psbug:`2046`. + +* Fixes were introduced to remove GCC 8 compilation warnings for the + |Percona Server| build, retaining compatibility with old compiler versions, + including GCC 4.4. Bugs fixed :psbug:`3950` and :psbug:`4471`. + +* A typo in ``plugin.cmake`` file prevented to compile plugins statically + into the server. Bug fixed :psbug:`3871` (upstream :mysqlbug:`89766`). + +* ``-DWITH_NUMA=ON`` build option was silently ignored by CMake when + NUMA development package was not installed, instead of exiting by error. + Bug fixed :psbug:`4487`. + +* Variables :variable:`innodb_buffer_pool_populate` and :variable:`numa_interleave` mapped to the upstream `innodb_numa_interleave `_ variable in :rn:`5.6.27-75.0` were reverted to their original implementation due to upstream variant being less effective in memory allocation. Now buffer pool is allocated with MAP_POPULATE, forcing NUMA interleaved allocation at the buffer pool initialization time. Bug fixed :psbug:`3967`. + +* :variable:`audit_log_include_accounts` variable did not take effect if + placed in ``my.cnf`` configuration file, while still working as intended if + set dynamically. Bug fixed :psbug:`3867`. + +* Synchronization between between :variable:`innodb_kill_idle_transaction` and + :variable:`kill_idle_transaction` system variables was broken because of the + regression in |Percona Server| :rn:`5.6.40-83.2`. Bug fixed :psbug:`3955`. + +* Executing the ``SHOW GLOBAL STATUS`` expression could cause "data drift" on + global status variables in case of a query rollback: the variable, being by + its nature a counter and allowing only an increase, could return to its + previous value. Bug fixed :psbug:`3951` (upstream :mysqlbug:`90351`). + +* ``ALTER TABLE ... COMMENT = ...`` statement caused |TokuDB| to rebuild the + whole table, which is not needed, as only FRM metadata should be changed. The + fix was provided as a contribution by `Fungo Wang `_. + Bugs fixed :psbug:`4280` and :psbug:`4292`. + +* A number of |Percona Server| 8.0 |TokuDB| fixes have been backported to + |Percona Server| 5.6 in preparation for using MySQL 8.0. Bugs fixed + :psbug:`4379`, :psbug:`4380`, :psbug:`4387`, :psbug:`4378`, :psbug:`4383`, + :psbug:`4384`, :psbug:`4386`, :psbug:`4382`, :psbug:`4391`, + :psbug:`4390`, :psbug:`4392`, and :psbug:`4381`. + +TokuDB Changes and Fixes +======================== + +* Two new variables, :variable:`tokudb_enable_fast_update` and + :variable:`tokudb_enable_fast_upsert`, were introduced to facilitate the + |TokuDB| fast updates feature, which involves queries optimization to avoid + random reads during their execution. Bug fixed :psbug:`4365`. + +* A data race was fixed in minicron utility of the PerconaFT, as a contribution + by Rik Prohaska. Bug fixed :psbug:`4281`. + +* Row count and cardinality decrease to zero took place after long-running + ``REPLACE`` load, ending up with full table scans for any action. Bug fixed + :psbug:`4296`. + +Other Bugs Fixed +================ + +* :psbug:`3818` "Orphaned file mysql-test/suite/innodb/r/percona_innodb_kill_idle_trx.result" + +* :psbug:`3926` "Potentially truncated bitmap file name in + log_online_open_bitmap_file_read_only() (storage/innobase/log/log0online.cc)" + +* :psbug:`2204` "Test main.audit_log_default_db is unstable" + +* :psbug:`3767` "Fix compilation warnings/errors with clang" + +* :psbug:`3773` "Incorrect key file for table frequently for tokudb" + +* :psbug:`3794` "MTR test main.percona_show_temp_tables_stress does not wait + for events to start" + +* :psbug:`3798` "MTR test innodb.percona_extended_innodb_status fails if InnoDB + status contains unquoted special characters" + +* :psbug:`3887` "TokuDB does not compile with + -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF" + +* :psbug:`4388` "5.7 code still has TOKU_INCLUDE_OPTION_STRUCTS which is a + MariaDB specific construct" + +* :psbug:`4265` "TDB-114 (Change use of MySQL HASH to unordered_map) introduces + memory leak" + +* :psbug:`4277` "memory leaks in TDB-2 and TDB-89 tests" + +* :psbug:`4276` "Data race on cache table attributes detected by the thread + sanitizer" + +* :psbug:`4451` "Implement better compression algo testing" + +* :psbug:`4469` "variable use out of scope bug in get_last_key test detected by + ASAN in clang 6" + +* :psbug:`4470` "the cachetable-simple-pin-nonblocking-cheap test occasionally + fails due to a locking conflict with the cachetable evictor" + +* :psbug:`1131` "User_var_log_event::User_var_log_event(const char*, uint, + const Format_description_log_event*): Assertion `(bytes_read == (data_written + - ((old_pre_checksum_fd || (description_event->checksum_alg == + BINLOG_CHECKSUM_ALG_OFF)) ? 0 : 4))) || ((". diff --git a/doc/source/release-notes/Percona-Server-5.6.41-84.1.rst b/doc/source/release-notes/Percona-Server-5.6.41-84.1.rst new file mode 100644 index 000000000000..5353627c348f --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.6.41-84.1.rst @@ -0,0 +1,39 @@ +.. rn:: 5.6.41-84.1 + +================================================================================ +|Percona Server| 5.6.41-84.1 +================================================================================ + +Percona is glad to announce the release of |Percona Server| 5.6.41-84.1 on +August 17, 2018 (Downloads are available `here +`_ +and from the :doc:`Percona Software Repositories `). + +This release merges changes of `MySQL 5.6.41 +`_, including +all the bug fixes in it. Percona Server for MySQL 5.6.41-84.1 is now the current +GA release in the 5.6 series. All of Percona’s software is open-source and free. + +Bugs Fixed +================================================================================ + +- A simple SELECT query on a table with CHARSET=euckr COLLATE=euckr_bin could + return different results each time it was executed. Bug fixed :psbug:`4513` + (upstream :mysqlbug:`91091`). +- Percona Server 5.6.39-83.1 could crash when altering an InnoDB table that has + a full-text search index defined. Bug fixed :psbug:`3851` (upstream + :mysqlbug:`68987`). + +Other Bugs Fixed +================================================================================ + +- :psbug:`3325` "online upgrade GTID cause binlog damage in high write QPS + situation" +- :psbug:`3976` "Errors in MTR tests main.variables-big, + main.information_schema-big, innodb.innodb_bug14676111" +- :psbug:`4506` "Backport fixes from 8.0 for InnoDB memcached Plugin" + +Find the release notes for Percona Server for MySQL 5.6.41-84.1 in our `online +documentation +`_. +Report bugs in the `Jira bug tracker `_. diff --git a/doc/source/release-notes/release-notes_index.rst b/doc/source/release-notes/release-notes_index.rst index b3ec5acd64de..6379e6d2046a 100644 --- a/doc/source/release-notes/release-notes_index.rst +++ b/doc/source/release-notes/release-notes_index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 :glob: + Percona-Server-5.6.41-84.1 Percona-Server-5.6.39-83.1 Percona-Server-5.6.38-83.0 Percona-Server-5.6.37-82.2 From c1b3d6329290540e0f8c1fb0b393797a1a88f33f Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 28 Aug 2018 20:46:55 +0530 Subject: [PATCH 009/214] Raise version number after cloning 5.5.62 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4acb69e9e071..34a2418fde13 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=62 +MYSQL_VERSION_PATCH=63 MYSQL_VERSION_EXTRA= From 4538867195477244a397749d8d58cae2343dfec6 Mon Sep 17 00:00:00 2001 From: Kailasnath Nagarkar Date: Tue, 28 Aug 2018 21:05:50 +0530 Subject: [PATCH 010/214] Bug #28004674: TOO MANY IN EXPRESSIONS CAUSE THE SERVER CRASH ISSUE: IN sub query predicates are transformed into semi join. This transformation does not correctly reset embedding_join_nest for sub selects. Due to this, when number of IN expressions exceeds MAX_TABLES, server exits abnormally. SOLUTION: Corrected setting of embedding_join_nest for sub selects, as part of converting IN sub query predicates to semi join. --- sql/sql_optimizer.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sql/sql_optimizer.cc b/sql/sql_optimizer.cc index 824c7393a4ab..38a4c3be19eb 100644 --- a/sql/sql_optimizer.cc +++ b/sql/sql_optimizer.cc @@ -6692,6 +6692,20 @@ static bool convert_subquery_to_semijoin(JOIN *parent_join, break; } } + + /* + outer_tbl is replaced by wrap_nest. + For subselects, update embedding_join_nest to point to wrap_nest + instead of outer_tbl. + */ + for (Item_exists_subselect **subquery= parent_join->sj_subselects.begin(); + subquery < parent_join->sj_subselects.end(); + subquery++) + { + if ((*subquery)->embedding_join_nest == outer_tbl) + (*subquery)->embedding_join_nest= wrap_nest; + } + /* Ok now wrap_nest 'contains' outer_tbl and we're ready to add the semi-join nest into it From 27d3546aa58349f40f40a79e5c1a82c8299d0bec Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 29 Aug 2018 09:32:15 +0530 Subject: [PATCH 011/214] From a7f9ecef3ed61468eb5a37af4f18c49f54d74048 Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Wed, 29 Aug 2018 13:23:15 +0300 Subject: [PATCH 012/214] Implemented PS-4746 (Revert our fix for PS-3851 (Percona Ver 5.6.39-83.1 Failing assertion: sym_node->table != NULL)) https://jira.percona.com/browse/PS-4746 Reverted our fix for PS-3851 "Percona Ver 5.6.39-83.1 Failing assertion: sym_node->table != NULL" (https://jira.percona.com/browse/PS-3851) (commit 43cb07f) in favor of Oracle's fix for the bug Bug #27326796 "MYSQL CRASH WITH INNODB ASSERTION FAILURE IN FILE PARS0PARS.CC" (commit mysql/mysql-server@a4ea462) Percona's extensions to 'innodb_fts.sync' MTR test case left intact. --- storage/innobase/row/row0mysql.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index ddde8b8f730f..1ad0b68e0d63 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -5500,18 +5500,6 @@ row_rename_table_for_mysql( goto funct_exit; } - /* Wait for background fts sync to finish */ - for (retry = 1; dict_fts_index_syncing(table); ++retry) { - DICT_BG_YIELD(trx); - if (retry % 100 == 0) { - ib_logf(IB_LOG_LEVEL_INFO, - "Unable to rename table %s to new name" - " %s because FTS sync is running on table." - " Retrying\n", - old_name, new_name); - } - } - /* We use the private SQL parser of Innobase to generate the query graphs needed in updating the dictionary data from system tables. */ From 572a178e973c5ba2c336a94cbfecf8d883060857 Mon Sep 17 00:00:00 2001 From: Anushree Prakash B Date: Wed, 29 Aug 2018 20:05:51 +0530 Subject: [PATCH 013/214] Bug#27443252 - THE SELECT WILL DEADLOCK IN THE STORED PROCEDURE, IF THE RESULT SET IS EMPTY. Description: ============ When executing a prepared statement with a procedure call with CURSOR_TYPE_READ_ONLY flag set, libmysqlclient hangs when the procedure performs a SELECT query that returns an empty result set. Analysis: ========= Generally, metadata result sets are no longer terminated with EOF(now OK) packet. However, we have an exception when a cursor is opened by the server in which case we can have a metadata packet terminated by an EOF(now OK) packet. For a simple SELECT query prepared to be executed, when a client requests a cursor to be opened, the server can decide to either open a cursor or send the result set rows. 1. If no cursor is opened by the server, the packet sequence is -> <0 or more rows> 2. If server opens a cursor, the packet sequence is <0 or more rows> The hang in the bug report happens for cases when the server doesn't open a cursor and we have an empty result set. In this case, the packet sequence sent by the server is . Client should be able to figure out that the OK packet following the metadata is the last OK packet of the sequence and it indicates the end of rows result-set. Hence, it need not perform any additional reads which can cause such hangs. Fix: ==== The solution is to check whether the server responded with cursor or not and perform packet reads accordingly. --- libmysql/libmysql.c | 25 ++++++- testclients/mysql_client_test.c | 128 +++++++++++++++++++++++++++++++- 2 files changed, 150 insertions(+), 3 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index f309077636f7..1e9f85edbe3e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2189,7 +2189,23 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) DBUG_RETURN(1); } else + { read_ok_ex(mysql, pkt_len); + /* + If the result set was empty and the server did not open a cursor, + then the response from the server would have been . + This means the OK packet read above was the last OK packet of the + sequence. Hence, we set the status to indicate that the client is + now ready for next command. The stmt->read_row_func is set so as + to ensure that the next call to C API mysql_stmt_fetch() will not + read on the network. Instead, it will return NO_MORE_DATA. + */ + if (!(mysql->server_status & SERVER_STATUS_CURSOR_EXISTS)) + { + mysql->status= MYSQL_STATUS_READY; + stmt->read_row_func= stmt_read_row_no_data; + } + } } } @@ -2598,8 +2614,13 @@ static void prepare_to_fetch_result(MYSQL_STMT *stmt) cursors framework in the server and writes rows directly to the network or b) is more efficient if all (few) result set rows are precached on client and server's resources are freed. + The below check for mysql->status is required because we could + have already read the last packet sent by the server in execute() + and set the status to MYSQL_STATUS_READY. In such cases, we need + not call mysql_stmt_store_result(). */ - mysql_stmt_store_result(stmt); + if (stmt->mysql->status != MYSQL_STATUS_READY) + mysql_stmt_store_result(stmt); } else { diff --git a/testclients/mysql_client_test.c b/testclients/mysql_client_test.c index 2bc178dfa25f..b1a590f65c4b 100644 --- a/testclients/mysql_client_test.c +++ b/testclients/mysql_client_test.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20992,6 +20992,131 @@ static void test_bug25701141() myquery(mysql_query(mysql, "DROP TABLE t1")); } +static void test_bug27443252() +{ + MYSQL_STMT *stmt; + MYSQL_BIND my_bind[1]; + int rc; + int32 a; + int row_count=0; + int column_count=0; + MYSQL_RES *metadata = NULL; + + myheader("test_bug27443252"); + + rc= mysql_query(mysql, "drop procedure if exists p1"); + myquery(rc); + rc= mysql_query(mysql, "drop table if exists p1"); + myquery(rc); + rc= mysql_query(mysql, "create table t1 (id int)"); + myquery(rc); + rc= mysql_query(mysql, "create procedure p1() begin select * from t1; end"); + myquery(rc); + + /* Case 1 - Procedure call with empty result set */ + stmt= open_cursor("call p1"); + /* This should not result in hang */ + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + metadata = mysql_stmt_result_metadata(stmt); + if (metadata) + { + column_count = mysql_num_fields(metadata); + DIE_UNLESS(column_count == 1); + } + + memset(my_bind, 0, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*)&a; + my_bind[0].buffer_length= (ulong)sizeof(a); + rc= mysql_stmt_bind_result(stmt, my_bind); + check_execute(stmt, rc); + + while (!mysql_stmt_fetch(stmt)) + row_count++; + DIE_UNLESS(row_count == 0); + + rc = mysql_stmt_next_result(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_free_result(stmt); + check_execute(stmt, rc); + mysql_free_result(metadata); + mysql_stmt_close(stmt); + + /* Case 2 - SELECT with empty result set */ + row_count= 0; + stmt= open_cursor("select * from t1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + memset(my_bind, 0, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*)&a; + my_bind[0].buffer_length= (ulong)sizeof(a); + + rc= mysql_stmt_bind_result(stmt, my_bind); + check_execute(stmt, rc); + + while (!mysql_stmt_fetch(stmt)) + row_count++; + DIE_UNLESS(row_count == 0); + mysql_stmt_close(stmt); + + /* Case 3 - Procedure call with non-empty result set */ + rc= mysql_query(mysql, "insert into t1 (id) values " + " (1), (2), (3)"); + myquery(rc); + row_count= 0; + stmt= open_cursor("call p1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + memset(my_bind, 0, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*)&a; + my_bind[0].buffer_length= (ulong)sizeof(a); + rc= mysql_stmt_bind_result(stmt, my_bind); + check_execute(stmt, rc); + + while (!mysql_stmt_fetch(stmt)) + row_count++; + DIE_UNLESS(row_count == 3); + + rc = mysql_stmt_next_result(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_free_result(stmt); + check_execute(stmt, rc); + mysql_stmt_close(stmt); + + /* Case 4 - SELECT with Non-empty result set */ + row_count= 0; + stmt= open_cursor("select * from t1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + memset(my_bind, 0, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*)&a; + my_bind[0].buffer_length= (ulong)sizeof(a); + rc= mysql_stmt_bind_result(stmt, my_bind); + check_execute(stmt, rc); + + while (!mysql_stmt_fetch(stmt)) + row_count++; + DIE_UNLESS(row_count == 3); + + rc= mysql_stmt_free_result(stmt); + check_execute(stmt, rc); + mysql_stmt_close(stmt); + + /* Cleanup */ + rc= mysql_query(mysql, "drop table t1"); + myquery(rc); + rc= mysql_query(mysql, "drop procedure p1"); + myquery(rc); +} + static struct my_tests_st my_tests[]= { { "disable_query_logs", disable_query_logs }, { "test_view_sp_list_fields", test_view_sp_list_fields }, @@ -21284,6 +21409,7 @@ static struct my_tests_st my_tests[]= { { "test_bug19894382", test_bug19894382 }, { "test_bug22028117", test_bug22028117 }, { "test_bug25701141", test_bug25701141 }, + { "test_bug27443252", test_bug27443252 }, { 0, 0 } }; From a93a6d48e82213744d3a93538487f1249ac49d77 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Thu, 30 Aug 2018 08:34:21 +0530 Subject: [PATCH 014/214] Bug #27897053: ILLEGAL MIX OF COLLATIONS WHEN DATE_FORMAT ON THE RIGHT SIDE OF OPERATION Issue: ------ During string comparision, we coerce the right argument to the left's collation. Solution: --------- Use the appropriate aggregations to try to find a superset. Also, make sure UTF32 is counted as a superset of any collation. Previously, only utf8mb4 would have this status. This is a backport of Bug#25642319 and Bug#27452148. --- mysql-test/r/compare.result | 33 +++++++++++++++++++++++++++++ mysql-test/r/ctype_many.result | 38 ++++++++++++++++++++++------------ mysql-test/t/compare.test | 29 ++++++++++++++++++++++++++ mysql-test/t/ctype_many.test | 20 ++++-------------- sql/item.cc | 6 ++++++ sql/item_cmpfunc.cc | 12 ++++++----- strings/ctype-uca.c | 4 ++-- strings/ctype-ucs2.c | 4 ++-- 8 files changed, 108 insertions(+), 38 deletions(-) diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index fd240bdf6eb5..6e7a1de63ce8 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -122,3 +122,36 @@ CREATE TABLE t1(a INT ZEROFILL); SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; 1 DROP TABLE t1; +SET NAMES utf8; +CREATE TABLE t1(id INT, plage TIME, plage2 DATETIME) ENGINE=InnoDB CHARSET=utf8; +INSERT INTO t1 VALUES(1,'00:00:00', '2018-04-20 00:00:00'); +SELECT (date_format(plage2,'%H:%i:%s')) < plage FROM t1; +(date_format(plage2,'%H:%i:%s')) < plage +0 +SELECT plage > (date_format(plage2,'%H:%i:%s')) FROM t1; +plage > (date_format(plage2,'%H:%i:%s')) +0 +SELECT (date_format(plage2,'%H:%i:%s')) < plage COLLATE utf8_general_ci FROM t1; +(date_format(plage2,'%H:%i:%s')) < plage COLLATE utf8_general_ci +0 +DROP TABLE t1; +SET NAMES default; + +Bug #27452148: ASSERTION FAILED: (SLEN % 4) == 0 IN +MY_STRNNCOLLSP_UTF32_BIN + +SET NAMES latin1; +CREATE TABLE t1(a CHAR(10) CHARACTER SET utf32 COLLATE utf32_bin); +INSERT INTO t1 VALUES('a'),('b'),('c'); +SELECT ROW('1', '1') > ROW(a, '1') FROM t1; +ROW('1', '1') > ROW(a, '1') +0 +0 +0 +SELECT ROW(a, '1') > ROW('1', '1') FROM t1; +ROW(a, '1') > ROW('1', '1') +1 +1 +1 +DROP TABLE t1; +SET NAMES default; diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index d700d13ee963..bda34adc7f3a 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1706,7 +1706,7 @@ Warning 1292 Truncated incorrect BINARY(0) value: '1.' # # # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32 -# Testing that only utf8mb4 is superset for utf8 +# Testing that utf8mb4 and utf32 are superset for all Unicode # No other Unicode character set pairs have superset/subset relations # CREATE TABLE t1 ( @@ -1725,40 +1725,52 @@ ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (ucs2_gene SELECT CHARSET(CONCAT(utf8, utf16)) FROM t1; ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat' SELECT CHARSET(CONCAT(utf8, utf32)) FROM t1; -ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf8, utf32)) +utf32 SELECT CHARSET(CONCAT(utf8mb4, utf8)) FROM t1; CHARSET(CONCAT(utf8mb4, utf8)) utf8mb4 SELECT CHARSET(CONCAT(utf8mb4, ucs2)) FROM t1; -ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf8mb4, ucs2)) +utf8mb4 SELECT CHARSET(CONCAT(utf8mb4, utf16)) FROM t1; -ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf8mb4, utf16)) +utf8mb4 SELECT CHARSET(CONCAT(utf8mb4, utf32)) FROM t1; -ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf8mb4, utf32)) +utf8mb4 SELECT CHARSET(CONCAT(ucs2, utf8)) FROM t1; ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'concat' SELECT CHARSET(CONCAT(ucs2, utf8mb4)) FROM t1; -ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(ucs2, utf8mb4)) +utf8mb4 SELECT CHARSET(CONCAT(ucs2, utf16)) FROM t1; ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat' SELECT CHARSET(CONCAT(ucs2, utf32)) FROM t1; -ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(ucs2, utf32)) +utf32 SELECT CHARSET(CONCAT(utf16, utf8)) FROM t1; ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'concat' SELECT CHARSET(CONCAT(utf16, ucs2)) FROM t1; ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat' SELECT CHARSET(CONCAT(utf16, utf8mb4)) FROM t1; -ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf16, utf8mb4)) +utf8mb4 SELECT CHARSET(CONCAT(utf16, utf32)) FROM t1; -ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf16, utf32)) +utf32 SELECT CHARSET(CONCAT(utf32, utf8)) FROM t1; -ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf32, utf8)) +utf32 SELECT CHARSET(CONCAT(utf32, ucs2)) FROM t1; -ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf32, ucs2)) +utf32 SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1; -ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf32, utf8mb4)) +utf32 SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1; -ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat' +CHARSET(CONCAT(utf32, utf16)) +utf32 DROP TABLE t1; # # Bug#58321 No warning when characters outside BMP0 is converted to UCS2 diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index 3a709503b8fa..64bde98aa070 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -101,3 +101,32 @@ SET sql_mode = default; CREATE TABLE t1(a INT ZEROFILL); SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; DROP TABLE t1; + +# +# Bug#27897053 ILLEGAL MIX OF COLLATIONS WHEN DATE_FORMAT ON THE RIGHT SIDE +# OF OPERATION +# + +SET NAMES utf8; + +CREATE TABLE t1(id INT, plage TIME, plage2 DATETIME) ENGINE=InnoDB CHARSET=utf8; +INSERT INTO t1 VALUES(1,'00:00:00', '2018-04-20 00:00:00'); + +SELECT (date_format(plage2,'%H:%i:%s')) < plage FROM t1; +SELECT plage > (date_format(plage2,'%H:%i:%s')) FROM t1; +SELECT (date_format(plage2,'%H:%i:%s')) < plage COLLATE utf8_general_ci FROM t1; + +DROP TABLE t1; +SET NAMES default; + +--echo +--echo Bug #27452148: ASSERTION FAILED: (SLEN % 4) == 0 IN +--echo MY_STRNNCOLLSP_UTF32_BIN +--echo +SET NAMES latin1; +CREATE TABLE t1(a CHAR(10) CHARACTER SET utf32 COLLATE utf32_bin); +INSERT INTO t1 VALUES('a'),('b'),('c'); +SELECT ROW('1', '1') > ROW(a, '1') FROM t1; +SELECT ROW(a, '1') > ROW('1', '1') FROM t1; +DROP TABLE t1; +SET NAMES default; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 219f117ee504..8baed1e0ae83 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -256,7 +256,7 @@ DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1) --echo # --echo # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32 ---echo # Testing that only utf8mb4 is superset for utf8 +--echo # Testing that utf8mb4 and utf32 are superset for all Unicode --echo # No other Unicode character set pairs have superset/subset relations --echo # @@ -269,34 +269,28 @@ CREATE TABLE t1 ( ); INSERT INTO t1 VALUES ('','','','',''); -# utf8mb4 is superset only for utf8 +# utf8mb4 and utf32 are the only supersets for utf8 SELECT CHARSET(CONCAT(utf8, utf8mb4)) FROM t1; --error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf8, ucs2)) FROM t1; --error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf8, utf16)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf8, utf32)) FROM t1; -# utf8mb4 is superset only for utf8 +# utf8mb4 is superset for everything SELECT CHARSET(CONCAT(utf8mb4, utf8)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf8mb4, ucs2)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf8mb4, utf16)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf8mb4, utf32)) FROM t1; # ucs2 is not a superset for the other Unicode character sets --error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(ucs2, utf8)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(ucs2, utf8mb4)) FROM t1; --error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(ucs2, utf16)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(ucs2, utf32)) FROM t1; @@ -305,20 +299,14 @@ SELECT CHARSET(CONCAT(ucs2, utf32)) FROM t1; SELECT CHARSET(CONCAT(utf16, utf8)) FROM t1; --error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf16, ucs2)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf16, utf8mb4)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf16, utf32)) FROM t1; -# utf32 is not a superset for the other Unicode character sets ---error ER_CANT_AGGREGATE_2COLLATIONS +# utf32 is a superset for the other Unicode character sets SELECT CHARSET(CONCAT(utf32, utf8)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf32, ucs2)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1; ---error ER_CANT_AGGREGATE_2COLLATIONS SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1; DROP TABLE t1; diff --git a/sql/item.cc b/sql/item.cc index 070c5ba36fb9..5c3faefb5eed 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2247,6 +2247,12 @@ left_is_superset(DTCollation *left, DTCollation *right) left->collation->mbmaxlen > right->collation->mbmaxlen && left->collation->mbminlen == right->collation->mbminlen))))) return TRUE; + /* Allow convert from any Unicode to utf32 or utf8mb4 */ + if (test_all_bits(left->collation->state, + MY_CS_UNICODE | MY_CS_UNICODE_SUPPLEMENT) && + right->collation->state & MY_CS_UNICODE && + left->derivation == right->derivation) + return true; /* Allow convert from ASCII */ if (right->repertoire == MY_REPERTOIRE_ASCII && (left->derivation < right->derivation || diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 5f72fa919602..90afa439baa6 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -758,7 +758,7 @@ int Arg_comparator::set_compare_func(Item_result_field *item, Item_result type) We must set cmp_charset here as we may be called from for an automatic generated item, like in natural join */ - if (cmp_collation.set((*a)->collation, (*b)->collation) || + if (cmp_collation.set((*a)->collation, (*b)->collation, MY_COLL_CMP_CONV) || cmp_collation.derivation == DERIVATION_NONE) { my_coll_agg_error((*a)->collation, (*b)->collation, @@ -1207,10 +1207,12 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg, (*b)->result_type() == STRING_RESULT) { DTCollation coll; - coll.set((*a)->collation.collation); - if (agg_item_set_converter(coll, owner->func_name(), - b, 1, MY_COLL_CMP_CONV, 1)) - return 1; + coll.set((*a)->collation, (*b)->collation, MY_COLL_CMP_CONV); + if (agg_item_set_converter(coll, owner->func_name(), a, 1, + MY_COLL_CMP_CONV, 1) || + agg_item_set_converter(coll, owner->func_name(), b, 1, + MY_COLL_CMP_CONV, 1)) + return true; } else if (try_year_cmp_func(type)) { diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index aba5102d2b14..bd5b03a8e07f 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24735,7 +24735,7 @@ MY_COLLATION_HANDLER my_collation_utf32_uca_handler = extern MY_CHARSET_HANDLER my_charset_utf32_handler; -#define MY_CS_UTF32_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII) +#define MY_CS_UTF32_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT|MY_CS_NONASCII) CHARSET_INFO my_charset_utf32_unicode_ci= { diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 16d39d488d8f..135210a87327 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -2811,7 +2811,7 @@ MY_CHARSET_HANDLER my_charset_utf32_handler= CHARSET_INFO my_charset_utf32_general_ci= { 60,0,0, /* number */ - MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT|MY_CS_NONASCII, "utf32", /* cs name */ "utf32_general_ci", /* name */ "UTF-32 Unicode", /* comment */ From 78e067e69ab7afa9f02b03e1c3f398e4da4d7377 Mon Sep 17 00:00:00 2001 From: Kailasnath Nagarkar Date: Thu, 30 Aug 2018 17:19:34 +0530 Subject: [PATCH 015/214] Bug #27659490 : SELECT USING DYNAMIC RANGE AND INDEX MERGE USE TOO MUCH MEMORY(OOM) Issue: While creating a handler object, index-merge access creates it in statement MEM_ROOT. However when this is used with "Dynamic range access method", as range optimizer gets invoked multiple times, mysql ends up consuming a lot of memory. Solution: Instead of using statement MEM_ROOT to allocate the handler object, use the local MEM_ROOT of the range optimizer which gets destroyed at the end of range optimizer's usage. --- sql/opt_range.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3e0362995d7b..9b29494fae4c 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights * reserved. This program is free software; you can redistribute it and/or modify @@ -1660,7 +1660,18 @@ int QUICK_ROR_UNION_SELECT::reset() List_iterator_fast it(quick_selects); while ((quick= it++)) { - if (quick->init_ror_merged_scan(FALSE)) + /* + Use mem_root of this "QUICK" as using the statement mem_root + might result in too many allocations when combined with + dynamic range access where range optimizer is invoked many times + for a single statement. + */ + THD *thd= quick->head->in_use; + MEM_ROOT *saved_root= thd->mem_root; + thd->mem_root= &alloc; + error= quick->init_ror_merged_scan(false); + thd->mem_root= saved_root; + if (error) DBUG_RETURN(1); } scans_inited= TRUE; From 63fc08e24509725c708b86ea5c2f545ea68de331 Mon Sep 17 00:00:00 2001 From: Venkatesh Venugopal Date: Thu, 30 Aug 2018 19:20:41 +0530 Subject: [PATCH 016/214] Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP WHEN RELAY LOG INDEX IS LOCK Problem ------- When Relay log index file is locked by other process, server is unable to do any changes to the index file. Server treats this situation as fatal and executing intentional abort. Analysis & Fix -------------- Sometimes an outsider can lock index files for temporary viewing purpose. For eg: MEB locks binlog.index/relaylog.index to view the content of the file. During that small period of time, deletion/rename of the file is not possible on some platforms(Eg: Windows) Server should retry the delete operation for few times instead of panicking immediately. --- mysql-test/suite/binlog/r/binlog_index.result | 11 +++ mysql-test/suite/binlog/t/binlog_index.test | 30 ++++++++ sql/binlog.cc | 73 ++++++++++++++++++- sql/binlog.h | 3 +- 4 files changed, 113 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result index bc6313631b65..406f21d06ea1 100644 --- a/mysql-test/suite/binlog/r/binlog_index.result +++ b/mysql-test/suite/binlog/r/binlog_index.result @@ -383,6 +383,17 @@ master-bin.000020 # master-bin.000021 # master-bin.000022 # DROP TABLE t1; +SET SESSION debug=""; # Test case11: Ends +# Test case12: Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP +# WHEN RELAY LOG INDEX IS LOCK +# This test verifies that serveral retries are performed +# if there is a failure while deleting/renaming index files. +SET SESSION debug="+d,simulate_index_file_delete_failure"; +SET SESSION debug="+d,simulate_crash_safe_index_file_rename_failure"; +FLUSH LOGS; +include/assert_grep.inc [Retried for delete.] +include/assert_grep.inc [Retried for rename.] SET SESSION debug=""; +# Test case12: Ends End of tests diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test index 0274fcfde637..a9863e77d354 100644 --- a/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -471,7 +471,37 @@ SHOW BINARY LOGS; --source include/restart_mysqld.inc -- source include/show_binary_logs.inc DROP TABLE t1; +eval SET SESSION debug="$old"; -- echo # Test case11: Ends + +--echo # Test case12: Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP +--echo # WHEN RELAY LOG INDEX IS LOCK +--echo # This test verifies that serveral retries are performed +--echo # if there is a failure while deleting/renaming index files. + +--disable_warnings +SET SESSION debug="+d,simulate_index_file_delete_failure"; +SET SESSION debug="+d,simulate_crash_safe_index_file_rename_failure"; +FLUSH LOGS; + +# Check that delete retry is present in the error log +--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err +--let $assert_only_after = CURRENT_TEST: binlog.binlog_index +--let $assert_count = 5 +--let $assert_select = Retrying delete +--let $assert_text = Retried for delete. +--source include/assert_grep.inc + +# Check that rename retry is present in the error log +--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err +--let $assert_only_after = CURRENT_TEST: binlog.binlog_index +--let $assert_count = 5 +--let $assert_select = Retrying rename +--let $assert_text = Retried for rename. +--source include/assert_grep.inc +--enable_warnings eval SET SESSION debug="$old"; +--echo # Test case12: Ends + --echo End of tests diff --git a/sql/binlog.cc b/sql/binlog.cc index 68e0631547c9..a8e318c71ac2 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -3520,6 +3520,9 @@ int MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file(bool need_lock_index int error= 0; File fd= -1; DBUG_ENTER("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file"); + int failure_trials= MYSQL_BIN_LOG::MAX_RETRIES_FOR_DELETE_RENAME_FAILURE; + bool file_rename_status= false, file_delete_status= false; + THD *thd= current_thd; if (need_lock_index) mysql_mutex_lock(&LOCK_index); @@ -3543,8 +3546,41 @@ int MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file(bool need_lock_index goto recoverable_err; } - if (DBUG_EVALUATE_IF("force_index_file_delete_failure", 1, 0) || - mysql_file_delete(key_file_binlog_index, index_file_name, MYF(MY_WME))) + + /* + Sometimes an outsider can lock index files for temporary viewing + purpose. For eg: MEB locks binlog.index/relaylog.index to view + the content of the file. During that small period of time, deletion + of the file is not possible on some platforms(Eg: Windows) + Server should retry the delete operation for few times instead of panicking + immediately. + */ + while ((file_delete_status == false) && (failure_trials > 0)) + { + if (DBUG_EVALUATE_IF("force_index_file_delete_failure", 1, 0)) break; + + DBUG_EXECUTE_IF("simulate_index_file_delete_failure", + { + /* This simulation causes the delete to fail */ + static char first_char= index_file_name[0]; + index_file_name[0]= 0; + sql_print_information("Retrying delete"); + if (failure_trials == 1) + index_file_name[0]= first_char; + };); + file_delete_status = !(mysql_file_delete(key_file_binlog_index, + index_file_name, MYF(MY_WME))); + --failure_trials; + if (!file_delete_status) + { + my_sleep(1000); + /* Clear the error before retrying. */ + if (failure_trials > 0) + thd->clear_error(); + } + } + + if (!file_delete_status) { error= -1; sql_print_error("While rebuilding index file %s: " @@ -3563,7 +3599,38 @@ int MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file(bool need_lock_index } DBUG_EXECUTE_IF("crash_create_before_rename_index_file", DBUG_SUICIDE();); - if (my_rename(crash_safe_index_file_name, index_file_name, MYF(MY_WME))) + /* + Sometimes an outsider can lock index files for temporary viewing + purpose. For eg: MEB locks binlog.index/relaylog.index to view + the content of the file. During that small period of time, rename + of the file is not possible on some platforms(Eg: Windows) + Server should retry the rename operation for few times instead of panicking + immediately. + */ + failure_trials = MYSQL_BIN_LOG::MAX_RETRIES_FOR_DELETE_RENAME_FAILURE; + while ((file_rename_status == false) && (failure_trials > 0)) + { + DBUG_EXECUTE_IF("simulate_crash_safe_index_file_rename_failure", + { + /* This simulation causes the rename to fail */ + static char first_char= index_file_name[0]; + index_file_name[0]= 0; + sql_print_information("Retrying rename"); + if (failure_trials == 1) + index_file_name[0]= first_char; + };); + file_rename_status = + !(my_rename(crash_safe_index_file_name, index_file_name, MYF(MY_WME))); + --failure_trials; + if (!file_rename_status) + { + my_sleep(1000); + /* Clear the error before retrying. */ + if (failure_trials > 0) + thd->clear_error(); + } + } + if (!file_rename_status) { error= -1; sql_print_error("While rebuilding index file %s: " diff --git a/sql/binlog.h b/sql/binlog.h index 8fd103692289..5e50659a75ab 100644 --- a/sql/binlog.h +++ b/sql/binlog.h @@ -1,5 +1,5 @@ #ifndef BINLOG_H_INCLUDED -/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -679,6 +679,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);} inline IO_CACHE *get_index_file() { return &index_file;} inline uint32 get_open_count() { return open_count; } + static const int MAX_RETRIES_FOR_DELETE_RENAME_FAILURE = 5; }; typedef struct st_load_file_info From 8f2ca18489a74e21c9e280c5649d9b48fd466041 Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Thu, 30 Aug 2018 14:26:09 +0300 Subject: [PATCH 017/214] Fixed PS-4773 (Percona Server sources can't be compiled without server) https://jira.percona.com/browse/PS-4773 Fixed build regression introduced in the patch for PS-3937 "Some file operations in mf_iocache2.c are not instrumented" (https://jira.percona.com/browse/PS-3937) (commit b3f2aec) Partially cherry-picked Oracle's fix for Bug #18605389 "PROVIDE OPTION TO LINK AGAINST LIBCSTD INSTEAD OF STLPORT4 ON SOLARIS 10+" / Bug #69401 "Build error: Can't create output directory for sql/share/bulgarian" (https://bugs.mysql.com/bug.php?id=69401) / Bug #66000 "problem building client only" (https://bugs.mysql.com/bug.php?id=66000) (commit mysql/mysql-server@f24bba89834) --- CMakeLists.txt | 26 ++++++++++++++++++-------- mysys/mf_iocache2.c | 1 + 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c41189002be..86c5007db8d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,9 @@ OPTION(WITHOUT_SERVER OFF) IF(UNIX) OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF) ENDIF() -OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) +IF(NOT WITHOUT_SERVER) + OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) +ENDIF() MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED) OPTION(WITHOUT_RESPONSE_TIME_DISTRIBUTION "If we want to have response_time_distribution" OFF) @@ -459,26 +461,34 @@ IF(WITH_UNIT_TESTS) ENDIF() ADD_SUBDIRECTORY(extra) +ADD_SUBDIRECTORY(client) +ADD_SUBDIRECTORY(sql/share) +ADD_SUBDIRECTORY(libservices) + +IF(UNIX) + ADD_SUBDIRECTORY(man) +ENDIF() + IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(tests) - ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(sql) - ADD_SUBDIRECTORY(sql/share) - ADD_SUBDIRECTORY(libservices) OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF) IF(WITH_EMBEDDED_SERVER) ADD_SUBDIRECTORY(libmysqld) ADD_SUBDIRECTORY(libmysqld/examples) ENDIF(WITH_EMBEDDED_SERVER) +ENDIF() + +# scripts/mysql_config depends on client and server targets loaded above. +# It is referenced by some of the directories below, so we insert it here. + +ADD_SUBDIRECTORY(scripts) +IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(mysql-test) ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) ADD_SUBDIRECTORY(support-files) - ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(sql-bench) - IF(UNIX) - ADD_SUBDIRECTORY(man) - ENDIF() IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt) ADD_SUBDIRECTORY(internal) ENDIF() diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index b538f8b0abcf..058add647155 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -21,6 +21,7 @@ #include #include #include +#include "mysql/psi/mysql_file.h" /* Copy contents of an IO_CACHE to a file. From 9935037ced71f324f408bb579581b62ca1faa734 Mon Sep 17 00:00:00 2001 From: Shishir Jaiswal Date: Sat, 1 Sep 2018 23:53:17 +0530 Subject: [PATCH 018/214] Bug#27820277 - MYSQL SERVER CRASH WHILE SET PASSWORD DESCRIPTION =========== When a user is deleted from mysql.user which is followed by creating few users and finally SET PASSWORD is fired, it results in server exit. ANALYSIS ======== Each time we execute CREATE USER .., it pushes the user to in-memory acl_users list. When the size of the list equals the capacity, it mallocs a new buffer with twice the capacity, copies all the elements and frees the old buffer. This freed stale memory is returned by find_acl_user() during SET PASSWORD and later accessed in update_sctx_cache() resulting in the issue. replace_user_table() calls ha_index_read_idx_map(), which tells if or not a given user exists in mysql.user table. When SET PASSWORD is called, this func throws an error which signifies that the user is not in the mysql table (as it was deleted in the very 1st step) As of now we're not handling this error and proceeding. We can avoid the reported issue altogether if we handle the error and return from that point. FIX === Above condition is handled in replace_user_table(). Also that the call to this function is modified in change_password() and mysql_alter_user(). The parameter 'can_create_user' is passed as false instead of true so that its handled accordingly in the patch. --- sql/auth/sql_user.cc | 4 ++-- sql/auth/sql_user_table.cc | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sql/auth/sql_user.cc b/sql/auth/sql_user.cc index b64be4938707..c37627212143 100644 --- a/sql/auth/sql_user.cc +++ b/sql/auth/sql_user.cc @@ -790,7 +790,7 @@ bool change_password(THD *thd, const char *host, const char *user, goto end; } - ret= replace_user_table(thd, table, combo, 0, false, true, what_to_set); + ret= replace_user_table(thd, table, combo, 0, false, false, what_to_set); if (ret) { mysql_mutex_unlock(&acl_cache->lock); @@ -1934,7 +1934,7 @@ bool mysql_alter_user(THD *thd, List &list, bool if_exists) } /* update the mysql.user table */ - int ret= replace_user_table(thd, table, user_from, 0, false, true, + int ret= replace_user_table(thd, table, user_from, 0, false, false, what_to_alter); if (ret) { diff --git a/sql/auth/sql_user_table.cc b/sql/auth/sql_user_table.cc index fa56d3373a47..9c78b4bb1e36 100644 --- a/sql/auth/sql_user_table.cc +++ b/sql/auth/sql_user_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. @@ -939,9 +939,19 @@ int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo, optimize_plugin_compare_by_pointer(&combo->plugin); builtin_plugin= auth_plugin_is_built_in(combo->plugin.str); + /* The user record was neither present nor the intention was to create it */ if (!can_create_user) { - my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0)); + if(thd->lex->sql_command == SQLCOM_GRANT) + { + /* Have come here to GRANT privilege to the non-existing user */ + my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0)); + } + else if (update_password) + { + /* Have come here to update the password of the non-existing user */ + my_error(ER_PASSWORD_NO_MATCH, MYF(0), combo->user.str, combo->host.str); + } error= 1; goto end; } From cf24d6575b523a4bb251de683832e3a0186a1dc0 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Mon, 3 Sep 2018 17:08:47 +0200 Subject: [PATCH 019/214] Bug#28541029 PKGVER FAILED FOR WINDOWS X86-64BIT MSI PACKAGES - BOTH COMMUNITY AND COMMERCIAL Problem: Server 5.7 and 5.6 crash on msi uninstall due to missing dll reference. Wix 3.8 is used for building both server 5.6 and 5.7 msi when the packaging script has a reference to a custom action dll entry (WixQuietExec) only available in Wix 3.10 (and newer). Fix: Replaced WixQuietExec with CAQuietExec (available in wix 3.8 custom action dll). --- packaging/WiX/mysql_server.wxs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index ce1a4134a488..02b05ce1e5d7 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -170,7 +170,7 @@ - (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") AND (NOT MYSQL_INSTALLER="YES") From 4abbeb761b42a966962416ab75843d830a53526c Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Tue, 4 Sep 2018 10:05:49 +0200 Subject: [PATCH 020/214] From 4789962c2f451b9bc7e9a1c29598bdea144edc47 Mon Sep 17 00:00:00 2001 From: Piotr Obrzut Date: Mon, 3 Sep 2018 17:08:47 +0200 Subject: [PATCH 021/214] Bug#28541029 PKGVER FAILED FOR WINDOWS X86-64BIT MSI PACKAGES - BOTH COMMUNITY AND COMMERCIAL Problem: Server 5.7 and 5.6 crash on msi uninstall due to missing dll reference. Wix 3.8 is used for building both server 5.6 and 5.7 msi when the packaging script has a reference to a custom action dll entry (WixQuietExec) only available in Wix 3.10 (and newer). Fix: Replaced WixQuietExec with CAQuietExec (available in wix 3.8 custom action dll). (cherry picked from commit 57e71f991e9b59a6ca8ee0c6152e69982a935bf3) --- packaging/WiX/mysql_server.wxs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in index ce1a4134a488..02b05ce1e5d7 100644 --- a/packaging/WiX/mysql_server.wxs.in +++ b/packaging/WiX/mysql_server.wxs.in @@ -170,7 +170,7 @@ - (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") AND (NOT MYSQL_INSTALLER="YES") From d3b0f81b83a4f75495f4c88ebfdf8b10866bf828 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Mon, 10 Sep 2018 16:00:29 +0530 Subject: [PATCH 022/214] Bug #28178776 COMPARISON OF UNINITAILIZED MEMORY IN LOG_IN_USE PROBLEM ------- Memory sanitizer reports uninitialized comparisons in log_in_use(), because strings are compared with memcmp() instead of strncmp. FIX --- Use strncmp() to compare strings --- sql/log.cc | 4 ++-- sql/sql_repl.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 493aae8f2ff1..28c38bf442fd 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3407,7 +3407,7 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, // if the log entry matches, null string matching anything if (!log_name || (log_name_len == fname_len-1 && full_fname[log_name_len] == '\n' && - !memcmp(full_fname, full_log_name, log_name_len))) + !strncmp(full_fname, full_log_name, log_name_len))) { DBUG_PRINT("info", ("Found log file entry")); full_fname[fname_len-1]= 0; // remove last \n diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index ecbeff87a616..c6ffef67b3b1 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -261,7 +261,7 @@ bool log_in_use(const char* log_name) if ((linfo = tmp->current_linfo)) { mysql_mutex_lock(&linfo->lock); - result = !memcmp(log_name, linfo->log_file_name, log_name_len); + result = !strncmp(log_name, linfo->log_file_name, log_name_len); mysql_mutex_unlock(&linfo->lock); if (result) break; From b11fd1ff5b8310d5afae4e00472f359c18828585 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Fri, 14 Sep 2018 13:56:12 +0200 Subject: [PATCH 023/214] From 8299cbcab08c6c7978975c10277ac36c89a3cd59 Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Mon, 17 Sep 2018 09:11:51 -0700 Subject: [PATCH 024/214] PS-4747 : Port TokuDB Hot Backup plugin to 8.0 - Advance git submodule commit pointer. - This will be cherry-picked forward to 5.7 --- plugin/tokudb-backup-plugin/Percona-TokuBackup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/tokudb-backup-plugin/Percona-TokuBackup b/plugin/tokudb-backup-plugin/Percona-TokuBackup index f6718bd6f2e7..6145bfd4920d 160000 --- a/plugin/tokudb-backup-plugin/Percona-TokuBackup +++ b/plugin/tokudb-backup-plugin/Percona-TokuBackup @@ -1 +1 @@ -Subproject commit f6718bd6f2e7223512eceede3486da030a6ce146 +Subproject commit 6145bfd4920d2c139ed75a189bd44ce5628696c3 From 9499337a80316c3d52bb2b2a164f73abb434e919 Mon Sep 17 00:00:00 2001 From: Sachin Agarwal Date: Wed, 19 Sep 2018 16:14:48 +0530 Subject: [PATCH 025/214] Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES Post push fix. Adding missing deep copy of virtual data fields for node->row. Disable test-case (ASAN failure: bug #28556793) --- .../suite/innodb/r/virtual_index.result | 36 ----------- mysql-test/suite/innodb/t/virtual_index.test | 61 ++++++++++--------- storage/innobase/row/row0upd.cc | 1 + 3 files changed, 34 insertions(+), 64 deletions(-) diff --git a/mysql-test/suite/innodb/r/virtual_index.result b/mysql-test/suite/innodb/r/virtual_index.result index 6269163bacaf..b08cecdcef81 100644 --- a/mysql-test/suite/innodb/r/virtual_index.result +++ b/mysql-test/suite/innodb/r/virtual_index.result @@ -211,39 +211,3 @@ t1 CREATE TABLE `t1` ( KEY `n` (`col2`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DROP TABLE t1; -# -# Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES -SET sql_mode=''; -Warnings: -Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. -CREATE TABLE t1( -a INT not null, -b CHAR(4) not null, -c TEXT GENERATED ALWAYS AS ((a <> b)) VIRTUAL, -UNIQUE KEY i1 (a), -UNIQUE KEY i2 (c(1)) -) ENGINE=INNODB; -insert into t1 set a=1; -Warnings: -Warning 1364 Field 'b' doesn't have a default value -insert into t1 set a=0; -Warnings: -Warning 1364 Field 'b' doesn't have a default value -replace into t1 set b ='1'; -Warnings: -Warning 1364 Field 'a' doesn't have a default value -DROP TABLE t1; -SET names utf8; -CREATE TABLE t1 ( -a VARCHAR(1000) GENERATED ALWAYS AS ('1') VIRTUAL, -b VARCHAR(1000) NOT NULL, -c VARCHAR(1000) GENERATED ALWAYS AS (b) STORED NOT NULL, -KEY (b(1)), -KEY (a(1)) -) ENGINE=INNODB -ROW_FORMAT=COMPRESSED -KEY_BLOCK_SIZE=1; -INSERT INTO t1(b) VALUES(REPEAT('a',947)); -DELETE FROM t1; -DROP TABLE t1; -SET sql_mode = default; diff --git a/mysql-test/suite/innodb/t/virtual_index.test b/mysql-test/suite/innodb/t/virtual_index.test index d43f016882c6..1faba4ba5db4 100644 --- a/mysql-test/suite/innodb/t/virtual_index.test +++ b/mysql-test/suite/innodb/t/virtual_index.test @@ -229,32 +229,37 @@ SHOW CREATE TABLE t1; DROP TABLE t1; ---echo # ---echo # Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES -SET sql_mode=''; -CREATE TABLE t1( - a INT not null, - b CHAR(4) not null, - c TEXT GENERATED ALWAYS AS ((a <> b)) VIRTUAL, - UNIQUE KEY i1 (a), - UNIQUE KEY i2 (c(1)) -) ENGINE=INNODB; -insert into t1 set a=1; -insert into t1 set a=0; -replace into t1 set b ='1'; -DROP TABLE t1; +#Disable the test case because it's being failed on ASAN. +#TODO : Bug #28556793 INNODB UPDATE_ROW ASAN FAILURE HEAP-USE-AFTER-FREE +if (0) +{ + --echo # + --echo # Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES + SET sql_mode=''; + CREATE TABLE t1( + a INT not null, + b CHAR(4) not null, + c TEXT GENERATED ALWAYS AS ((a <> b)) VIRTUAL, + UNIQUE KEY i1 (a), + UNIQUE KEY i2 (c(1)) + ) ENGINE=INNODB; + insert into t1 set a=1; + insert into t1 set a=0; + replace into t1 set b ='1'; + DROP TABLE t1; -SET names utf8; -CREATE TABLE t1 ( - a VARCHAR(1000) GENERATED ALWAYS AS ('1') VIRTUAL, - b VARCHAR(1000) NOT NULL, - c VARCHAR(1000) GENERATED ALWAYS AS (b) STORED NOT NULL, - KEY (b(1)), - KEY (a(1)) -) ENGINE=INNODB -ROW_FORMAT=COMPRESSED -KEY_BLOCK_SIZE=1; -INSERT INTO t1(b) VALUES(REPEAT('a',947)); -DELETE FROM t1; -DROP TABLE t1; -SET sql_mode = default; + SET names utf8; + CREATE TABLE t1 ( + a VARCHAR(1000) GENERATED ALWAYS AS ('1') VIRTUAL, + b VARCHAR(1000) NOT NULL, + c VARCHAR(1000) GENERATED ALWAYS AS (b) STORED NOT NULL, + KEY (b(1)), + KEY (a(1)) + ) ENGINE=INNODB + ROW_FORMAT=COMPRESSED + KEY_BLOCK_SIZE=1; + INSERT INTO t1(b) VALUES(REPEAT('a',947)); + DELETE FROM t1; + DROP TABLE t1; + SET sql_mode = default; +} diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 0d698f1badc3..4d9b590301b6 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -1980,6 +1980,7 @@ row_upd_store_v_row( } dfield_copy_data(dfield, upd_field->old_v_val); + dfield_dup(dfield, node->heap); break; } From c5419a671df94856f3ad007276e8f9c54e63a3f8 Mon Sep 17 00:00:00 2001 From: Alexey Bychko Date: Thu, 20 Sep 2018 12:51:03 +0700 Subject: [PATCH 026/214] PS-4854 Percona Server for MySQL tarball without AGPLv3 dependency/license --- build-ps/build-binary.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build-ps/build-binary.sh b/build-ps/build-binary.sh index 867c35ae73c8..0f4df7115bc8 100755 --- a/build-ps/build-binary.sh +++ b/build-ps/build-binary.sh @@ -108,7 +108,7 @@ done if test "$#" -eq 0 then WORKDIR="$(pwd)" - + # Check that the current directory is not empty if test "x$(echo *)" != "x*" then @@ -185,7 +185,7 @@ fi if test -d "$SOURCEDIR/storage/tokudb" then CMAKE_OPTS="${CMAKE_OPTS:-} -DBUILD_TESTING=OFF -DUSE_GTAGS=OFF -DUSE_CTAGS=OFF -DUSE_ETAGS=OFF -DUSE_CSCOPE=OFF -DTOKUDB_BACKUP_PLUGIN_VERSION=${TOKUDB_BACKUP_VERSION}" - + if test "x$CMAKE_BUILD_TYPE" != "xDebug" then CMAKE_OPTS="${CMAKE_OPTS:-} -DTOKU_DEBUG_PARANOID=OFF" @@ -233,7 +233,7 @@ then echo >&2 "Jemalloc dir $WITH_JEMALLOC does not exist" exit 1 fi - + JEMALLOCDIR="$(cd "$WITH_JEMALLOC"; pwd)" fi @@ -241,7 +241,7 @@ fi # Build ( cd "$SOURCEDIR" - + cmake . ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \ $DEBUG_EXTRA \ @@ -286,7 +286,8 @@ fi # Package the archive ( cd "$INSTALLDIR/usr/local/" - + #PS-4854 Percona Server for MySQL tarball without AGPLv3 dependency/license + find $PRODUCT_FULL -type f -name 'COPYING.AGPLv3' -delete $TAR --owner=0 --group=0 -czf "$WORKDIR_ABS/$PRODUCT_FULL.tar.gz" $PRODUCT_FULL ) From 9537c7d2b61295a05a1b2978ba520e673d778077 Mon Sep 17 00:00:00 2001 From: Venkatesh Venugopal Date: Fri, 21 Sep 2018 12:44:21 +0530 Subject: [PATCH 027/214] Bug #28284624 `PURGE BINARY LOGS TO` FAILS WHEN BINARY LOG SPECIFIED IS NOT IN BINLOG BASE DIR Problem ------- `PURGE BINARY LOGS TO` fails if binary log is not present in the data directory. Analysis -------- When the binary logs are being moved to another location by mysqlbinlogmove, the index file is also updated with the absolute paths of the binary logs. When the server is executing `PURGE BINARY LOGS TO` command, it ends up in comparing the relative path of the 'to_log' against the absolute path in the index file instead of comparing the basenames of the files. Fix --- Added a wrapper function to compare the log names. --- .../r/binlog_purge_binary_logs_to.result | 12 +++ .../binlog/t/binlog_purge_binary_logs_to.test | 98 +++++++++++++++++++ sql/binlog.cc | 17 ++-- 3 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_purge_binary_logs_to.result create mode 100644 mysql-test/suite/binlog/t/binlog_purge_binary_logs_to.test diff --git a/mysql-test/suite/binlog/r/binlog_purge_binary_logs_to.result b/mysql-test/suite/binlog/r/binlog_purge_binary_logs_to.result new file mode 100644 index 000000000000..4b3db91c6764 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_purge_binary_logs_to.result @@ -0,0 +1,12 @@ +RESET MASTER; +# Generate master-bin.000002 +FLUSH BINARY LOGS; +# Generate master-bin.000003 +FLUSH BINARY LOGS; +# Generate master-bin.000004 +FLUSH BINARY LOGS; +# Generate master-bin.000005 +FLUSH BINARY LOGS; +FLUSH BINARY LOGS; +PURGE BINARY LOGS TO 'master-bin.000003'; +PURGE BINARY LOGS TO 'master-bin.000005'; diff --git a/mysql-test/suite/binlog/t/binlog_purge_binary_logs_to.test b/mysql-test/suite/binlog/t/binlog_purge_binary_logs_to.test new file mode 100644 index 000000000000..f4b23b39c2d3 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_purge_binary_logs_to.test @@ -0,0 +1,98 @@ +# === Purpose === +# +# This test verifies that `PURGE BINARY LOGS TO` purges the binlog files +# that have been moved to another location and their absolute path is +# listed in the binlog index file. +# +# === Implementation === +# +# 1. Generate binary logs. +# 2. Move the binary logs to the tmp dir. +# 3. Generate a new index file having the absolute path of the binlogs. +# 4. Verify that `PURGE BINARY LOGS TO` purges the binlogs which are +# not in the data directory. +# +# === References === +# Bug #28284624 `PURGE BINARY LOGS TO` FAILS WHEN BINARY LOG SPECIFIED +# IS NOT IN BINLOG BASE DIR + +--source include/have_log_bin.inc +# This test case is binlog_format agnostic +--source include/have_binlog_format_row.inc + +RESET MASTER; + +--let $MYSQLD_DATADIR= `select @@datadir` +--let $INDEX=$MYSQLD_DATADIR/master-bin.index + +--let $binlog_file1= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Generate master-bin.000002 +FLUSH BINARY LOGS; +--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Generate master-bin.000003 +FLUSH BINARY LOGS; +--let $binlog_file3= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Generate master-bin.000004 +FLUSH BINARY LOGS; +--let $binlog_file4= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Generate master-bin.000005 +FLUSH BINARY LOGS; +--let $binlog_file5= query_get_value(SHOW MASTER STATUS, File, 1) + +# Move the binary logs to var/tmp/ directory + +--move_file $MYSQLD_DATADIR/$binlog_file1 $MYSQLTEST_VARDIR/tmp/$binlog_file1 +--move_file $MYSQLD_DATADIR/$binlog_file2 $MYSQLTEST_VARDIR/tmp/$binlog_file2 +--move_file $MYSQLD_DATADIR/$binlog_file3 $MYSQLTEST_VARDIR/tmp/$binlog_file3 +--move_file $MYSQLD_DATADIR/$binlog_file4 $MYSQLTEST_VARDIR/tmp/$binlog_file4 + +# Generate a new index file having the absolute path of the binlogs +--exec echo $MYSQLTEST_VARDIR/tmp/$binlog_file1 > $MYSQLD_DATADIR/master-bin.index.tmp +--exec echo $MYSQLTEST_VARDIR/tmp/$binlog_file2 >> $MYSQLD_DATADIR/master-bin.index.tmp +--exec echo $MYSQLTEST_VARDIR/tmp/$binlog_file3 >> $MYSQLD_DATADIR/master-bin.index.tmp +--exec echo $MYSQLTEST_VARDIR/tmp/$binlog_file4 >> $MYSQLD_DATADIR/master-bin.index.tmp +--exec echo ./$binlog_file5 >> $MYSQLD_DATADIR/master-bin.index.tmp + +# Since the binlog index file has been opened by server, deleting/renaming +# the index file will fail in Windows. So, shutdown the server, move the file +# and restart the server. + +# Stop the server +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +--remove_file $INDEX +--move_file $MYSQLD_DATADIR/master-bin.index.tmp $INDEX + +# Restart the server +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Flush the binary log so that the index file is reopened. +FLUSH BINARY LOGS; + +# Purge the first two binary logs +--eval PURGE BINARY LOGS TO '$binlog_file3' + +# Verify that the purged binlogs do not exist. +--let $file_does_not_exist= $MYSQLTEST_VARDIR/tmp/$binlog_file1 +--source include/file_does_not_exist.inc + +--let $file_does_not_exist= $MYSQLTEST_VARDIR/tmp/$binlog_file2 +--source include/file_does_not_exist.inc + +# Purge the next two binary logs +--eval PURGE BINARY LOGS TO '$binlog_file5' + +# Verify that the purged binlogs do not exist. +--let $file_does_not_exist= $MYSQLTEST_VARDIR/tmp/$binlog_file3 +--source include/file_does_not_exist.inc + +--let $file_does_not_exist= $MYSQLTEST_VARDIR/tmp/$binlog_file4 +--source include/file_does_not_exist.inc diff --git a/sql/binlog.cc b/sql/binlog.cc index 2c7724ce6596..cf5fca2b2eec 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -5573,6 +5573,14 @@ void MYSQL_BIN_LOG::set_write_error(THD *thd, bool is_transactional) DBUG_VOID_RETURN; } +static int compare_log_name(const char* log_1, const char* log_2) +{ + const char * log_1_basename= log_1 + dirname_length(log_1); + const char * log_2_basename= log_2 + dirname_length(log_2); + + return strcmp(log_1_basename,log_2_basename); +} + /** Find the position in the log-index-file for the given log name. @@ -5601,7 +5609,6 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, int error= 0; char *full_fname= linfo->log_file_name; char full_log_name[FN_REFLEN], fname[FN_REFLEN]; - size_t log_name_len= 0, fname_len= 0; DBUG_ENTER("find_log_pos"); full_log_name[0]= full_fname[0]= 0; @@ -5630,7 +5637,6 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, } } - log_name_len= log_name ? strlen(full_log_name) : 0; DBUG_PRINT("enter", ("log_name: %s, full_log_name: %s", log_name ? log_name : "NULL", full_log_name)); @@ -5658,12 +5664,9 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, error= LOG_INFO_EOF; break; } - fname_len= strlen(full_fname); - // if the log entry matches, null string matching anything if (!log_name || - (log_name_len == fname_len && - !strncmp(full_fname, full_log_name, log_name_len))) + !compare_log_name(full_fname,full_log_name)) { DBUG_PRINT("info", ("Found log file entry")); linfo->index_file_start_offset= offset; @@ -6310,7 +6313,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, if ((error=find_log_pos(&log_info, NullS, false/*need_lock_index=false*/))) goto err; - while ((strcmp(to_log,log_info.log_file_name) || (exit_loop=included))) + while ((compare_log_name(to_log,log_info.log_file_name) || (exit_loop=included))) { if(is_active(log_info.log_file_name)) { From d4927def688ae6a2828b43a906a1f83c9adb01a1 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 21 Sep 2018 12:50:01 +0200 Subject: [PATCH 028/214] Bug#28616194: ASAN SHOWS ODR FOR GROUP_REPLICATION_PLUGIN_NAME VARIABLE IN MYSQL-5.7 Some test where failing as too variables had the same name in the source code. One of them was renamed. --- sql/rpl_group_replication.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sql/rpl_group_replication.cc b/sql/rpl_group_replication.cc index b87e3bd23e28..0f11ffaf348c 100644 --- a/sql/rpl_group_replication.cc +++ b/sql/rpl_group_replication.cc @@ -26,7 +26,7 @@ /** Static name of Group Replication plugin. */ -LEX_CSTRING group_replication_plugin_name= { +LEX_CSTRING group_replication_plugin_name_str= { C_STRING_WITH_LEN("group_replication") }; @@ -47,7 +47,7 @@ bool is_group_replication_plugin_loaded() bool result= false; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -63,7 +63,7 @@ int group_replication_start() int result= 1; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -101,7 +101,7 @@ int group_replication_stop() int result= 1; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -124,7 +124,7 @@ bool is_group_replication_running() bool result= false; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -143,7 +143,7 @@ int set_group_replication_retrieved_certification_info(View_change_log_event *vi int result= 1; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -163,7 +163,7 @@ bool get_group_replication_connection_status_info( bool result= true; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -184,7 +184,7 @@ bool get_group_replication_group_members_info( bool result= true; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -204,7 +204,7 @@ bool get_group_replication_group_member_stats_info( bool result= true; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { @@ -223,7 +223,7 @@ unsigned int get_group_replication_members_number_info() unsigned int result= 0; plugin_ref plugin= my_plugin_lock_by_name(0, - group_replication_plugin_name, + group_replication_plugin_name_str, MYSQL_GROUP_REPLICATION_PLUGIN); if (plugin != NULL) { From 38a6d1d082fe09d94e45540a56cbecbd115ae7df Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Mon, 24 Sep 2018 20:16:47 +0530 Subject: [PATCH 029/214] Bug#28511326: DEADLOCK DURING PURGE_LOGS_BEFORE_DATE Problem: ======= Access to the following variables is protected by LOCK_log. binlog-transaction-dependency-tracking binlog-transaction-dependency-history-size 'LOCK_log' is held when these variables are being set or read. Holding 'LOCK_log' results in following Deadlock scenario. Analysis: ========= 1) SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE 'binlog_transaction_dependency_tracking'; The above query acquires a lock on thread data and tries to read the values of 'binlog_transaction_dependency_tracking'. Inorder to read this variable 'LOCK_log' is required. Owns: THD::LOCK_thd_data (acquired in PFS_system_variable_cache::do_materialize_all ->PFS_variable_cache::get_THD -> Find_THD_variable::operator()) Waits for: MYSQL_BIN_LOG::LOCK_log 2) SHOW BINARY LOGS Above command acquires 'LOCK_log' to read current active binary log specific information and then goes on to acquire LOCK_index, so that it can list the rest of binary logs. Owns: MYSQL_BIN_LOG::LOCK_log (acquired in show_binlogs()) Waits for: MYSQL_BIN_LOG::LOCK_index 3) PURGE LOGS BEFORE date Above command acquires 'LOCK_index' and reads one log at a time from index. For each log it tries to identify how many threads are accessing this log. Inorder to do this it acquires a lock on global thread list and iterates through the entire thread list. For each thread it tries to acquire LOCK_thd_data and verify if the log is being used by the tread or not. Hence it waits for the lock. Owns: MYSQL_BIN_LOG::LOCK_index (acquired in MYSQL_BIN_LOG::purge_logs_before_date) Waits for: THD::LOCK_thd_data Fix: === Transaction dependency tracking information is updated based on 'max_committed_transaction' object contents. 'max_committed_transaction' holds the transaction sequence_number. This transaction_sequence number is updated during the flush stage of the commit and it is used to update the transaction dependency tracking through 'update_max_committed' function call. 'LOCK_log' needs to be held when the active binary log is being modified. Where as to protect concurrent access to set or read dependency tracking information a less granular lock should be sufficient. Hence a new lock named 'LOCK_slave_trans_dep_tracker' has been introduced to protect concurrent access to transaction dependency tracking information. --- ...inlog_set_trans_dependency_deadlock.result | 33 +++++++ .../binlog_set_trans_dependency_deadlock.test | 94 +++++++++++++++++++ sql/binlog.cc | 8 ++ sql/mysqld.cc | 6 ++ sql/mysqld.h | 2 + sql/rpl_trx_tracking.cc | 1 + sql/sys_vars.cc | 23 +---- storage/perfschema/pfs_variable.cc | 3 +- 8 files changed, 151 insertions(+), 19 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result create mode 100644 mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test diff --git a/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result b/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result new file mode 100644 index 000000000000..0f823862e226 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result @@ -0,0 +1,33 @@ +# +# Bug 92108: Deadlock by concurrent SHOW BINLOGS, +# performance_schema.session_variables query, and binlog purge +# +RESET MASTER; +FLUSH LOGS; +connect con1,localhost,root,,; +SET DEBUG_SYNC="purge_logs_after_lock_index_before_thread_count SIGNAL purge_ready WAIT_FOR finish_purge"; +connect con2,localhost,root,,; +SET DEBUG_SYNC="materialize_session_variable_array_THD_locked SIGNAL pfs_ready WAIT_FOR finish_pfs"; +SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE 'binlog_transaction_dependency_tracking';; +connect con3,localhost,root,,; +SET DEBUG_SYNC="show_binlogs_after_lock_log_before_lock_index SIGNAL show_ready WAIT_FOR finish_show"; +SHOW BINARY LOGS; +connection default; +SET DEBUG_SYNC="now WAIT_FOR purge_ready"; +SET DEBUG_SYNC="now WAIT_FOR pfs_ready"; +SET DEBUG_SYNC="now WAIT_FOR show_ready"; +SET DEBUG_SYNC="now SIGNAL finish_purge"; +SET DEBUG_SYNC="now SIGNAL finish_pfs"; +SET DEBUG_SYNC="now SIGNAL finish_show"; +connection con1; +Warnings: +Warning 1868 file master-bin.000002 was not purged because it is the active log file. +disconnect con1; +connection con2; +VARIABLE_NAME VARIABLE_VALUE +binlog_transaction_dependency_tracking COMMIT_ORDER +disconnect con2; +connection con3; +disconnect con3; +connection default; +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test b/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test new file mode 100644 index 000000000000..25ce10d4c177 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test @@ -0,0 +1,94 @@ +# ==== Purpose ==== +# +# Test verifies that there is no deadlock when following commands are executed +# in parallel. +# +# SHOW BINARY LOGS +# +# SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE +# 'binlog_transaction_dependency_tracking' +# +# PURGE BINARY LOGS BEFORE $date; +# +# ==== Implementation ==== +# +# With the help of DEBUG_SYNC operations simulate the deadlock environment. +# +# 1) PURGE LOGS BEFORE date +# Owns: MYSQL_BIN_LOG::LOCK_index +# Waits for: THD::LOCK_thd_data +# +# 2) select query on performance_schema.session_variables table +# Owns: THD::LOCK_thd_data +# Waits for: MYSQL_BIN_LOG::LOCK_log +# +# 3) SHOW BINARY LOGS +# Owns: MYSQL_BIN_LOG::LOCK_log +# Waits for: MYSQL_BIN_LOG::LOCK_index +# +# ==== References ==== +# +# Bug#28511326: DEADLOCK DURING PURGE_LOGS_BEFORE_DATE + +--source include/have_debug_sync.inc +--source include/have_log_bin.inc +--source include/have_perfschema.inc + +--echo # +--echo # Bug 92108: Deadlock by concurrent SHOW BINLOGS, +--echo # performance_schema.session_variables query, and binlog purge +--echo # + +RESET MASTER; +FLUSH LOGS; +--enable_connect_log +--connect(con1,localhost,root,,) + +SET DEBUG_SYNC="purge_logs_after_lock_index_before_thread_count SIGNAL purge_ready WAIT_FOR finish_purge"; + +let $date=`SELECT CURDATE() + 1`; +--disable_query_log +--send_eval PURGE BINARY LOGS BEFORE $date; +--enable_query_log + +--connect(con2,localhost,root,,) + +SET DEBUG_SYNC="materialize_session_variable_array_THD_locked SIGNAL pfs_ready WAIT_FOR finish_pfs"; + +--send SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE 'binlog_transaction_dependency_tracking'; + +--connect(con3,localhost,root,,) + +SET DEBUG_SYNC="show_binlogs_after_lock_log_before_lock_index SIGNAL show_ready WAIT_FOR finish_show"; + +--send SHOW BINARY LOGS + +--connection default + +SET DEBUG_SYNC="now WAIT_FOR purge_ready"; +SET DEBUG_SYNC="now WAIT_FOR pfs_ready"; +SET DEBUG_SYNC="now WAIT_FOR show_ready"; + +SET DEBUG_SYNC="now SIGNAL finish_purge"; +SET DEBUG_SYNC="now SIGNAL finish_pfs"; +SET DEBUG_SYNC="now SIGNAL finish_show"; + +--connection con1 +replace_regex /\.[\\\/]master/master/; +reap; +--disconnect con1 + +--connection con2 +reap; +--disconnect con2 + +--connection con3 +--disable_result_log +reap; +--enable_result_log +--disconnect con3 + +--connection default + +SET DEBUG_SYNC= 'RESET'; +--disable_connect_log diff --git a/sql/binlog.cc b/sql/binlog.cc index cf5fca2b2eec..3443bc348ab9 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -8958,7 +8958,11 @@ MYSQL_BIN_LOG::process_commit_stage_queue(THD *thd, THD *first) stage_manager.clear_preempt_status(head); #endif if (head->get_transaction()->sequence_number != SEQ_UNINIT) + { + mysql_mutex_lock(&LOCK_slave_trans_dep_tracker); m_dependency_tracker.update_max_committed(head); + mysql_mutex_unlock(&LOCK_slave_trans_dep_tracker); + } /* Flush/Sync error should be ignored and continue to commit phase. And thd->commit_error cannot be @@ -9215,7 +9219,11 @@ MYSQL_BIN_LOG::finish_commit(THD *thd) cache_mngr->reset(); } if (thd->get_transaction()->sequence_number != SEQ_UNINIT) + { + mysql_mutex_lock(&LOCK_slave_trans_dep_tracker); m_dependency_tracker.update_max_committed(thd); + mysql_mutex_unlock(&LOCK_slave_trans_dep_tracker); + } if (thd->get_transaction()->m_flags.commit_low) { const bool all= thd->get_transaction()->m_flags.real_commit; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 429024209568..2eb5a43a9f17 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -672,6 +672,7 @@ mysql_mutex_t LOCK_prepared_stmt_count; */ mysql_mutex_t LOCK_sql_slave_skip_counter; mysql_mutex_t LOCK_slave_net_timeout; +mysql_mutex_t LOCK_slave_trans_dep_tracker; mysql_mutex_t LOCK_log_throttle_qni; mysql_mutex_t LOCK_offline_mode; #ifdef HAVE_OPENSSL @@ -1433,6 +1434,7 @@ static void clean_up_mutexes() mysql_mutex_destroy(&LOCK_prepared_stmt_count); mysql_mutex_destroy(&LOCK_sql_slave_skip_counter); mysql_mutex_destroy(&LOCK_slave_net_timeout); + mysql_mutex_destroy(&LOCK_slave_trans_dep_tracker); mysql_mutex_destroy(&LOCK_error_messages); mysql_mutex_destroy(&LOCK_offline_mode); mysql_mutex_destroy(&LOCK_default_password_lifetime); @@ -3206,6 +3208,8 @@ static int init_thread_environment() &LOCK_sql_slave_skip_counter, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_slave_net_timeout, &LOCK_slave_net_timeout, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_slave_trans_dep_tracker, + &LOCK_slave_trans_dep_tracker, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_error_messages, &LOCK_error_messages, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_uuid_generator, @@ -8675,6 +8679,7 @@ PSI_mutex_key key_LOCK_server_started, key_LOCK_status, key_LOCK_sql_slave_skip_counter, key_LOCK_slave_net_timeout, + key_LOCK_slave_trans_dep_tracker, key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data, key_LOCK_thd_sysvar, key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log, @@ -8755,6 +8760,7 @@ static PSI_mutex_info all_server_mutexes[]= { &key_LOCK_prepared_stmt_count, "LOCK_prepared_stmt_count", PSI_FLAG_GLOBAL}, { &key_LOCK_sql_slave_skip_counter, "LOCK_sql_slave_skip_counter", PSI_FLAG_GLOBAL}, { &key_LOCK_slave_net_timeout, "LOCK_slave_net_timeout", PSI_FLAG_GLOBAL}, + { &key_LOCK_slave_trans_dep_tracker, "LOCK_slave_trans_dep_tracker", PSI_FLAG_GLOBAL}, { &key_LOCK_server_started, "LOCK_server_started", PSI_FLAG_GLOBAL}, { &key_LOCK_keyring_operations, "LOCK_keyring_operations", PSI_FLAG_GLOBAL}, #if !defined(EMBEDDED_LIBRARY) && !defined(_WIN32) diff --git a/sql/mysqld.h b/sql/mysqld.h index ce92da197b41..d7f70057e21a 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -414,6 +414,7 @@ extern PSI_mutex_key key_LOCK_server_started, key_LOCK_status, key_LOCK_sql_slave_skip_counter, key_LOCK_slave_net_timeout, + key_LOCK_slave_trans_dep_tracker, key_LOCK_table_share, key_LOCK_thd_data, key_LOCK_thd_sysvar, key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log, key_master_info_data_lock, key_master_info_run_lock, @@ -823,6 +824,7 @@ extern mysql_mutex_t LOCK_global_system_variables, LOCK_user_conn, LOCK_log_throttle_qni, LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_sql_slave_skip_counter, LOCK_slave_net_timeout, + LOCK_slave_trans_dep_tracker, LOCK_offline_mode, LOCK_default_password_lifetime; #ifdef HAVE_OPENSSL extern char* des_key_file; diff --git a/sql/rpl_trx_tracking.cc b/sql/rpl_trx_tracking.cc index 673776be5cd9..4a615491698e 100644 --- a/sql/rpl_trx_tracking.cc +++ b/sql/rpl_trx_tracking.cc @@ -154,6 +154,7 @@ Commit_order_trx_dependency_tracker::rotate() void Commit_order_trx_dependency_tracker::update_max_committed(int64 sequence_number) { + mysql_mutex_assert_owner(&LOCK_slave_trans_dep_tracker); m_max_committed_transaction.set_if_greater(sequence_number); } diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 9960323f96af..ea3a3a0f5472 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3585,22 +3585,8 @@ static bool update_binlog_transaction_dependency_tracking(sys_var* var, THD* thd return false; } -void PolyLock_lock_log::rdlock() -{ - mysql_mutex_lock(mysql_bin_log.get_log_lock()); -} - -void PolyLock_lock_log::wrlock() -{ - mysql_mutex_lock(mysql_bin_log.get_log_lock()); -} - -void PolyLock_lock_log::unlock() -{ - mysql_mutex_unlock(mysql_bin_log.get_log_lock()); -} - -static PolyLock_lock_log PLock_log; +static PolyLock_mutex +PLock_slave_trans_dep_tracker(&LOCK_slave_trans_dep_tracker); static const char *opt_binlog_transaction_dependency_tracking_names[]= {"COMMIT_ORDER", "WRITESET", "WRITESET_SESSION", NullS}; static Sys_var_enum Binlog_transaction_dependency_tracking( @@ -3611,7 +3597,8 @@ static Sys_var_enum Binlog_transaction_dependency_tracking( "Possible values are COMMIT_ORDER, WRITESET and WRITESET_SESSION.", GLOBAL_VAR(mysql_bin_log.m_dependency_tracker.m_opt_tracking_mode), CMD_LINE(REQUIRED_ARG), opt_binlog_transaction_dependency_tracking_names, - DEFAULT(DEPENDENCY_TRACKING_COMMIT_ORDER), &PLock_log, + DEFAULT(DEPENDENCY_TRACKING_COMMIT_ORDER), + &PLock_slave_trans_dep_tracker, NOT_IN_BINLOG, ON_CHECK(check_binlog_transaction_dependency_tracking), ON_UPDATE(update_binlog_transaction_dependency_tracking)); static Sys_var_ulong Binlog_transaction_dependency_history_size( @@ -3619,7 +3606,7 @@ static Sys_var_ulong Binlog_transaction_dependency_history_size( "Maximum number of rows to keep in the writeset history.", GLOBAL_VAR(mysql_bin_log.m_dependency_tracker.get_writeset()->m_opt_max_history_size), CMD_LINE(REQUIRED_ARG, 0), VALID_RANGE(1, 1000000), DEFAULT(25000), - BLOCK_SIZE(1), &PLock_log, NOT_IN_BINLOG, ON_CHECK(NULL), + BLOCK_SIZE(1), &PLock_slave_trans_dep_tracker, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL)); static Sys_var_mybool Sys_slave_preserve_commit_order( diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc index 397377b2f0c5..e07f3be1631a 100644 --- a/storage/perfschema/pfs_variable.cc +++ b/storage/perfschema/pfs_variable.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -195,6 +195,7 @@ int PFS_system_variable_cache::do_materialize_all(THD *unsafe_thd) /* Get and lock a validated THD from the thread manager. */ if ((m_safe_thd= get_THD(unsafe_thd)) != NULL) { + DEBUG_SYNC(m_current_thd, "materialize_session_variable_array_THD_locked"); for (Show_var_array::iterator show_var= m_show_var_array.begin(); show_var->value && (show_var != m_show_var_array.end()); show_var++) { From f10467d7fc75e2979239f3503eae3288300ab149 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Tue, 25 Sep 2018 10:01:37 +0200 Subject: [PATCH 030/214] From 868b56516042b8d6e25014a449ec1ab38901a279 Mon Sep 17 00:00:00 2001 From: Christopher Powers Date: Fri, 31 Aug 2018 16:00:38 -0500 Subject: [PATCH 031/214] Bug#28515475 BOGUS DATA WHEN ORDERING RESULTS FROM VARIABLES_BY_THREAD This fixes a regression from Bug#21354712 SHOW VARIABLES RETURN WARNING ABOUT @@SESSION.GTID_EXECUTED BEING DEPRECATED, where the logic to deprecate "gtid_executed" misaligns the system variable cache, causing the position of variables following "gtid_executed" to be off by one. This patch introduces System_variable::m_ignore to identify deprecated system variables that must be accounted for internally but otherwise ignored. --- .../suite/perfschema/r/show_misc.result | 16 ++++ mysql-test/suite/perfschema/t/show_misc.test | 15 ++++ storage/perfschema/pfs_variable.cc | 73 +++++++++++-------- storage/perfschema/pfs_variable.h | 7 +- storage/perfschema/table_global_variables.cc | 4 +- storage/perfschema/table_session_variables.cc | 4 +- .../perfschema/table_variables_by_thread.cc | 4 +- 7 files changed, 84 insertions(+), 39 deletions(-) diff --git a/mysql-test/suite/perfschema/r/show_misc.result b/mysql-test/suite/perfschema/r/show_misc.result index ba0606121b23..3612139c68af 100644 --- a/mysql-test/suite/perfschema/r/show_misc.result +++ b/mysql-test/suite/perfschema/r/show_misc.result @@ -88,6 +88,22 @@ Variable_name Value UNLOCK TABLES; DROP TABLE test.t1; +================================================================================ +Bug#28515475 BOGUS DATA WHEN ORDERING RESULTS FROM VARIABLES_BY_THREAD +================================================================================ +Verify the results from "WHERE variable_name IN(...)", particularly for those +variables that are listed after the deprecated variable gtid_executed. +The ORDER BY also forces an additional code path through rnd_pos(). + +SELECT variable_name FROM performance_schema.variables_by_thread +WHERE variable_name IN ('interactive_timeout','net_read_timeout','net_write_timeout','wait_timeout') +ORDER BY variable_name; +variable_name +interactive_timeout +net_read_timeout +net_write_timeout +wait_timeout + ================================================================================ CLEAN UP ================================================================================ diff --git a/mysql-test/suite/perfschema/t/show_misc.test b/mysql-test/suite/perfschema/t/show_misc.test index e56c859913be..39a6b65b6b5f 100644 --- a/mysql-test/suite/perfschema/t/show_misc.test +++ b/mysql-test/suite/perfschema/t/show_misc.test @@ -75,6 +75,21 @@ UNLOCK TABLES; DROP TABLE test.t1; + +--echo +--echo ================================================================================ +--echo Bug#28515475 BOGUS DATA WHEN ORDERING RESULTS FROM VARIABLES_BY_THREAD +--echo ================================================================================ +--echo Verify the results from "WHERE variable_name IN(...)", particularly for those +--echo variables that are listed after the deprecated variable gtid_executed. +--echo The ORDER BY also forces an additional code path through rnd_pos(). +--echo + +SELECT variable_name FROM performance_schema.variables_by_thread + WHERE variable_name IN ('interactive_timeout','net_read_timeout','net_write_timeout','wait_timeout') + ORDER BY variable_name; + + --echo --echo ================================================================================ --echo CLEAN UP diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc index e07f3be1631a..0473cc92c298 100644 --- a/storage/perfschema/pfs_variable.cc +++ b/storage/perfschema/pfs_variable.cc @@ -159,7 +159,7 @@ int PFS_system_variable_cache::do_materialize_global(void) if (match_scope(value->scope())) { /* Resolve value, convert to text, add to cache. */ - System_variable system_var(m_current_thd, show_var, m_query_scope); + System_variable system_var(m_current_thd, show_var, m_query_scope, false); m_cache.push_back(system_var); } } @@ -202,6 +202,7 @@ int PFS_system_variable_cache::do_materialize_all(THD *unsafe_thd) const char* name= show_var->name; sys_var *value= (sys_var *)show_var->value; DBUG_ASSERT(value); + bool ignore= false; if (value->scope() == sys_var::SESSION && (!my_strcasecmp(system_charset_info, name, "gtid_executed"))) @@ -226,10 +227,11 @@ int PFS_system_variable_cache::do_materialize_all(THD *unsafe_thd) This special case needs be removed once @@SESSION.GTID_EXECUTED is deprecated. */ - continue; + ignore= true; + } /* Resolve value, convert to text, add to cache. */ - System_variable system_var(m_safe_thd, show_var, m_query_scope); + System_variable system_var(m_safe_thd, show_var, m_query_scope, ignore); m_cache.push_back(system_var); } @@ -254,7 +256,7 @@ void PFS_system_variable_cache::set_mem_root(void) init_sql_alloc(PSI_INSTRUMENT_ME, &m_mem_sysvar, SYSVAR_MEMROOT_BLOCK_SIZE, 0); m_mem_sysvar_ptr= &m_mem_sysvar; } - m_mem_thd= my_thread_get_THR_MALLOC(); /* pointer to current THD mem_root */ + m_mem_thd= my_thread_get_THR_MALLOC(); /* pointer to current THD mem_root */ m_mem_thd_save= *m_mem_thd; /* restore later */ *m_mem_thd= &m_mem_sysvar; /* use temporary mem_root */ } @@ -328,17 +330,16 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread) if (match_scope(value->scope())) { const char* name= show_var->name; + bool ignore= false; + if (value->scope() == sys_var::SESSION && (!my_strcasecmp(system_charset_info, name, "gtid_executed"))) { - /* - Please check PFS_system_variable_cache::do_materialize_all for - details about this special case. - */ - continue; + /* Deprecated. See PFS_system_variable_cache::do_materialize_all. */ + ignore= true; } /* Resolve value, convert to text, add to cache. */ - System_variable system_var(m_safe_thd, show_var, m_query_scope); + System_variable system_var(m_safe_thd, show_var, m_query_scope, ignore); m_cache.push_back(system_var); } } @@ -391,18 +392,17 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui if (match_scope(value->scope())) { const char* name= show_var->name; - /* - Please check PFS_system_variable_cache::do_materialize_all for - details about this special case. - */ - if ((my_strcasecmp(system_charset_info, name, "gtid_executed") != 0) || - (value->scope() != sys_var::SESSION && - (!my_strcasecmp(system_charset_info, name, "gtid_executed")))) + bool ignore= false; + + if (value->scope() == sys_var::SESSION && + (!my_strcasecmp(system_charset_info, name, "gtid_executed"))) { - /* Resolve value, convert to text, add to cache. */ - System_variable system_var(m_safe_thd, show_var, m_query_scope); - m_cache.push_back(system_var); + /* Deprecated. See PFS_system_variable_cache::do_materialize_all. */ + ignore= true; } + /* Resolve value, convert to text, add to cache. */ + System_variable system_var(m_safe_thd, show_var, m_query_scope, ignore); + m_cache.push_back(system_var); } } @@ -452,17 +452,17 @@ int PFS_system_variable_cache::do_materialize_session(THD *unsafe_thd) if (match_scope(value->scope())) { const char* name= show_var->name; + bool ignore= false; + if (value->scope() == sys_var::SESSION && (!my_strcasecmp(system_charset_info, name, "gtid_executed"))) { - /* - Please check PFS_system_variable_cache::do_materialize_all for - details about this special case. - */ - continue; + /* Deprecated. See PFS_system_variable_cache::do_materialize_all. */ + ignore= true; } /* Resolve value, convert to text, add to cache. */ - System_variable system_var(m_safe_thd, show_var, m_query_scope); + System_variable system_var(m_safe_thd, show_var, m_query_scope, ignore); + m_cache.push_back(system_var); } } @@ -488,7 +488,7 @@ int PFS_system_variable_cache::do_materialize_session(THD *unsafe_thd) */ System_variable::System_variable() : m_name(NULL), m_name_length(0), m_value_length(0), m_type(SHOW_UNDEF), m_scope(0), - m_charset(NULL), m_initialized(false) + m_ignore(false), m_charset(NULL), m_initialized(false) { m_value_str[0]= '\0'; } @@ -497,9 +497,9 @@ System_variable::System_variable() GLOBAL or SESSION system variable. */ System_variable::System_variable(THD *target_thd, const SHOW_VAR *show_var, - enum_var_type query_scope) + enum_var_type query_scope, bool ignore) : m_name(NULL), m_name_length(0), m_value_length(0), m_type(SHOW_UNDEF), m_scope(0), - m_charset(NULL), m_initialized(false) + m_ignore(ignore), m_charset(NULL), m_initialized(false) { init(target_thd, show_var, query_scope); } @@ -515,11 +515,21 @@ void System_variable::init(THD *target_thd, const SHOW_VAR *show_var, enum_mysql_show_type show_var_type= show_var->type; DBUG_ASSERT(show_var_type == SHOW_SYS); - THD *current_thread= current_thd; - + m_name= show_var->name; m_name_length= strlen(m_name); + /* Deprecated variables are ignored but must still be accounted for. */ + if (m_ignore) + { + m_value_str[0]= '\0'; + m_value_length= 0; + m_initialized= true; + return; + } + + THD *current_thread= current_thd; + /* Block remote target thread from updating this system variable. */ if (target_thd != current_thread) mysql_mutex_lock(&target_thd->LOCK_thd_sysvar); @@ -556,7 +566,6 @@ void System_variable::init(THD *target_thd, const SHOW_VAR *show_var, return; #endif - m_initialized= true; } diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h index d1bf2d681de1..1de3df4c3530 100644 --- a/storage/perfschema/pfs_variable.h +++ b/storage/perfschema/pfs_variable.h @@ -137,10 +137,12 @@ class System_variable { public: System_variable(); - System_variable(THD *target_thd, const SHOW_VAR *show_var, enum_var_type query_scope); + System_variable(THD *target_thd, const SHOW_VAR *show_var, + enum_var_type query_scope, bool ignore); ~System_variable() {} - bool is_null() const {return !m_initialized;}; + bool is_null() const { return !m_initialized; } + bool is_ignored() const { return m_ignore; } public: const char *m_name; @@ -149,6 +151,7 @@ class System_variable size_t m_value_length; enum_mysql_show_type m_type; int m_scope; + bool m_ignore; const CHARSET_INFO *m_charset; private: diff --git a/storage/perfschema/table_global_variables.cc b/storage/perfschema/table_global_variables.cc index c7dbc632fc90..31d934d98697 100644 --- a/storage/perfschema/table_global_variables.cc +++ b/storage/perfschema/table_global_variables.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -149,7 +149,7 @@ void table_global_variables ::make_row(const System_variable *system_var) { m_row_exists= false; - if (system_var->is_null()) + if (system_var->is_null() || system_var->is_ignored()) return; m_row.m_variable_name.make_row(system_var->m_name, system_var->m_name_length); m_row.m_variable_value.make_row(system_var); diff --git a/storage/perfschema/table_session_variables.cc b/storage/perfschema/table_session_variables.cc index d5eb79d27790..48e3100bcebd 100644 --- a/storage/perfschema/table_session_variables.cc +++ b/storage/perfschema/table_session_variables.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -152,6 +152,8 @@ void table_session_variables ::make_row(const System_variable *system_var) { m_row_exists= false; + if (system_var->is_null() || system_var->is_ignored()) + return; m_row.m_variable_name.make_row(system_var->m_name, system_var->m_name_length); m_row.m_variable_value.make_row(system_var); m_row_exists= true; diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc index 306da621890f..9547ef580412 100644 --- a/storage/perfschema/table_variables_by_thread.cc +++ b/storage/perfschema/table_variables_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -186,7 +186,7 @@ ::make_row(PFS_thread *thread, const System_variable *system_var) { pfs_optimistic_state lock; m_row_exists= false; - if (system_var->is_null()) + if (system_var->is_null() || system_var->is_ignored()) return; /* Protect this reader against a thread termination */ From 1370467629a0a543a1ce976720fbbb0568911ab3 Mon Sep 17 00:00:00 2001 From: Venkatesh Venugopal Date: Wed, 26 Sep 2018 18:10:20 +0530 Subject: [PATCH 032/214] Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN STATEMENT MODE ON 5.7.23 Problem ------- SBR breaks when LOAD DATA is executed on 5.7.23 server. Analysis -------- As a part of a bug fix that went into 5.7.23 where MySQL-5.7 was made to compile warning-free, the if condition in sql_load.cc was changed from 5.7.22: if (thd->slave_thread & ((SYSTEM_THREAD_SLAVE_SQL | (SYSTEM_THREAD_SLAVE_WORKER)) !=0)) to 5.7.23: if ((thd->slave_thread & (SYSTEM_THREAD_SLAVE_SQL | SYSTEM_THREAD_SLAVE_WORKER)) != 0). While the former condition evaluated to true, after the change, the latter always evaluated to false thereby causing the slave to fail. Fix --- Replaced thd->slave_thread with thd->system_thread enum. --- .../suite/rpl/r/rpl_slave_load_in.result | 11 +++- mysql-test/suite/rpl/t/rpl_slave_load_in.test | 52 ++++++++++++++++--- sql/sql_load.cc | 2 +- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_in.result b/mysql-test/suite/rpl/r/rpl_slave_load_in.result index ae48e1ca4c05..bbc6ea0c8404 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_in.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_in.result @@ -3,7 +3,12 @@ Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] -create table t1(a int not null auto_increment, b int, primary key(a)); +# Restart the slave with a different secure path. +[connection slave] +include/assert.inc [Datadir is the new secure file path] +include/start_slave.inc +[connection master] +create table t1(a int not null auto_increment, b int, primary key(a)) engine=myisam; create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb; load data infile '../../std_data/rpl_loaddata.dat' into table t1; start transaction; @@ -13,8 +18,12 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2; load data infile '../../std_data/rpl_loaddata.dat' into table t2; commit; include/sync_slave_sql_with_master.inc +# Restore the old secure path on slave. +include/assert.inc [Old secure file path is restored.] +include/start_slave.inc include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] +[connection master] drop table t1; drop table t2; include/sync_slave_sql_with_master.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_in.test b/mysql-test/suite/rpl/t/rpl_slave_load_in.test index 4a6426698046..2616db1aadf4 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_in.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_in.test @@ -1,20 +1,46 @@ ########################################################################## -# This test verifies if a slave is able to process a "LOAD DATA INFILE" +# This test verifies if a slave is able to process a "LOAD DATA INFILE" # event while the "--secure-file-priv" option is set. -# +# # The test is divided in two steps: # 1 - Creates tables and populates them through "LOAD DATA INFILE". # 2 - Compares the master and slave. +# +# === References === +# Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN +# STATEMENT MODE ON 5.7.23 ########################################################################## ---source include/have_innodb.inc + +# This test does not work with var being a softlink. +--source include/not_var_link.inc +--source include/have_binlog_format_statement.inc --source include/master-slave.inc +# Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN +# STATEMENT MODE ON 5.7.23 + +--echo # Restart the slave with a different secure path. +--source include/rpl_connection_slave.inc +--let $old_secure_file_path=`SELECT @@GLOBAL.secure_file_priv` +--let $datadir=`SELECT @@GLOBAL.datadir` +--let $include_silent=1 +--let $rpl_server_number=2 +--let $rpl_server_parameters=--secure-file-priv=$datadir +--source include/rpl_restart_server.inc +--let $include_silent=0 + +# Assert that @@GLOBAL.secure_file_priv equals @@GLOBAL.datadir +--let $assert_text= Datadir is the new secure file path +--let $assert_cond= "[SELECT @@GLOBAL.secure_file_priv]" = "[SELECT @@GLOBAL.datadir]" +--source include/assert.inc +--source include/start_slave.inc + ########################################################################## # Loading data ########################################################################## -connection master; +--source include/rpl_connection_master.inc -create table t1(a int not null auto_increment, b int, primary key(a)); +create table t1(a int not null auto_increment, b int, primary key(a)) engine=myisam; create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb; load data infile '../../std_data/rpl_loaddata.dat' into table t1; @@ -31,6 +57,20 @@ commit; ########################################################################## --source include/sync_slave_sql_with_master.inc +--echo # Restore the old secure path on slave. +--let $include_silent=1 +--let $rpl_server_number=2 +--let $rpl_server_parameters=--secure-file-priv=$old_secure_file_path +--source include/rpl_restart_server.inc +--let $include_silent=0 + +# Assert that @@GLOBAL.secure_file_priv is restored. +--let $assert_text= Old secure file path is restored. +--let $assert_cond= "[SELECT @@GLOBAL.secure_file_priv]" = "$old_secure_file_path" +--source include/assert.inc + +--source include/start_slave.inc + let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -40,7 +80,7 @@ source include/diff_tables.inc; ########################################################################## # Clean up ########################################################################## -connection master; +--source include/rpl_connection_master.inc drop table t1; drop table t2; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 653880e7b68e..3070de1bc4f4 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -447,7 +447,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, MY_RETURN_REAL_PATH); } - if ((thd->slave_thread & + if ((thd->system_thread & (SYSTEM_THREAD_SLAVE_SQL | SYSTEM_THREAD_SLAVE_WORKER)) != 0) { #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) From 96bbeecfee5d5569e0b20d0bc84d13c9397ee74c Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Mon, 24 Sep 2018 15:38:41 +0300 Subject: [PATCH 033/214] Fixed PS-1107 (LP #1703346: Binlog corruption when tmpdir gets full) (5.6) https://jira.percona.com/browse/PS-1107 Cherry-picked from ps-5.5-bugps1107-tmpdir_full branch (commit 6a2f578). Changes in 'rpl.rpl_bug72457' MTR test case: * '--source include/rpl_sync.inc' changed to '--source include/sync_slave_sql_with_master.inc'. * 'simulate_disk_full_at_flush_pending' DEBUG directive changed to 'simulate_tmpdir_partition_full'. * Hardcoded error code 1590 changed to 'convert_error(ER_SLAVE_INCIDENT)'. --- mysql-test/suite/rpl/r/rpl_bug72457.result | 41 ++++++++++++++++++ mysql-test/suite/rpl/t/rpl_bug72457.test | 48 ++++++++++++++++++++++ sql/binlog.cc | 30 +++++++++----- 3 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_bug72457.result create mode 100644 mysql-test/suite/rpl/t/rpl_bug72457.test diff --git a/mysql-test/suite/rpl/r/rpl_bug72457.result b/mysql-test/suite/rpl/r/rpl_bug72457.result new file mode 100644 index 000000000000..f5e6729e2452 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_bug72457.result @@ -0,0 +1,41 @@ +# +# Bug #72457 "Replication with no tmpdir space can break replication" +# (https://bugs.mysql.com/bug.php?id=72457) +# Bug #86991 "binlog corruption when tmpdir gets full" +# (https://bugs.mysql.com/bug.php?id=86991) +# Bug #88223 "Replication with no tmpdir space and InnoDB as tmp_storage_engine can break" +# (https://bugs.mysql.com/bug.php?id=88223) +# +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master\\. Message: error writing to the binary log"); +CREATE TABLE t1(f1 TEXT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(MD5(1)); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +include/sync_slave_sql_with_master.inc +[connection master] +SET SESSION debug = "+d,simulate_tmpdir_partition_full"; +INSERT INTO t1 SELECT * FROM t1; +ERROR HY000: Error writing file (Errcode: ##) +SET SESSION debug = "-d,simulate_tmpdir_partition_full"; +[connection slave] +include/wait_for_slave_sql_error.inc [errno=1590] +Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: error writing to the binary log' +include/stop_slave_io.inc +RESET SLAVE; +DROP TABLE t1; +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_bug72457.test b/mysql-test/suite/rpl/t/rpl_bug72457.test new file mode 100644 index 000000000000..b796b197ede3 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug72457.test @@ -0,0 +1,48 @@ +--source include/have_debug.inc +--source include/have_binlog_format_row.inc +--source include/have_log_bin.inc + +--echo # +--echo # Bug #72457 "Replication with no tmpdir space can break replication" +--echo # (https://bugs.mysql.com/bug.php?id=72457) +--echo # Bug #86991 "binlog corruption when tmpdir gets full" +--echo # (https://bugs.mysql.com/bug.php?id=86991) +--echo # Bug #88223 "Replication with no tmpdir space and InnoDB as tmp_storage_engine can break" +--echo # (https://bugs.mysql.com/bug.php?id=88223) +--echo # + +--source include/master-slave.inc + +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master\\. Message: error writing to the binary log"); + +CREATE TABLE t1(f1 TEXT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(MD5(1)); + +--let $i = 10 +while($i) +{ + INSERT INTO t1 SELECT * FROM t1; + --dec $i +} +--source include/sync_slave_sql_with_master.inc + +--source include/rpl_connection_master.inc +SET SESSION debug = "+d,simulate_tmpdir_partition_full"; +--replace_regex /Error writing file .*/Error writing file (Errcode: ##)/ +--error 3 +INSERT INTO t1 SELECT * FROM t1; +SET SESSION debug = "-d,simulate_tmpdir_partition_full"; + +--source include/rpl_connection_slave.inc +--let $slave_sql_errno = convert_error(ER_SLAVE_INCIDENT) +--let $show_slave_sql_error = 1 +--source include/wait_for_slave_sql_error.inc +--source include/stop_slave_io.inc +RESET SLAVE; +DROP TABLE t1; + +--source include/rpl_connection_master.inc +DROP TABLE t1; + +--let $rpl_only_running_threads = 1 +--source include/rpl_end.inc diff --git a/sql/binlog.cc b/sql/binlog.cc index 9eea111a3949..3ba60f981a08 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -3828,23 +3828,33 @@ int MYSQL_BIN_LOG::raw_get_current_log(LOG_INFO* linfo) return 0; } +static bool check_write_error_code(uint error_code) +{ + return error_code == ER_TRANS_CACHE_FULL || + error_code == ER_STMT_CACHE_FULL || + error_code == ER_ERROR_ON_WRITE || + error_code == ER_BINLOG_LOGGING_IMPOSSIBLE; +} + bool MYSQL_BIN_LOG::check_write_error(THD *thd) { DBUG_ENTER("MYSQL_BIN_LOG::check_write_error"); - bool checked= FALSE; - if (!thd->is_error()) - DBUG_RETURN(checked); + DBUG_RETURN(false); - switch (thd->get_stmt_da()->sql_errno()) + bool checked= check_write_error_code(thd->get_stmt_da()->sql_errno()); + + if (!checked) { - case ER_TRANS_CACHE_FULL: - case ER_STMT_CACHE_FULL: - case ER_ERROR_ON_WRITE: - case ER_BINLOG_LOGGING_IMPOSSIBLE: - checked= TRUE; - break; + /* Check all conditions for one that matches the expected error */ + const Sql_condition *err; + Diagnostics_area::Sql_condition_iterator it= + thd->get_stmt_da()->sql_conditions(); + while ((err= it++) != NULL && !checked) + { + checked= check_write_error_code(err->get_sql_errno()); + } } DBUG_PRINT("return", ("checked: %s", YESNO(checked))); DBUG_RETURN(checked); From 315011479d5f0a63899b7c4133fc3ab641475824 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Fri, 28 Sep 2018 16:44:17 +0200 Subject: [PATCH 034/214] From 54cb37a1ec8f1be93983512c36408a795448b14a Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Sun, 30 Sep 2018 08:04:43 +0530 Subject: [PATCH 035/214] Bug#22252394: SLAVE I/O THREAD MAY STOP WHEN BINLOG ROTATES Problem: ======== When binlog rotation occurs before updating MYSQL_BIN_LOG::binlog_end_pos in SYNC stage of binlog group commit, receiver thread stops with following error. 2015-11-22T17:32:39.386343Z 8 [ERROR] Slave I/O for channel '': Got fatal error 1236 from master when reading data from binary log: 'unknown error reading log event on the master; the first event '' at 4, the last event read from './master-bin.000244' at 202, the last byte read from './master-bin.000244' at 202.', Error_code: 1236 Analysis: ======== When sync_binlog= 1 durable setting is enabled, the binary log end position is updated only upon successful completion of sync stage. In binlog group commit the LOCK_log is held during flush stage and it is release during sync stage and LOCK_sync is acquired. By releasing LOCK_log earlier more parallelization can be achieved on master. For example let the binlog_file: master-bin.000001 and pos: 364 Executing FLUSH LOGS at this moment will grab the LOCK_log and it successfully rotates the binary log and does the flush and sync of the new binary log. The binlog end position also gets updated to reflect the active binary log file and position. At this stage new binlog_file: master-bin.000002 and pos:154 Now the sync operation proceeds and it tries to update the binlog end postion. update_binlog_end_pos(pos) function call does the following. It compares if the passed input binlog position is greater than previous binlog_end_pos. If it is greater it updates the value. void update_binlog_end_pos(my_off_t pos) lock_binlog_end_pos(); if (pos > binlog_end_pos) binlog_end_pos= pos; The above code will result as shown below. Example scenario will become: master-bin.000002 pos: 364. At this point the binlog sender thread tries to read a non existing event at pos 364 from 'master-bin.000002' which results in an error. Associating the position of old binary log file to a new binary log file leads to this issue. Fix: === The update_binlog_end_pos function call now receives the binary log file name along with the position. The input binary log file name will be compared against active binary log. If the input file is not the active file then position will not be updated. Position update is skipped as active binary log has changed. --- .../r/rpl_flush_log_after_sync_stage.result | 22 ++++++++ .../rpl/t/rpl_flush_log_after_sync_stage.test | 53 +++++++++++++++++++ sql/binlog.cc | 10 ++-- sql/binlog.h | 4 +- 4 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_flush_log_after_sync_stage.result create mode 100644 mysql-test/suite/rpl/t/rpl_flush_log_after_sync_stage.test diff --git a/mysql-test/suite/rpl/r/rpl_flush_log_after_sync_stage.result b/mysql-test/suite/rpl/r/rpl_flush_log_after_sync_stage.result new file mode 100644 index 000000000000..22e90e6d83b7 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_flush_log_after_sync_stage.result @@ -0,0 +1,22 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +SET @save_sync_binlog = @@GLOBAL.sync_binlog; +SET GLOBAL sync_binlog = 1; +SET DEBUG_SYNC = 'before_sync_binlog_file SIGNAL parked_in_sync WAIT_FOR continue'; +CREATE TABLE t1(c1 INT); +[connection default] +SET DEBUG_SYNC = "now WAIT_FOR parked_in_sync"; +FLUSH LOGS; +SET DEBUG_SYNC = "now SIGNAL continue"; +[connection master] +INSERT INTO t1 VALUES (10); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +[connection master] +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL sync_binlog = @save_sync_binlog; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_flush_log_after_sync_stage.test b/mysql-test/suite/rpl/t/rpl_flush_log_after_sync_stage.test new file mode 100644 index 000000000000..956c867711ef --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_flush_log_after_sync_stage.test @@ -0,0 +1,53 @@ +# +# ==== Purpose ==== +# +# Test verifies that when binlog rotation occurs before updating +# MYSQL_BIN_LOG::binlog_end_pos in SYNC stage of binlog group commit, receiver +# thread doesn't stop with an error. Receiver thread's execution should be +# fine. +# +# ==== Implementation ==== +# +# 1. Have sync_binlog= 1. +# 2. Hold master's binlog sender thread during sync stage of binlog group +# commit just before updating the binary log end position. +# 3. Execute FLUSH LOGS in another session so that binary log gets rotated. +# 4. Allow the sync operation to proceed further in master connection. +# 5. Slave should be in sync with master. It should not error out. +# +# ==== References ==== +# +# Bug #22252394 SLAVE I/O THREAD MAY STOP WHEN BINLOG ROTATES +# +# +--source include/have_debug_sync.inc +# Testing it in one mode is enough +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +SET @save_sync_binlog = @@GLOBAL.sync_binlog; +SET GLOBAL sync_binlog = 1; + +# Block the session before binlog end position is updated during sync stage. +SET DEBUG_SYNC = 'before_sync_binlog_file SIGNAL parked_in_sync WAIT_FOR continue'; + +send CREATE TABLE t1(c1 INT); + +--let $rpl_connection_name= default +--source include/rpl_connection.inc +SET DEBUG_SYNC = "now WAIT_FOR parked_in_sync"; +FLUSH LOGS; +SET DEBUG_SYNC = "now SIGNAL continue"; + +--source include/rpl_connection_master.inc +--reap +INSERT INTO t1 VALUES (10); +--source include/sync_slave_sql_with_master.inc +--let diff_tables=master:t1, slave:t1 +--source include/diff_tables.inc + +--source include/rpl_connection_master.inc +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL sync_binlog = @save_sync_binlog; +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/sql/binlog.cc b/sql/binlog.cc index 3443bc348ab9..e3eac16004bc 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -6855,7 +6855,7 @@ void MYSQL_BIN_LOG::make_log_name(char* buf, const char* log_ident) bool MYSQL_BIN_LOG::is_active(const char *log_file_name_arg) { - return !strcmp(log_file_name, log_file_name_arg); + return !compare_log_name(log_file_name, log_file_name_arg); } @@ -9612,11 +9612,15 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit) if (update_binlog_end_pos_after_sync) { THD *tmp_thd= final_queue; - + const char *binlog_file= NULL; + my_off_t pos= 0; while (tmp_thd->next_to_commit != NULL) tmp_thd= tmp_thd->next_to_commit; if (flush_error == 0 && sync_error == 0) - update_binlog_end_pos(tmp_thd->get_trans_pos()); + { + tmp_thd->get_trans_fixed_pos(&binlog_file, &pos); + update_binlog_end_pos(binlog_file, pos); + } } DEBUG_SYNC(thd, "bgc_after_sync_stage_before_commit_stage"); diff --git a/sql/binlog.h b/sql/binlog.h index a591cd678180..0bfb1daf7981 100644 --- a/sql/binlog.h +++ b/sql/binlog.h @@ -728,10 +728,10 @@ class MYSQL_BIN_LOG: public TC_LOG } } - void update_binlog_end_pos(my_off_t pos) + void update_binlog_end_pos(const char *file, my_off_t pos) { lock_binlog_end_pos(); - if (pos > binlog_end_pos) + if (is_active(file) && pos > binlog_end_pos) binlog_end_pos= pos; signal_update(); unlock_binlog_end_pos(); From 8fdc16256a9646f12a240ddcc0ccf6e4366bf630 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Mon, 18 Jun 2018 11:08:15 +0200 Subject: [PATCH 036/214] Deb packaging: Add support for Ubuntu 18.10 (Cosmic Cuttlefish) --- packaging/deb-in/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packaging/deb-in/CMakeLists.txt b/packaging/deb-in/CMakeLists.txt index 4ce5ce43e12a..682077ac11c6 100644 --- a/packaging/deb-in/CMakeLists.txt +++ b/packaging/deb-in/CMakeLists.txt @@ -334,6 +334,25 @@ ELSEIF(DEB_CODENAME STREQUAL "bionic") SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") SET (DEB_CONTROL_DBGSYM "") SET (DEB_RULES_STRIP "") +ELSEIF(DEB_CODENAME STREQUAL "cosmic") + SET (DEB_PLATFORMRELEASE "ubuntu18.10") + SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD + "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") + SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql") + SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") + SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE + "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") + SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") + SET (DEB_CONTROL_DBGSYM "") + SET (DEB_RULES_STRIP "") ELSE() MESSAGE(STATUS "Skipping deb packaging on unsupported platform ${DEB_CODENAME}.") From aedab91ecdaebe3e01cfe27a3161a92255b2b5cb Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Mon, 1 Oct 2018 15:13:23 +0530 Subject: [PATCH 037/214] Bug#28511326: DEADLOCK DURING PURGE_LOGS_BEFORE_DATE Fixing a post push test issue. --- .../binlog/r/binlog_set_trans_dependency_deadlock.result | 1 + .../suite/binlog/t/binlog_set_trans_dependency_deadlock.test | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result b/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result index 0f823862e226..7009072b505c 100644 --- a/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result +++ b/mysql-test/suite/binlog/r/binlog_set_trans_dependency_deadlock.result @@ -6,6 +6,7 @@ RESET MASTER; FLUSH LOGS; connect con1,localhost,root,,; SET DEBUG_SYNC="purge_logs_after_lock_index_before_thread_count SIGNAL purge_ready WAIT_FOR finish_purge"; +PURGE BINARY LOGS BEFORE '2038-01-19'; connect con2,localhost,root,,; SET DEBUG_SYNC="materialize_session_variable_array_THD_locked SIGNAL pfs_ready WAIT_FOR finish_pfs"; SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE 'binlog_transaction_dependency_tracking';; diff --git a/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test b/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test index 25ce10d4c177..845df98d8ede 100644 --- a/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test +++ b/mysql-test/suite/binlog/t/binlog_set_trans_dependency_deadlock.test @@ -46,10 +46,7 @@ FLUSH LOGS; SET DEBUG_SYNC="purge_logs_after_lock_index_before_thread_count SIGNAL purge_ready WAIT_FOR finish_purge"; -let $date=`SELECT CURDATE() + 1`; ---disable_query_log ---send_eval PURGE BINARY LOGS BEFORE $date; ---enable_query_log +--send PURGE BINARY LOGS BEFORE '2038-01-19' --connect(con2,localhost,root,,) From 7a8daed78679a38c2f23e4ed0e9a65bbd8ba1995 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 1 Oct 2018 12:26:44 +0200 Subject: [PATCH 038/214] From 58a8ee30f3099c14e7cd2c1b918c8c20620c7290 Mon Sep 17 00:00:00 2001 From: Dmitry Lenev Date: Fri, 28 Sep 2018 23:36:56 +0300 Subject: [PATCH 039/214] Fix for bug#28714367 "5.7.21+ LF_NODE METADATA LOCK LEAK WHEN USING GET_LOCK". Calls to GET_LOCK() function with zero timeout argument which failed due to concurrent connections holding the same user-level lock, left underlying metadata lock structure in state which prevented future reuse of its memory for other metadata locks (or release of this memory before server shutdown). As result memory was hogged by some of workloads which involved user-level locks with random/constantly changing names, attempted to lock by different connections with zero timeout. The problem was introduced by fix for bug@26739438 "DEADLOCK ON GET_LOCK(..., 0)". This fix added short-cut to MDL_context::acquire_lock() for case when we failed to acquire lock instantly and zero timeout was used. However, proper cleanup of MDL_lock fast path state and obtrusive lock count was not performed in this case, which led to MDL_lock object being always marked as used. This fix solves the problem by changing acquire_lock() code to resort to calling try_acquire_lock() in case of zero timeout. The latter call performs cleanup properly. It is hard to write robust test case for this bug for our test suite. So no test case provided as part of the patch. However, this fix was tested manually. --- sql/mdl.cc | 56 ++++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/sql/mdl.cc b/sql/mdl.cc index 8fcb568b5e87..84fd60c3ab31 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3554,6 +3554,32 @@ void MDL_lock::object_lock_notify_conflicting_locks(MDL_context *ctx, MDL_lock * bool MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout) { + if (lock_wait_timeout == 0) + { + /* + Resort to try_acquire_lock() in case of zero timeout. + + This allows to avoid unnecessary deadlock detection attempt and "fake" + deadlocks which might result from it. + In case of failure to acquire lock, try_acquire_lock() preserves + invariants by updating MDL_lock::fast_path_state and obtrusive locks + count. It also performs SE notification if needed. + */ + if (try_acquire_lock(mdl_request)) + return true; + + if (!mdl_request->ticket) + { + /* We have failed to acquire lock instantly. */ + DEBUG_SYNC(get_thd(), "mdl_acquire_lock_wait"); + my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0)); + return true; + } + return false; + } + + /* Normal, non-zero timeout case. */ + MDL_lock *lock; MDL_ticket *ticket; struct timespec abs_timeout; @@ -3574,34 +3600,6 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout) return FALSE; } - /* - Return early if we did not get the lock and are not willing to wait. - This way we avoid reporting "fake" deadlock for lock_wait_timeout == 0. - */ - if (lock_wait_timeout == 0) - { - /* - Lock acquired inside try_acquire_lock_impl(). Release before - leaving scope. - */ - mysql_prlock_unlock(&ticket->m_lock->m_rwlock); - - /* - If SEs were notified about impending lock acquisition, the failure - to acquire it requires the same notification as lock release. - */ - if (ticket->m_hton_notified) - { - mysql_mdl_set_status(ticket->m_psi, MDL_ticket::POST_RELEASE_NOTIFY); - m_owner->notify_hton_post_release_exclusive(&mdl_request->key); - } - DEBUG_SYNC(get_thd(), "mdl_acquire_lock_wait"); - - MDL_ticket::destroy(ticket); - my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0)); - return true; - } - /* Our attempt to acquire lock without waiting has failed. As a result of this attempt we got MDL_ticket with m_lock From 74d82a9b3851a9228703e3b886216bd83f36aca2 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 2 Oct 2018 09:25:36 +0530 Subject: [PATCH 040/214] BUG#28727698 - FEDORA29: UPGRADE FROM MARIADB TO MYSQL 8.0.13 IS FAILING. - Due to changes in packages, add more obsoletes to server package. --- packaging/rpm-fedora/mysql.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/rpm-fedora/mysql.spec.in b/packaging/rpm-fedora/mysql.spec.in index d0621571cf1a..5f2bcf6cb43f 100644 --- a/packaging/rpm-fedora/mysql.spec.in +++ b/packaging/rpm-fedora/mysql.spec.in @@ -163,6 +163,7 @@ Obsoletes: community-mysql-bench Obsoletes: mysql-bench Obsoletes: mariadb-backup Obsoletes: mariadb-bench +Obsoletes: mariadb-connector-c-config Obsoletes: mariadb-cracklib-password-check Obsoletes: mariadb-gssapi-server Obsoletes: mariadb-rocksdb-engine From 43186a9995865ca6090896c3897cb51a73aac393 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Wed, 3 Oct 2018 13:39:27 +0530 Subject: [PATCH 041/214] BUG#28737143 - SWITCH TO NON DEFAULT OPENSSL 1.0.X ON FEDORA29, 1.1.1 SUPPORT IS NOT THERE YET - Switch openssl version to 1.0.x for fedora29 builds --- packaging/rpm-fedora/mysql.spec.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/rpm-fedora/mysql.spec.in b/packaging/rpm-fedora/mysql.spec.in index 5f2bcf6cb43f..68050eae6420 100644 --- a/packaging/rpm-fedora/mysql.spec.in +++ b/packaging/rpm-fedora/mysql.spec.in @@ -105,6 +105,11 @@ BuildRequires: perl(Time::localtime) %if 0%{?fedora} > 24 BuildRequires: perl-generators %endif +%if 0%{?fedora} > 28 +BuildRequires: compat-openssl10-devel +%else +BuildRequires: openssl-devel +%endif BuildRequires: time BuildRequires: cyrus-sasl-devel BuildRequires: libaio-devel @@ -113,7 +118,6 @@ BuildRequires: multilib-rpm-config BuildRequires: ncurses-devel BuildRequires: numactl-devel BuildRequires: openldap-devel -BuildRequires: openssl-devel BuildRequires: zlib-devel BuildRequires: systemd BuildRequires: pkgconfig(systemd) From 41660e0710e67f54f008785937689a34cd45708a Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 4 Oct 2018 13:01:51 +0200 Subject: [PATCH 042/214] Bug#28636768: ANALYZE AND BACKPORT BUG#28365855 TO 5.7 When stopping, channels that had pending transactions could deadlock in the GR before commit hook invocation. The stop process takes a write lock for the master info channel, but it then waits on the complete of its transactions that might try to take a read lock on the same structure. As a solution we add context info the THD object. That way the before commit hook no longer depends on channel locks to complete its process. It also includes some related locking corrections and improvements with updated documented information on subject. --- .../group_replication/src/observer_trans.cc | 11 +-- ...nnel_stop_with_pending_transactions.result | 34 +++++++ ...hannel_stop_with_pending_transactions.test | 91 +++++++++++++++++++ sql/replication.h | 5 +- sql/rpl_channel_service_interface.cc | 25 +---- sql/rpl_context.h | 20 +++- sql/rpl_handler.cc | 6 +- sql/rpl_slave.cc | 26 ++++++ sql/rpl_slave.h | 59 ++++++++---- sql/sys_vars.cc | 2 + 10 files changed, 231 insertions(+), 48 deletions(-) create mode 100644 rapid/plugin/group_replication/tests/mtr/r/gr_applier_channel_stop_with_pending_transactions.result create mode 100644 rapid/plugin/group_replication/tests/mtr/t/gr_applier_channel_stop_with_pending_transactions.test diff --git a/rapid/plugin/group_replication/src/observer_trans.cc b/rapid/plugin/group_replication/src/observer_trans.cc index 6282541f175e..622772cb8c87 100644 --- a/rapid/plugin/group_replication/src/observer_trans.cc +++ b/rapid/plugin/group_replication/src/observer_trans.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -268,9 +268,8 @@ int group_replication_trans_before_commit(Trans_param *param) lock below. */ Replication_thread_api channel_interface; - if (channel_interface.is_own_event_applier(param->thread_id, - "group_replication_applier")) - { + if (GR_APPLIER_CHANNEL == param->rpl_channel_type) { + // If plugin is stopping, there is no point in update the statistics. bool fail_to_lock= shared_plugin_stop_lock->try_grab_read_lock(); if (!fail_to_lock) @@ -287,9 +286,7 @@ int group_replication_trans_before_commit(Trans_param *param) DBUG_RETURN(0); } - if (channel_interface.is_own_event_applier(param->thread_id, - "group_replication_recovery")) - { + if (GR_RECOVERY_CHANNEL == param->rpl_channel_type) { DBUG_RETURN(0); } diff --git a/rapid/plugin/group_replication/tests/mtr/r/gr_applier_channel_stop_with_pending_transactions.result b/rapid/plugin/group_replication/tests/mtr/r/gr_applier_channel_stop_with_pending_transactions.result new file mode 100644 index 000000000000..a44c198f70dd --- /dev/null +++ b/rapid/plugin/group_replication/tests/mtr/r/gr_applier_channel_stop_with_pending_transactions.result @@ -0,0 +1,34 @@ +include/group_replication.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection server1] + +# 1. With both the members ONLINE. On M1 create a table +[connection server1] +CREATE TABLE test.t1 (a INT PRIMARY KEY); +include/rpl_sync.inc + +# 2. Set a DEBUG point so transactions hang at the before commit hook on M2 +# Execute a transaction on M1 +[connection server2] +SET @debug_save= @@GLOBAL.DEBUG; +SET @@GLOBAL.DEBUG='+d,group_replication_before_commit_hook_wait'; +[connection server1] +INSERT INTO t1 VALUES (1); +[connection server2] + +# 3. Try to stop the GR applier thread on M2, it should block. +STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";; +[connection server_2] + +# 4. Signal to continue_commit. The stop shall continue. +SET DEBUG_SYNC='now SIGNAL continue_commit'; +SET @@GLOBAL.DEBUG= @debug_save; +[connection server2] + +# 5. Cleanup +include/gr_start_applier_sql_thread.inc +START SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier"; +DROP TABLE t1; +include/group_replication_end.inc diff --git a/rapid/plugin/group_replication/tests/mtr/t/gr_applier_channel_stop_with_pending_transactions.test b/rapid/plugin/group_replication/tests/mtr/t/gr_applier_channel_stop_with_pending_transactions.test new file mode 100644 index 000000000000..af460cf2b0ae --- /dev/null +++ b/rapid/plugin/group_replication/tests/mtr/t/gr_applier_channel_stop_with_pending_transactions.test @@ -0,0 +1,91 @@ +################################################################################ +# Test to check that +# R1. Stopping the applier blocks while there are pending transactions in +# the GR hooks on that channel. +# R2. Once those pending transactions exit the GR hook, the action of stopping +# the applier is unblocked and can complete. +# +# Test: +# 0. The test requires two servers: M1 and M2. +# 1. With both the members ONLINE. On M1 create a table +# 2. Set a DEBUG point so transactions hang at the before commit hook on M2 +# Execute a transaction on M1 +# 3. Try to stop the GR applier thread on M2, it should block. +# 4. Signal to continue_commit. The stop shall continue. +# 5. Clean up. +################################################################################ + +# Setup a two server Group. +--source include/have_debug_sync.inc +--source ../inc/have_group_replication_plugin.inc +--source ../inc/group_replication.inc + +--echo +--echo # 1. With both the members ONLINE. On M1 create a table + +--let $rpl_connection_name= server1 +--source include/rpl_connection.inc + +CREATE TABLE test.t1 (a INT PRIMARY KEY); + +--source include/rpl_sync.inc + +--echo +--echo # 2. Set a DEBUG point so transactions hang at the before commit hook on M2 +--echo # Execute a transaction on M1 + +--let $rpl_connection_name= server2 +--source include/rpl_connection.inc + +SET @debug_save= @@GLOBAL.DEBUG; +SET @@GLOBAL.DEBUG='+d,group_replication_before_commit_hook_wait'; + +--let $rpl_connection_name= server1 +--source include/rpl_connection.inc + +# do an insert that will block on M2 +INSERT INTO t1 VALUES (1); + +--let $rpl_connection_name= server2 +--source include/rpl_connection.inc + +# Ensuring that the insert actually hangs at the before commit hook. +--let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'debug sync point: now' +--source include/wait_condition.inc + +--echo +--echo # 3. Try to stop the GR applier thread on M2, it should block. + +--send STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier"; + +--let $rpl_connection_name= server_2 +--source include/rpl_connection.inc + +--let $wait_condition=SELECT COUNT(*)=1 FROM performance_schema.threads WHERE PROCESSLIST_STATE = 'Killing slave' AND PROCESSLIST_INFO = 'STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier"' +--source include/wait_condition.inc + +--echo +--echo # 4. Signal to continue_commit. The stop shall continue. + +# give it an extra second to block +--sleep 1 + +SET DEBUG_SYNC='now SIGNAL continue_commit'; +SET @@GLOBAL.DEBUG= @debug_save; + +--let $rpl_connection_name= server2 +--source include/rpl_connection.inc + +--reap + +--let $wait_condition= SELECT service_state="OFF" FROM performance_schema.replication_applier_status WHERE channel_name="group_replication_applier" +--source include/wait_condition.inc + +--echo +--echo # 5. Cleanup + +--source ../inc/gr_start_applier_sql_thread.inc + +DROP TABLE t1; + +--source ../inc/group_replication_end.inc diff --git a/sql/replication.h b/sql/replication.h index f157e1687905..a34eaae2dcd3 100644 --- a/sql/replication.h +++ b/sql/replication.h @@ -19,7 +19,8 @@ #include "my_global.h" #include "my_thread_local.h" // my_thread_id #include "mysql/psi/mysql_thread.h" // mysql_mutex_t -#include "handler.h" // enum_tx_isolation +#include "handler.h" // enum_tx_isolation +#include "rpl_context.h" // enum_rpl_channel_type typedef struct st_mysql MYSQL; typedef struct st_io_cache IO_CACHE; @@ -155,6 +156,8 @@ typedef struct Trans_param { */ Trans_context_info trans_ctx_info; + /** Replication channel info associated to this transaction/THD */ + enum_rpl_channel_type rpl_channel_type; } Trans_param; /** diff --git a/sql/rpl_channel_service_interface.cc b/sql/rpl_channel_service_interface.cc index 7142ad717612..596034e4a69e 100644 --- a/sql/rpl_channel_service_interface.cc +++ b/sql/rpl_channel_service_interface.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -474,12 +474,12 @@ int channel_stop(Master_info *mi, DBUG_RETURN(RPL_CHANNEL_SERVICE_CHANNEL_DOES_NOT_EXISTS_ERROR); } - mi->channel_rdlock(); - int thread_mask= 0; int server_thd_mask= 0; int error= 0; bool thd_init= false; + + mi->channel_wrlock(); lock_slave_threads(mi); init_thread_mask(&server_thd_mask, mi, 0 /* not inverse*/); @@ -617,11 +617,8 @@ bool channel_is_active(const char* channel, enum_channel_thread_types thd_type) DBUG_RETURN(false); } - mi->channel_rdlock(); - init_thread_mask(&thread_mask, mi, 0 /* not inverse*/); - mi->channel_unlock(); channel_map.unlock(); switch(thd_type) @@ -656,8 +653,6 @@ int channel_get_thread_id(const char* channel, DBUG_RETURN(RPL_CHANNEL_SERVICE_CHANNEL_DOES_NOT_EXISTS_ERROR); } - mi->channel_rdlock(); - switch(thd_type) { case CHANNEL_RECEIVER_THREAD: @@ -741,10 +736,9 @@ int channel_get_thread_id(const char* channel, } break; default: - DBUG_RETURN(number_threads); + break; } - mi->channel_unlock(); channel_map.unlock(); DBUG_RETURN(number_threads); @@ -764,7 +758,6 @@ long long channel_get_last_delivered_gno(const char* channel, int sidno) DBUG_RETURN(RPL_CHANNEL_SERVICE_CHANNEL_DOES_NOT_EXISTS_ERROR); } - mi->channel_rdlock(); rpl_gno last_gno= 0; global_sid_lock->rdlock(); @@ -782,7 +775,6 @@ long long channel_get_last_delivered_gno(const char* channel, int sidno) my_free(retrieved_gtid_set_string); #endif - mi->channel_unlock(); channel_map.unlock(); DBUG_RETURN(last_gno); @@ -800,15 +792,13 @@ int channel_add_executed_gtids_to_received_gtids(const char* channel) DBUG_RETURN(RPL_CHANNEL_SERVICE_CHANNEL_DOES_NOT_EXISTS_ERROR); } - mi->channel_rdlock(); - channel_map.unlock(); global_sid_lock->wrlock(); enum_return_status return_status= mi->rli->add_gtid_set(gtid_state->get_executed_gtids()); global_sid_lock->unlock(); - mi->channel_unlock(); + channel_map.unlock(); DBUG_RETURN(return_status != RETURN_STATUS_OK); } @@ -1012,8 +1002,6 @@ bool channel_is_stopping(const char* channel, DBUG_RETURN(false); } - mi->channel_rdlock(); - switch(thd_type) { case CHANNEL_NO_THD: @@ -1028,7 +1016,6 @@ bool channel_is_stopping(const char* channel, DBUG_ASSERT(0); } - mi->channel_unlock(); channel_map.unlock(); DBUG_RETURN(is_stopping); @@ -1044,9 +1031,7 @@ bool is_partial_transaction_on_channel_relay_log(const char *channel) channel_map.unlock(); DBUG_RETURN(false); } - mi->channel_rdlock(); bool ret= mi->transaction_parser.is_inside_transaction(); - mi->channel_unlock(); channel_map.unlock(); DBUG_RETURN(ret); } diff --git a/sql/rpl_context.h b/sql/rpl_context.h index 43928db8bcfb..87681486360b 100644 --- a/sql/rpl_context.h +++ b/sql/rpl_context.h @@ -24,6 +24,13 @@ class Gtid_set; class Sid_map; class THD; +/** Type of replication channel thread/transaction might be associated to*/ +enum enum_rpl_channel_type { + NO_CHANNEL_INFO = 0, // No information exists about the channel + RPL_STANDARD_CHANNEL = 1, // It is a standard replication channel + GR_APPLIER_CHANNEL = 2, // It is a GR applier channel + GR_RECOVERY_CHANNEL = 3 // It is a GR recovery channel +}; /** This class is an interface for session consistency instrumentation @@ -90,7 +97,7 @@ class Session_consistency_gtids_ctx The last statement should return a set of GTIDs. */ ulong m_curr_session_track_gtids; - + protected: /* @@ -228,13 +235,14 @@ class Rpl_thd_context private: Session_consistency_gtids_ctx m_session_gtids_ctx; Dependency_tracker_ctx m_dependency_tracker_ctx; + /** If this thread is a channel, what is its type*/ + enum_rpl_channel_type rpl_channel_type; - // make these private Rpl_thd_context(const Rpl_thd_context& rsc); Rpl_thd_context& operator=(const Rpl_thd_context& rsc); public: - Rpl_thd_context() { } + Rpl_thd_context() : rpl_channel_type(NO_CHANNEL_INFO) {} inline Session_consistency_gtids_ctx& session_gtids_ctx() { @@ -245,6 +253,12 @@ class Rpl_thd_context { return m_dependency_tracker_ctx; } + + enum_rpl_channel_type get_rpl_channel_type() { return rpl_channel_type; } + + void set_rpl_channel_type(enum_rpl_channel_type rpl_channel_type_arg) { + rpl_channel_type = rpl_channel_type_arg; + } }; #endif /* RPL_SESSION_H */ diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc index c9a8e3af5c1c..c311b530a5c1 100644 --- a/sql/rpl_handler.cc +++ b/sql/rpl_handler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -315,6 +315,7 @@ int Trans_delegate::before_commit(THD *thd, bool all, param.trx_cache_log= trx_cache_log; param.stmt_cache_log= stmt_cache_log; param.cache_log_max_size= cache_log_max_size; + param.rpl_channel_type = thd->rpl_thd_ctx.get_rpl_channel_type(); bool is_real_trans= (all || !thd->get_transaction()->is_active(Transaction_ctx::SESSION)); @@ -509,6 +510,7 @@ int Trans_delegate::before_rollback(THD *thd, bool all) param.server_id= thd->server_id; param.server_uuid= server_uuid; param.thread_id= thd->thread_id(); + param.rpl_channel_type = thd->rpl_thd_ctx.get_rpl_channel_type(); bool is_real_trans= (all || !thd->get_transaction()->is_active(Transaction_ctx::SESSION)); @@ -527,6 +529,7 @@ int Trans_delegate::after_commit(THD *thd, bool all) TRANS_PARAM_ZERO(param); param.server_uuid= server_uuid; param.thread_id= thd->thread_id(); + param.rpl_channel_type = thd->rpl_thd_ctx.get_rpl_channel_type(); bool is_real_trans= (all || !thd->get_transaction()->is_active(Transaction_ctx::SESSION)); @@ -551,6 +554,7 @@ int Trans_delegate::after_rollback(THD *thd, bool all) TRANS_PARAM_ZERO(param); param.server_uuid= server_uuid; param.thread_id= thd->thread_id(); + param.rpl_channel_type = thd->rpl_thd_ctx.get_rpl_channel_type(); bool is_real_trans= (all || !thd->get_transaction()->is_active(Transaction_ctx::SESSION)); diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc index e334d7cfc283..dfb6943300ea 100644 --- a/sql/rpl_slave.cc +++ b/sql/rpl_slave.cc @@ -320,6 +320,9 @@ void lock_slave_threads(Master_info* mi) { DBUG_ENTER("lock_slave_threads"); + //protection against mixed locking order (see header) + mi->channel_assert_some_wrlock(); + //TODO: see if we can do this without dual mutex mysql_mutex_lock(&mi->run_lock); mysql_mutex_lock(&mi->rli->run_lock); @@ -6136,6 +6139,18 @@ extern "C" void *handle_slave_worker(void *arg) rli->get_for_channel_str()); goto err; } + + if (channel_map.is_group_replication_channel_name(rli->get_channel())) { + if (channel_map.is_group_replication_channel_name(rli->get_channel(), + true)) { + thd->rpl_thd_ctx.set_rpl_channel_type(GR_APPLIER_CHANNEL); + } else { + thd->rpl_thd_ctx.set_rpl_channel_type(GR_RECOVERY_CHANNEL); + } + } else { + thd->rpl_thd_ctx.set_rpl_channel_type(RPL_STANDARD_CHANNEL); + } + mysql_mutex_lock(&w->info_thd_lock); w->info_thd= thd; mysql_mutex_unlock(&w->info_thd_lock); @@ -7201,6 +7216,17 @@ extern "C" void *handle_slave_sql(void *arg) rli->set_commit_order_manager(commit_order_mngr); + if (channel_map.is_group_replication_channel_name(rli->get_channel())) { + if (channel_map.is_group_replication_channel_name(rli->get_channel(), + true)) { + thd->rpl_thd_ctx.set_rpl_channel_type(GR_APPLIER_CHANNEL); + } else { + thd->rpl_thd_ctx.set_rpl_channel_type(GR_RECOVERY_CHANNEL); + } + } else { + thd->rpl_thd_ctx.set_rpl_channel_type(RPL_STANDARD_CHANNEL); + } + mysql_mutex_unlock(&rli->info_thd_lock); /* Inform waiting threads that slave has started */ diff --git a/sql/rpl_slave.h b/sql/rpl_slave.h index fcdbdd8cb3b2..022ca1fb5fc4 100644 --- a/sql/rpl_slave.h +++ b/sql/rpl_slave.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -105,25 +105,41 @@ extern bool server_id_supplied; /* MUTEXES in replication: - channel_map lock: This is to lock the Multisource datastructure (channel_map). - Generally it used to retrieve an mi from channel_map.It is used to SERIALIZE ALL - administrative commands of replication: START SLAVE, STOP SLAVE, CHANGE - MASTER, RESET SLAVE, end_slave() (when mysqld stops) [init_slave() does not - need it it's called early]. Any of these commands holds the mutex from the - start till the end. This thus protects us against a handful of deadlocks - (consider start_slave_thread() which, when starting the I/O thread, releases - mi->run_lock, keeps rli->run_lock, and tries to re-acquire mi->run_lock). + m_channel_map_lock: This rwlock is used to protect the multi source + replication data structure (channel_map). Any operation reading contents + from the channel_map should hold the rdlock during the operation. Any + operation changing the channel_map (either adding/removing channels to/from + the channel_map) should hold the wrlock during the operation. + [init_slave() does not need it it's called early]. + + In Master_info: m_channel_lock + It is used to SERIALIZE ALL administrative commands of replication: START + SLAVE, STOP SLAVE, CHANGE MASTER, RESET SLAVE, delete_slave_info_objects + (when mysqld stops) + + This thus protects us against a handful of deadlocks, being the know ones + around lock_slave_threads and the mixed order they are acquired in some + operations: + + + consider start_slave_thread() which, when starting the I/O thread, + releases mi->run_lock, keeps rli->run_lock, and tries to re-acquire + mi->run_lock. + + + Same applies to stop_slave() where a stop of the I/O thread will + mi->run_lock, keeps rli->run_lock, and tries to re-acquire mi->run_lock. + For the SQL thread, the order is the opposite. In Master_info: run_lock, data_lock run_lock protects all information about the run state: slave_running, thd and the existence of the I/O thread (to stop/start it, you need this mutex). + Check the above m_channel_lock about locking order. data_lock protects some moving members of the struct: counters (log name, position) and relay log (MYSQL_BIN_LOG object). In Relay_log_info: run_lock, data_lock - see Master_info - However, note that run_lock does not protect - Relay_log_info.run_state; that is protected by data_lock. + see Master_info, also the above m_channel_lock about locking order. + However, note that run_lock does not protect Relay_log_info.run_state; + that is protected by data_lock. In MYSQL_BIN_LOG: LOCK_log, LOCK_index of the binlog and the relay log LOCK_log: when you write to it. LOCK_index: when you create/delete a binlog @@ -146,13 +162,13 @@ extern bool server_id_supplied; stop_slave: channel_map lock, - ( mi.run_lock, thd.LOCK_thd_data + ( mi.channel_wrlock, mi.run_lock, thd.LOCK_thd_data | rli.run_lock, thd.LOCK_thd_data | relay.LOCK_log ) start_slave: - mi.run_lock, rli.run_lock, rli.data_lock, global_sid_lock->wrlock + mi.channel_wrlock, mi.run_lock, rli.run_lock, rli.data_lock, global_sid_lock->wrlock reset_logs: THD::LOCK_thd_data, .LOCK_log, .LOCK_index, global_sid_lock->wrlock @@ -166,7 +182,7 @@ extern bool server_id_supplied; binlog.LOCK_index, global_sid_lock->wrlock, LOCK_reset_gtid_table reset_slave: - mi.run_lock, rli.run_lock, (purge_relay_logs) rli.data_lock, + mi.channel_wrlock, mi.run_lock, rli.run_lock, (purge_relay_logs) rli.data_lock, THD::LOCK_thd_data, relay.LOCK_log, relay.LOCK_index, global_sid_lock->wrlock @@ -212,7 +228,7 @@ extern bool server_id_supplied; ) change_master: - mi.run_lock, rli.run_lock, (init_relay_log_pos) rli.data_lock, + mi.channel_wrlock, mi.run_lock, rli.run_lock, (init_relay_log_pos) rli.data_lock, relay.log_lock Sys_var_gtid_mode::global_update: @@ -396,6 +412,17 @@ void end_slave(); /* release slave threads */ void delete_slave_info_objects(); /* clean up slave threads data */ void clear_until_condition(Relay_log_info* rli); void clear_slave_error(Relay_log_info* rli); +/** + This method locks both (in this order) + mi->run_lock + rli->run_lock + + @param mi The associated master info object + + @note this method shall be invoked while locking mi->m_channel_lock + for writes. This is due to the mixed order in which these locks are released + and acquired in such method as the slave threads start and stop methods. +*/ void lock_slave_threads(Master_info* mi); void unlock_slave_threads(Master_info* mi); void init_thread_mask(int* mask,Master_info* mi,bool inverse); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index ea3a3a0f5472..81a390b90884 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1104,6 +1104,7 @@ static bool repository_check(sys_var *self, THD *thd, set_var *var, SLAVE_THD_TY if (mi != NULL) { + mi->channel_wrlock(); lock_slave_threads(mi); init_thread_mask(&running, mi, FALSE); if(!running) @@ -1153,6 +1154,7 @@ static bool repository_check(sys_var *self, THD *thd, set_var *var, SLAVE_THD_TY my_error(ER_SLAVE_CHANNEL_MUST_STOP, MYF(0),mi->get_channel()); } unlock_slave_threads(mi); + mi->channel_unlock(); } channel_map.unlock(); #endif From 99edc920d71e1e419456f47e0a16b828d43cf69e Mon Sep 17 00:00:00 2001 From: Thayumanavar S Date: Fri, 5 Oct 2018 05:53:32 +0200 Subject: [PATCH 043/214] BUG#27966483 - SIGHUP CAUSE MYSQL SERVER CRASH. When SIGHUP signal is sent to mysqld and the server is admitting new connections at this time, it results in the server exit. The thread cache is purged as part of SIGHUP handling. This involves raising signal to the threads that are blocked waiting for new connections to be in thread cache. We purge the channel queue as part of this making it empty. New connections can be admitted after which result in waking up a thread in the thread cache and this attempts to dequeue a connection for handling from an empty channel info queue. This results in the behaviour show in the bug. The fix is not to drain the channel info queue in the kill_blocked_pthreads and instead let it be handled by the unblocked thread. --- .../connection_handler_per_thread.cc | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/sql/conn_handler/connection_handler_per_thread.cc b/sql/conn_handler/connection_handler_per_thread.cc index 43d748accfe8..211e894b016c 100644 --- a/sql/conn_handler/connection_handler_per_thread.cc +++ b/sql/conn_handler/connection_handler_per_thread.cc @@ -147,13 +147,19 @@ Channel_info* Per_thread_connection_handler::block_until_new_connection() if (kill_blocked_pthreads_flag) mysql_cond_signal(&COND_flush_thread_cache); - else if (!abort_loop && wake_pthread) + else if (wake_pthread) { wake_pthread--; - DBUG_ASSERT(!waiting_channel_info_list->empty()); - new_conn= waiting_channel_info_list->front(); - waiting_channel_info_list->pop_front(); - DBUG_PRINT("info", ("waiting_channel_info_list->pop %p", new_conn)); + if (!waiting_channel_info_list->empty()) + { + new_conn = waiting_channel_info_list->front(); + waiting_channel_info_list->pop_front(); + DBUG_PRINT("info", ("waiting_channel_info_list->pop %p", new_conn)); + } + else + { + DBUG_ASSERT(0); + } } } mysql_mutex_unlock(&LOCK_thread_cache); @@ -332,6 +338,15 @@ extern "C" void *handle_connection(void *arg) if (channel_info == NULL) break; pthread_reused= true; + if (abort_loop) + { + // Close the channel and exit as server is undergoing shutdown. + channel_info->send_error_and_close_channel(ER_SERVER_SHUTDOWN, 0, false); + delete channel_info; + channel_info = NULL; + Connection_handler_manager::dec_connection_count(); + break; + } } my_thread_end(); @@ -350,16 +365,6 @@ void Per_thread_connection_handler::kill_blocked_pthreads() mysql_cond_wait(&COND_flush_thread_cache, &LOCK_thread_cache); } kill_blocked_pthreads_flag--; - - // Drain off the channel info list. - while (!waiting_channel_info_list->empty()) - { - Channel_info* channel_info= waiting_channel_info_list->front(); - waiting_channel_info_list->pop_front(); - // close the channel. - channel_info->send_error_and_close_channel(ER_SERVER_SHUTDOWN, 0, false); - delete channel_info; - } mysql_mutex_unlock(&LOCK_thread_cache); } From 97cac4a3cf3695519bb0973721391b07175dd251 Mon Sep 17 00:00:00 2001 From: Venkatesh Venugopal Date: Fri, 5 Oct 2018 10:41:34 +0530 Subject: [PATCH 044/214] Bug#28529558 HANDLE_FATAL_SIGNAL (SIG=11) IN __MEMMOVE_SSE2_UNALIGNED_ERMS / _MY_B_WRITE Problem ------- MySQL abnormally exits due to uninitialized master_info IO_CACHE. Fix --- The abnormal exit has been fixed. --- sql/rpl_info_factory.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/rpl_info_factory.cc b/sql/rpl_info_factory.cc index 7724d69415a4..6215a37a3a01 100644 --- a/sql/rpl_info_factory.cc +++ b/sql/rpl_info_factory.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -631,6 +631,7 @@ bool Rpl_info_factory::decide_repository(Rpl_info *info, uint option, { DBUG_ASSERT(return_check_src == REPOSITORY_DOES_NOT_EXIST && return_check_dst == REPOSITORY_DOES_NOT_EXIST); + info->inited= false; } delete (*handler_src); From 3dadc9558507b942fd2d1929aaa3971359335c05 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Mon, 8 Oct 2018 14:16:23 +0530 Subject: [PATCH 045/214] Bug#28569645: SQL INJECTION ON SLAVE DUE TO NON-QUOTING IN BINLOGGED ROLLBACK TO SAVEPOINT Description: SQL injection is possible on slave due to incorrect binlogging of 'ROLLBACK TO SAVEPOINT' statements. Analysis: Whenever an identifier is written to binary log, it should be properly quoted to prevent any SQL injection on the slave. For binlogging of 'ROLLBACK TO SAVEPOINT' statements, this is correctly fixed on 5.5 by the patch for Bug#14548159, but the fix is missing from 5.6+. Fix: Added proper binlogging for 'ROLLBACK TO SAVEPOINT' statements. --- sql/binlog.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sql/binlog.cc b/sql/binlog.cc index 3d3ed0ed0314..05519df7196c 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -1860,11 +1860,19 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv) if (trans_cannot_safely_rollback(thd)) { String log_query; - if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) || - log_query.append("`") || - log_query.append(thd->lex->ident.str, thd->lex->ident.length) || - log_query.append("`")) + if (log_query.append(STRING_WITH_LEN("ROLLBACK TO "))) DBUG_RETURN(1); + else + { + /* + Before writing identifier to the binlog, make sure to + quote the identifier properly so as to prevent any SQL + injection on the slave. + */ + append_identifier(thd, &log_query, thd->lex->ident.str, + thd->lex->ident.length); + } + int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); Query_log_event qinfo(thd, log_query.c_ptr_safe(), log_query.length(), TRUE, FALSE, TRUE, errcode); From ed15c0fa3a38fa4b955833e92967fb9d8e2145ac Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Mon, 8 Oct 2018 12:57:05 +0100 Subject: [PATCH 046/214] BUG#27442477 ASSERT `THD->GET_HA_DATA...HAS_STATE(XID_STATE::XA_ACTIVE))' AT HANDLER.CC:1396 [post-push fix] Problem ------- After BUG#27442477, even if an XA transaction gets emptied by filters the slave applier will continue to run. While applying on the slave, if a XA transaction becomes empty, the slave applier should stop and the user should be called upon to solve the matter. Analysis & Fix -------------- A client error should be thrown in XA PREPARE, if the transaction is empty. Nothing should be written to the binary log. --- ...pl_xa_with_filters_binlogless_slave.result | 32 ++++++ .../r/rpl_xa_with_filters_error_msg.result | 36 +++--- ...xa_with_filters_binlogless_slave-slave.opt | 1 + .../rpl_xa_with_filters_binlogless_slave.test | 106 ++++++++++++++++++ .../rpl/t/rpl_xa_with_filters_error_msg.test | 101 ++++++++++++----- sql/binlog.cc | 22 ++++ sql/binlog.h | 20 ++++ sql/log_event.cc | 4 +- sql/rpl_rli.cc | 5 +- sql/xa.cc | 9 +- 10 files changed, 284 insertions(+), 52 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_xa_with_filters_binlogless_slave.result create mode 100644 mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave-slave.opt create mode 100644 mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave.test diff --git a/mysql-test/suite/rpl/r/rpl_xa_with_filters_binlogless_slave.result b/mysql-test/suite/rpl/r/rpl_xa_with_filters_binlogless_slave.result new file mode 100644 index 000000000000..e6e71573bc77 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_xa_with_filters_binlogless_slave.result @@ -0,0 +1,32 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +[connection master] +CREATE TABLE t1 (a INT); +include/sync_slave_sql_with_master.inc +include/stop_slave_sql.inc +CALL mtr.add_suppression(".*The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.*"); +CALL mtr.add_suppression(".*The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave.*"); +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(test.t1); +include/start_slave_sql.inc +[connection master] +XA START '1'; +INSERT INTO t1 VALUES (1); +XA END '1'; +XA PREPARE '1'; +XA COMMIT '1'; +[connection slave] +include/wait_for_slave_sql_error.inc [errno=3227] +START SLAVE SQL_THREAD; +include/wait_for_slave_sql_error.inc [errno=3227] +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(); +include/start_slave_sql.inc +[connection master] +include/sync_slave_sql_with_master.inc +include/assert.inc [table 'test.t1' record count must be 1] +include/assert_grep.inc [Found error message regarding usage of replication filters with XA transactions] +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_xa_with_filters_error_msg.result b/mysql-test/suite/rpl/r/rpl_xa_with_filters_error_msg.result index c1f23a8fee99..af6898392d4d 100644 --- a/mysql-test/suite/rpl/r/rpl_xa_with_filters_error_msg.result +++ b/mysql-test/suite/rpl/r/rpl_xa_with_filters_error_msg.result @@ -3,37 +3,31 @@ Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] -# -# 1) Add a replication filter to the slave node -# -[connection slave] +[connection master] +CREATE TABLE t1 (a INT); +include/sync_slave_sql_with_master.inc include/stop_slave_sql.inc -CALL mtr.add_suppression("Slave SQL.*The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave.*"); -CHANGE REPLICATION FILTER Replicate_Do_Table=(test.tab1); +CALL mtr.add_suppression(".*The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.*"); +CALL mtr.add_suppression(".*The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave.*"); +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(test.t1); include/start_slave_sql.inc [connection master] -# -# 2) Create a table that gets filtered out by the added filter -# -CREATE TABLE t1 (a INT); -# -# 3) Start an XA transaction and execute a statement that is filtered out by -# replication filter -# XA START '1'; INSERT INTO t1 VALUES (1); XA END '1'; XA PREPARE '1'; XA COMMIT '1'; +[connection slave] +include/wait_for_slave_sql_error.inc [errno=3227] +START SLAVE SQL_THREAD; +include/wait_for_slave_sql_error.inc [errno=3227] +include/assert_binlog_events.inc [Gtid/SET.* # Query/use.* # Gtid/SET.* # Query/XA START.* # Table_map/.* # Write_rows/.* # Query/XA END.* # XA_prepare/XA PREPARE.* # Gtid/SET.* # Query/XA COMMIT.*] +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(); +include/start_slave_sql.inc +[connection master] include/sync_slave_sql_with_master.inc -# -# 4) Ensure that the error message get logged to the slave error log file. -# +include/assert.inc [table 'test.t1' record count must be 1] include/assert_grep.inc [Found error message regarding usage of replication filters with XA transactions] [connection master] DROP TABLE t1; -include/sync_slave_sql_with_master.inc -include/stop_slave_sql.inc -CHANGE REPLICATION FILTER Replicate_Do_Table=(); -include/start_slave_sql.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave-slave.opt b/mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave-slave.opt new file mode 100644 index 000000000000..1d2b93f580b1 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave-slave.opt @@ -0,0 +1 @@ +--log-slave-updates=OFF --skip-log-bin \ No newline at end of file diff --git a/mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave.test b/mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave.test new file mode 100644 index 000000000000..ae4c4f670a0f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_xa_with_filters_binlogless_slave.test @@ -0,0 +1,106 @@ +# ==== Requirements ==== +# +# R1. When using replication filter together with XA transactions, output an +# error message when some statement gets filtered within the active XA +# transaction. +# +# ==== Implementation ==== +# +# With default setup: +# 1) Create a table that gets filtered out by the added filter +# 2) Add a replication filter to the slave node +# 3) Start an XA transaction and execute a statement that is filtered out by +# replication filter +# 4) Ensure that the error message get logged to the slave error log file. +# +# ==== References ==== +# +# BUG#27442477: ASSERT `THD->GET_HA_DATA...HAS_STATE(XID_STATE::XA_ACTIVE))' AT HANDLER.CC:1396 + +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +--let $gtid_mode_value= `SELECT @@GLOBAL.GTID_MODE = "ON"` + +--source include/rpl_connection_master.inc +# +# 1) Create a table that gets filtered out by the added filter +# +CREATE TABLE t1 (a INT); +--source include/sync_slave_sql_with_master.inc + +# +# 2) Add a replication filter to the slave node +# +--source include/stop_slave_sql.inc +CALL mtr.add_suppression(".*The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.*"); +CALL mtr.add_suppression(".*The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave.*"); +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(test.t1); +--source include/start_slave_sql.inc + +# +# 3) Start an XA transaction and execute a statement that is filtered out by +# replication filter +# +--source include/rpl_connection_master.inc +XA START '1'; INSERT INTO t1 VALUES (1); XA END '1'; XA PREPARE '1'; +XA COMMIT '1'; +--let $gtid_executed_master= `SELECT @@GLOBAL.GTID_EXECUTED` + +# +# Wait for the ER_XA_REPLICATION_FILTERS error to be thrown +# +--source include/rpl_connection_slave.inc +--let $slave_sql_errno= convert_error(ER_XA_REPLICATION_FILTERS) +--source include/wait_for_slave_sql_error.inc + +# +# Retry the transaction +# +START SLAVE SQL_THREAD; +--let $slave_sql_errno= convert_error(ER_XA_REPLICATION_FILTERS) +--source include/wait_for_slave_sql_error.inc + +# +# If GTID_MODE is ON, test that are missing GTID +# +if ($gtid_mode_value == 1) +{ + --let $gtid_executed_slave= `SELECT @@GLOBAL.GTID_EXECUTED` + --let $gtid_missing_slave= `SELECT GTID_SUBTRACT('$gtid_executed_master', '$gtid_executed_slave')` + --disable_result_log + --let $include_silent= 1 + --let $assert_text= slave has missing GTIDs + --let $assert_cond= "$gtid_missing_slave" != "" + --source include/assert.inc + --let $include_silent= + --enable_result_log +} + +# +# Clear replication filters in order for the transaction to succeed. +# +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(); +--let $slave_sql_errno= +--source include/start_slave_sql.inc +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc +--let $count = `SELECT COUNT(1) FROM test.t1;` +--let $assert_text = table 'test.t1' record count must be 1 +--let $assert_cond = $count = 1 +--source include/assert.inc + +# +# 4) Ensure that the error message get logged to the slave error log file. +# +--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err +--let $assert_only_after= CURRENT_TEST: rpl:rpl_xa_with_filters_error_msg +--let $assert_match= The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave +--let $assert_select= Slave SQL +--let $assert_text= Found error message regarding usage of replication filters with XA transactions +--source include/assert_grep.inc + +--source include/rpl_connection_master.inc +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_xa_with_filters_error_msg.test b/mysql-test/suite/rpl/t/rpl_xa_with_filters_error_msg.test index b917d8e24343..78f31bd28694 100644 --- a/mysql-test/suite/rpl/t/rpl_xa_with_filters_error_msg.test +++ b/mysql-test/suite/rpl/t/rpl_xa_with_filters_error_msg.test @@ -7,8 +7,8 @@ # ==== Implementation ==== # # With default setup: -# 1) Add a replication filter to the slave node -# 2) Create a table that gets filtered out by the added filter +# 1) Create a table that gets filtered out by the added filter +# 2) Add a replication filter to the slave node # 3) Start an XA transaction and execute a statement that is filtered out by # replication filter # 4) Ensure that the error message get logged to the slave error log file. @@ -20,34 +20,88 @@ --source include/have_binlog_format_row.inc --source include/master-slave.inc ---echo # ---echo # 1) Add a replication filter to the slave node ---echo # ---source include/rpl_connection_slave.inc +--let $gtid_mode_value= `SELECT @@GLOBAL.GTID_MODE = "ON"` + +--source include/rpl_connection_master.inc +# +# 1) Create a table that gets filtered out by the added filter +# +CREATE TABLE t1 (a INT); +--source include/sync_slave_sql_with_master.inc + +# +# 2) Add a replication filter to the slave node +# --source include/stop_slave_sql.inc -CALL mtr.add_suppression("Slave SQL.*The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave.*"); -CHANGE REPLICATION FILTER Replicate_Do_Table=(test.tab1); +CALL mtr.add_suppression(".*The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.*"); +CALL mtr.add_suppression(".*The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave.*"); +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(test.t1); --source include/start_slave_sql.inc +# +# 3) Start an XA transaction and execute a statement that is filtered out by +# replication filter +# --source include/rpl_connection_master.inc ---echo # ---echo # 2) Create a table that gets filtered out by the added filter ---echo # -CREATE TABLE t1 (a INT); ---echo # ---echo # 3) Start an XA transaction and execute a statement that is filtered out by ---echo # replication filter ---echo # XA START '1'; INSERT INTO t1 VALUES (1); XA END '1'; XA PREPARE '1'; XA COMMIT '1'; +--let $gtid_executed_master= `SELECT @@GLOBAL.GTID_EXECUTED` +# +# Wait for the ER_XA_REPLICATION_FILTERS error to be thrown +# +--source include/rpl_connection_slave.inc +--let $slave_sql_errno= convert_error(ER_XA_REPLICATION_FILTERS) +--source include/wait_for_slave_sql_error.inc + +# +# Retry the transaction +# +START SLAVE SQL_THREAD; +--let $slave_sql_errno= convert_error(ER_XA_REPLICATION_FILTERS) +--source include/wait_for_slave_sql_error.inc + +# +# If GTID_MODE is ON, test that are missing GTID +# +if ($gtid_mode_value == 1) +{ + --let $gtid_executed_slave= `SELECT @@GLOBAL.GTID_EXECUTED` + --let $gtid_missing_slave= `SELECT GTID_SUBTRACT('$gtid_executed_master', '$gtid_executed_slave')` + --disable_result_log + --let $include_silent= 1 + --let $assert_text= slave has missing GTIDs + --let $assert_cond= "$gtid_missing_slave" != "" + --source include/assert.inc + --let $include_silent= + --enable_result_log +} + +# +# Ensure that the transaction didn't get logged into the binary log +# +--let $event_sequence= Gtid/SET.* # Query/use.* # Gtid/SET.* # Query/XA START.* # Table_map/.* # Write_rows/.* # Query/XA END.* # XA_prepare/XA PREPARE.* # Gtid/SET.* # Query/XA COMMIT.* +--let $invert= 1 +--source include/assert_binlog_events.inc + +# +# Clear replication filters in order for the transaction to succeed. +# +CHANGE REPLICATION FILTER Replicate_Ignore_Table=(); +--let $slave_sql_errno= +--source include/start_slave_sql.inc +--source include/rpl_connection_master.inc --source include/sync_slave_sql_with_master.inc +--let $count = `SELECT COUNT(1) FROM test.t1;` +--let $assert_text = table 'test.t1' record count must be 1 +--let $assert_cond = $count = 1 +--source include/assert.inc ---echo # ---echo # 4) Ensure that the error message get logged to the slave error log file. ---echo # +# +# 4) Ensure that the error message get logged to the slave error log file. +# --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err ---let $assert_only_after= CURRENT_TEST: rpl_gtid:rpl_xa_with_filters_error_msg +--let $assert_only_after= CURRENT_TEST: rpl:rpl_xa_with_filters_error_msg --let $assert_match= The use of replication filters with XA transactions is not supported, and can lead to an undefined state in the replication slave --let $assert_select= Slave SQL --let $assert_text= Found error message regarding usage of replication filters with XA transactions @@ -55,12 +109,5 @@ XA COMMIT '1'; --source include/rpl_connection_master.inc DROP TABLE t1; ---source include/sync_slave_sql_with_master.inc - ---let $slave_sql_errno= convert_error(ER_XA_REPLICATION_FILTERS) - ---source include/stop_slave_sql.inc -CHANGE REPLICATION FILTER Replicate_Do_Table=(); ---source include/start_slave_sql.inc --source include/rpl_end.inc diff --git a/sql/binlog.cc b/sql/binlog.cc index fd0670577b5f..939b5ee929c3 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -2926,6 +2926,28 @@ File open_binlog_file(IO_CACHE *log, const char *log_file_name, const char **err DBUG_RETURN(-1); } +bool is_transaction_empty(THD *thd) +{ + DBUG_ENTER("is_transaction_empty"); + int rw_ha_count= check_trx_rw_engines(thd, Transaction_ctx::SESSION); + rw_ha_count+= check_trx_rw_engines(thd, Transaction_ctx::STMT); + DBUG_RETURN(rw_ha_count == 0); +} + +int check_trx_rw_engines(THD *thd, Transaction_ctx::enum_trx_scope trx_scope) +{ + DBUG_ENTER("check_trx_rw_engines"); + + int rw_ha_count= 0; + Ha_trx_info *ha_list= + (Ha_trx_info *)thd->get_transaction()->ha_trx_info(trx_scope); + + for (Ha_trx_info *ha_info= ha_list; ha_info; ha_info= ha_info->next()) { + if (ha_info->is_trx_read_write()) + ++rw_ha_count; + } + DBUG_RETURN(rw_ha_count); +} bool is_empty_transaction_in_binlog_cache(const THD* thd) { diff --git a/sql/binlog.h b/sql/binlog.h index 0bfb1daf7981..6da080179bed 100644 --- a/sql/binlog.h +++ b/sql/binlog.h @@ -933,6 +933,26 @@ typedef struct st_load_file_info extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log; +/** + Check if the the transaction is empty. + + @param thd The client thread that executed the current statement. + + @retval true No changes found in any storage engine + @retval false Otherwise. + +**/ +bool is_transaction_empty(THD* thd); +/** + Check if the transaction has no rw flag set for any of the storage engines. + + @param thd The client thread that executed the current statement. + @param trx_scope The transaction scope to look into. + + @retval the number of engines which have actual changes. + */ +int check_trx_rw_engines(THD *thd, Transaction_ctx::enum_trx_scope trx_scope); + /** Check if at least one of transacaction and statement binlog caches contains an empty transaction, other one is empty or contains an empty transaction, diff --git a/sql/log_event.cc b/sql/log_event.cc index 94fe6914b84e..62ddd235a754 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7513,7 +7513,9 @@ bool XA_prepare_log_event::do_commit(THD *thd) thd->lex->m_sql_cmd= new Sql_cmd_xa_commit(&xid, XA_ONE_PHASE); error= thd->lex->m_sql_cmd->execute(thd); } - error|= mysql_bin_log.gtid_end_transaction(thd); + + if (!error) + error = mysql_bin_log.gtid_end_transaction(thd); return error; } diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 7be93d6b78c5..9ab5b8cabd91 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1825,11 +1825,14 @@ void Relay_log_info::cleanup_context(THD *thd, bool error) if (!xid_state->has_state(XID_STATE::XA_NOTR)) { DBUG_ASSERT(DBUG_EVALUATE_IF("simulate_commit_failure",1, - xid_state->has_state(XID_STATE::XA_ACTIVE))); + xid_state->has_state(XID_STATE::XA_ACTIVE) || + xid_state->has_state(XID_STATE::XA_IDLE) + )); xa_trans_force_rollback(thd); xid_state->reset(); cleanup_trans_state(thd); + thd->rpl_unflag_detached_engine_ha_data(); } thd->mdl_context.release_transactional_locks(); } diff --git a/sql/xa.cc b/sql/xa.cc index 1814db41a534..24249589751d 100644 --- a/sql/xa.cc +++ b/sql/xa.cc @@ -798,8 +798,13 @@ bool Sql_cmd_xa_prepare::trans_xa_prepare(THD *thd) my_error(ER_XAER_RMFAIL, MYF(0), xid_state->state_name()); else if (!xid_state->has_same_xid(m_xid)) my_error(ER_XAER_NOTA, MYF(0)); - else - { + else if (thd->slave_thread && + is_transaction_empty( + thd)) // No changes in none of the storage engine + // means, filtered statements in the slave + my_error(ER_XA_REPLICATION_FILTERS, + MYF(0)); // Empty XA transactions not allowed + else { /* Acquire metadata lock which will ensure that XA PREPARE is blocked by active FLUSH TABLES WITH READ LOCK (and vice versa PREPARE in From 354663d2d1d2e6fd2438e3b42fcd4acfb55e735a Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 8 Oct 2018 21:16:23 +0200 Subject: [PATCH 047/214] From e15cfed25d1a437d8e6a09883561576a2bf67106 Mon Sep 17 00:00:00 2001 From: Mauritz Sundell Date: Mon, 8 Oct 2018 21:20:13 +0200 Subject: [PATCH 048/214] =?UTF-8?q?Bug#21550054=20Make=20failing=20test=20?= =?UTF-8?q?sysschema.v=5Fwait=5Fclasses=5Fglobal=5Fby=5Favg=5Flatency=20ex?= =?UTF-8?q?perimental=20[noclos=E2=82=AC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mysql-test/collections/default.experimental | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index f1f14a2f9432..bd739bf096eb 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -22,6 +22,8 @@ perfschema.transaction_nested_events # Bug#17752288 2013-12-17 agopi Fails s main.ssl-big @windows # Bug#18200216 2014-03-14 horst Fails too often in daily in PB2. rpl.rpl_gtid_stress_failover # Bug#16409537 2014-09-18 Shiv Fails often on weekly and daily trunk branches +sysschema.v_wait_classes_global_by_avg_latency # Bug#21550054 2018-10-08 msundell Fails for 5.7 + interactive_utilities.mysql_secure_installation #Bug19077239 2014-09-18 Sneha Fails often on daily trunk branches interactive_utilities.mysql_secure_installation_ssl #Bug19077239 2014-09-18 Sneha Fails often on daily trunk branches From 79938b35123c1254c53a77a62db2691844a24567 Mon Sep 17 00:00:00 2001 From: Mauritz Sundell Date: Mon, 8 Oct 2018 21:34:18 +0200 Subject: [PATCH 049/214] Bug#28763561 Make failing group_replication.gr_exit_state_action_on_join_wrong_gtid_assignment_block_size experimental [noclose] --- .../group_replication/tests/collections/default.experimental | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rapid/plugin/group_replication/tests/collections/default.experimental b/rapid/plugin/group_replication/tests/collections/default.experimental index 310c5268ac3e..08d547cb2159 100644 --- a/rapid/plugin/group_replication/tests/collections/default.experimental +++ b/rapid/plugin/group_replication/tests/collections/default.experimental @@ -1,2 +1,4 @@ # For easier human reading (MTR doesn't care), please keep entries # in alphabetical order. This also helps with merge conflict resolution. + +group_replication.gr_exit_state_action_on_join_wrong_gtid_assignment_block_size # Bug#28763561 2018-10-08 msundell Fails for mysql-5.7 From 23827731b1cb8bfba5d6b259b9d293cd56a01895 Mon Sep 17 00:00:00 2001 From: Mauritz Sundell Date: Mon, 8 Oct 2018 21:49:43 +0200 Subject: [PATCH 050/214] Bug#28763637 Make failing group_replication.gr_exit_state_action_on_join_wrong_hash_algorithm experimental [noclose] --- .../group_replication/tests/collections/default.experimental | 1 + 1 file changed, 1 insertion(+) diff --git a/rapid/plugin/group_replication/tests/collections/default.experimental b/rapid/plugin/group_replication/tests/collections/default.experimental index 08d547cb2159..bb8453e18fef 100644 --- a/rapid/plugin/group_replication/tests/collections/default.experimental +++ b/rapid/plugin/group_replication/tests/collections/default.experimental @@ -2,3 +2,4 @@ # in alphabetical order. This also helps with merge conflict resolution. group_replication.gr_exit_state_action_on_join_wrong_gtid_assignment_block_size # Bug#28763561 2018-10-08 msundell Fails for mysql-5.7 +group_replication.gr_exit_state_action_on_join_wrong_hash_algorithm # Bug#28763637 2018-10-08 msundell Fails in PB2 From 7632af008c82d54096eaffd0552c5c31a84b0fa5 Mon Sep 17 00:00:00 2001 From: Mauritz Sundell Date: Mon, 8 Oct 2018 21:53:29 +0200 Subject: [PATCH 051/214] Bug#19372763 Make failing main.internal_tmp_disk_storage_engine experimental [noclose] --- mysql-test/collections/default.experimental | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index bd739bf096eb..568c157b324a 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -5,6 +5,7 @@ main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.explain_for_connection_rqg_json @linux # Bug#20697533 2015-03-13 anitha Fails several times each day on linux platforms main.explain_for_connection_rqg_trad @linux # Bug#20697533 2015-03-20 erlend Fails several times each day on linux platforms +main.internal_tmp_disk_storage_engine # Bug#19372763 2018-10-08 msundell Fails for 5.7 innodb.log_file @windows # Bug#19363615 2014-08-22 erlend innodb.log_file fails sporadically on PB2 innodb.log_file_name # Bug#19442959 2014-08-14 marko calling exit() trips ut_ad(!m_freed) From a64cc8afdf93a036eb5f1fefa931300e170e7568 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 8 Oct 2018 22:12:12 +0200 Subject: [PATCH 052/214] From 9f81ac69fc9ac1607a0bcdf2d27b24cb484525a4 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Tue, 9 Oct 2018 12:03:35 +0530 Subject: [PATCH 053/214] Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERY Issue: ------ When a subquery contains UNION the count of the number of subquery columns is calculated incorrectly. Only the first query block in the subquery's UNION is considered and an array indexing goes out-of-bounds, and this is caught by an assert. Solution: --------- Sum up the columns from all query blocks of the query expression. Change specific to 5.6/5.5: --------------------------- The "child" points to the last query block of the UNION (as opposed to 5.7+ where it points to the first member of UNION). So "child->master_unit()->first_select()" is used to reach the first query block of UNION. --- sql/sql_yacc.yy | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 328fb1381963..85c0ae4002bd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -14148,19 +14148,21 @@ subselect_end: lex->current_select = lex->current_select->return_after_parsing(); lex->nest_level--; lex->current_select->n_child_sum_items += child->n_sum_items; - /* - A subselect can add fields to an outer select. Reserve space for - them. - */ - lex->current_select->select_n_where_fields+= - child->select_n_where_fields; /* - Aggregate functions in having clause may add fields to an outer - select. Count them also. + A subquery (and all the subsequent query blocks in a UNION) can + add columns to an outer query block. Reserve space for them. + Aggregate functions in having clause can also add fields to an + outer select. */ - lex->current_select->select_n_having_items+= - child->select_n_having_items; + for (SELECT_LEX *temp= child->master_unit()->first_select(); + temp != NULL; temp= temp->next_select()) + { + lex->current_select->select_n_where_fields+= + temp->select_n_where_fields; + lex->current_select->select_n_having_items+= + temp->select_n_having_items; + } } ; From 2a07e8d69f35a94fb0133011e3ea84ca6072171d Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 24 Sep 2018 13:16:23 +0200 Subject: [PATCH 054/214] Bug#28693568 MEMORY LEAK IN EMBEDDED SERVER Backport patch from 8.0 to avoid dangling char* pointer for filepath. Change-Id: I049dceaec9103b9ba93e58732b92c412459ead7a --- storage/innobase/row/row0merge.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 8c6bf0b55888..03091e64489f 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -3739,12 +3739,12 @@ row_merge_file_create_low( file APIs, add instrumentation to register with performance schema */ struct PSI_file_locker* locker = NULL; - char *filepath = NULL; - filepath = - fil_make_filepath(path, "Innodb Merge Temp File", NO_EXT, false); + Datafile df; + df.make_filepath(path, "Innodb Merge Temp File", NO_EXT); + PSI_file_locker_state state; locker = PSI_FILE_CALL(get_thread_file_name_locker)( - &state, innodb_temp_file_key.m_value, PSI_FILE_OPEN, filepath, + &state, innodb_temp_file_key.m_value, PSI_FILE_OPEN, df.filepath(), &locker); if (locker != NULL) { PSI_FILE_CALL(start_file_open_wait)(locker, From 98b0e4f771f4b94fb968e65cc2fe88adce67d546 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 8 Oct 2018 12:21:11 +0200 Subject: [PATCH 055/214] Explicitly set -std=gnu++03 for clang >= 6.0 Same thing as the patch for gcc: Bug#22732697: MYSQL FAILS TO BUILD WITH NEW DEFAULT MODE IN GCC6 Change-Id: I9ef99a2e4bbc04aa19759db31482f6c2f6fb2d91 --- cmake/build_configurations/compiler_options.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/build_configurations/compiler_options.cmake b/cmake/build_configurations/compiler_options.cmake index 17bd5aeb591b..367b1c580e76 100644 --- a/cmake/build_configurations/compiler_options.cmake +++ b/cmake/build_configurations/compiler_options.cmake @@ -92,6 +92,12 @@ IF(UNIX) ENDIF() IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + IF(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0 OR + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=gnu++03") + ENDIF() + ENDIF() SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ENDIF() From 8b0ada5eb01798d20f3288b6cf07b299dd0d7545 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Wed, 3 Oct 2018 09:52:41 +0200 Subject: [PATCH 056/214] Bug#28737177 MAIN.INFORMATION_SCHEMA_CS FAILS WITH RESULT CONTENT MISMATCH The problem was that main.information_schema_cs (and a handful of other tests) could sometimes fail due to missing characterset comments. The root cause was the regression test for Bug#16204175 in main.ctype_uca. This test temporarily replaced share/charset/Index.xml in the source directory with its own file. If this happened to coincide with other tests depending on the original contents of Index.xml, those tests would fail. This patch fixes the problem by rewriting the regression test for Bug#16204175 such that it leaves Index.xml intact and instead restarts the server with --character-sets-dir pointing to a different directory. This is similar to what is already done in e.g. main.invalid_collation. See also duplicate Bug#19372763 SPORADIC FAILURE IN MAIN.INTERNAL_TMP_DISK_STORAGE_ENGINE Backport patch from 8.0. Change-Id: Ic1eef7b8f448ecf4620d77123e247f106fcd328a --- mysql-test/collections/default.experimental | 1 - mysql-test/r/ctype_uca.result | 8 +++-- mysql-test/std_data/bug16204175/Index.xml | 13 +++++++ mysql-test/t/ctype_uca.test | 38 ++++++--------------- 4 files changed, 29 insertions(+), 31 deletions(-) create mode 100644 mysql-test/std_data/bug16204175/Index.xml diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 568c157b324a..bd739bf096eb 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -5,7 +5,6 @@ main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.explain_for_connection_rqg_json @linux # Bug#20697533 2015-03-13 anitha Fails several times each day on linux platforms main.explain_for_connection_rqg_trad @linux # Bug#20697533 2015-03-20 erlend Fails several times each day on linux platforms -main.internal_tmp_disk_storage_engine # Bug#19372763 2018-10-08 msundell Fails for 5.7 innodb.log_file @windows # Bug#19363615 2014-08-22 erlend innodb.log_file fails sporadically on PB2 innodb.log_file_name # Bug#19442959 2014-08-14 marko calling exit() trips ut_ad(!m_freed) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 191e1adf9b45..66e7068e0509 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -7125,7 +7125,9 @@ DROP TABLE t1; # Bug #16204175 : COLLATION NAME MISSING FROM LOG MESSAGES # ABOUT LDML DEFINITION PROBLEMS # -# restart +# +# Restart the server with a collation with invalid grammar rules. +# restart:--character-sets-dir=MYSQL_TEST_DIR/std_data/bug16204175/ # Check whether the new collation is loaded after restart SHOW COLLATION LIKE 'utf8_test'; Collation Charset Id Default Compiled Sortlen @@ -7136,7 +7138,9 @@ ERROR HY000: Unknown collation: 'utf8_test' # Below error is caused as a result of this test. The error message # contains collation name which is added as a part of the fix. call mtr.add_suppression("Shift expected at '' for COLLATION : utf8_test"); -# restart +# +# Restart server with original character sets dir: +# restart:--character-sets-dir=MYSQL_CHARSETSDIR # # End of 5.6 tests # diff --git a/mysql-test/std_data/bug16204175/Index.xml b/mysql-test/std_data/bug16204175/Index.xml new file mode 100644 index 000000000000..3aa5537727f6 --- /dev/null +++ b/mysql-test/std_data/bug16204175/Index.xml @@ -0,0 +1,13 @@ + + + + Unicode + UTF-8 Unicode + utf-8 + + + A + + + + diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 3cfeb3dd3b3e..019a31f8d5ae 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -553,30 +553,11 @@ SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci; -- source include/not_embedded.inc -# Creating a temporary file for Index.xml ---copy_file $MYSQL_CHARSETSDIR/Index.xml $MYSQLTEST_VARDIR/temp.xml ---remove_file $MYSQL_CHARSETSDIR/Index.xml - -# Adding an unknown collation with invalid grammer rules. -# Please make sure the id is not used by any existing collations. ---write_file $MYSQL_CHARSETSDIR/Index.xml - - - - Unicode - UTF-8 Unicode - utf-8 - - - A - - - - -EOF - -# Restart the server --- source include/restart_mysqld.inc +--echo # +--echo # Restart the server with a collation with invalid grammar rules. +--let $restart_parameters=restart:--character-sets-dir=$MYSQL_TEST_DIR/std_data/bug16204175/ +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--source include/restart_mysqld.inc --echo # Check whether the new collation is loaded after restart SHOW COLLATION LIKE 'utf8_test'; @@ -590,10 +571,11 @@ CREATE TABLE t1(id INT PRIMARY KEY, c CHAR(1) COLLATE utf8_test); call mtr.add_suppression("Shift expected at '' for COLLATION : utf8_test"); # Cleanup ---remove_file $MYSQL_CHARSETSDIR/Index.xml ---copy_file $MYSQLTEST_VARDIR/temp.xml $MYSQL_CHARSETSDIR/Index.xml ---remove_file $MYSQLTEST_VARDIR/temp.xml --- source include/restart_mysqld.inc +--echo # +--echo # Restart server with original character sets dir: +--let $restart_parameters=restart:--character-sets-dir=$MYSQL_CHARSETSDIR +--replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--source include/restart_mysqld.inc --echo # --echo # End of 5.6 tests From 43acad2a8a1221f589f3bd78c1f09d7e0d937ff3 Mon Sep 17 00:00:00 2001 From: Aditya A Date: Wed, 10 Oct 2018 18:05:02 +0530 Subject: [PATCH 057/214] Bug #22990029 GCOLS: INCORRECT BEHAVIOR AFTER DATA INSERTED WITH IGNORE KEYWORD PROBLEM ------- 1. We are inserting a base column entry which causes an invalid value by the function provided to generate virtual column,but we go ahead and insert this due to ignore keyword. 2. We then delete this record, making this record delete marked in innodb. If we try to insert another record with the same pk as the deleted record and if the rec is not purged ,then we try to undelete mark this record and try to build a update vector with previous and updated value and while calculating the value of virtual column we get error from server that we cannot calculate this from base column. Innodb assumes that innobase_get_computed_value() Should always return a valid value for the base column present in the row. The failure of this call was not handled ,so we were crashing. FIX --- Handled the failure of innobase_get_computed_value() call. We now return error in this case and prevent a crash. --- storage/innobase/include/row0upd.h | 6 ++++-- storage/innobase/row/row0ins.cc | 8 ++++++-- storage/innobase/row/row0log.cc | 5 ++++- storage/innobase/row/row0upd.cc | 10 ++++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h index 14917985230a..6869c0d0fb8c 100644 --- a/storage/innobase/include/row0upd.h +++ b/storage/innobase/include/row0upd.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -227,6 +227,7 @@ the equal ordering fields. NOTE: we compare the fields as binary strings! @param[in] heap memory heap from which allocated @param[in,out] mysql_table NULL, or mysql table object when user thread invokes dml +@param[out] error error number in case of failure @return own: update vector of differing fields, excluding roll ptr and trx id */ upd_t* @@ -238,7 +239,8 @@ row_upd_build_difference_binary( bool no_sys, trx_t* trx, mem_heap_t* heap, - TABLE* mysql_table) + TABLE* mysql_table, + dberr_t* error) MY_ATTRIBUTE((warn_unused_result)); /***********************************************************//** Replaces the new column values stored in the update vector to the index entry diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 96071bd2efc6..e17588ecf54d 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -346,7 +346,7 @@ row_ins_clust_index_entry_by_modify( { const rec_t* rec; upd_t* update; - dberr_t err; + dberr_t err = DB_SUCCESS; btr_cur_t* cursor = btr_pcur_get_btr_cur(pcur); TABLE* mysql_table = NULL; ut_ad(dict_index_is_clust(cursor->index)); @@ -366,7 +366,11 @@ row_ins_clust_index_entry_by_modify( update = row_upd_build_difference_binary( cursor->index, entry, rec, NULL, true, - thr_get_trx(thr), heap, mysql_table); + thr_get_trx(thr), heap, mysql_table, &err); + if (err != DB_SUCCESS) { + return(err); + } + if (mode != BTR_MODIFY_TREE) { ut_ad((mode & ~BTR_ALREADY_S_LATCHED) == BTR_MODIFY_LEAF); diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 44837ef6fbfd..bfea2a8f8b42 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -2201,7 +2201,10 @@ row_log_table_apply_update( row, NULL, index, heap, ROW_BUILD_FOR_INSERT); upd_t* update = row_upd_build_difference_binary( index, entry, btr_pcur_get_rec(&pcur), cur_offsets, - false, NULL, heap, dup->table); + false, NULL, heap, dup->table, &error); + if (error != DB_SUCCESS) { + goto func_exit; + } if (!update->n_fields) { /* Nothing to do. */ diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 4d9b590301b6..2ad44083af63 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -877,8 +877,9 @@ the equal ordering fields. NOTE: we compare the fields as binary strings! @param[in] heap memory heap from which allocated @param[in] mysql_table NULL, or mysql table object when user thread invokes dml +@param[out] error error number in case of failure @return own: update vector of differing fields, excluding roll ptr and -trx id */ +trx id,if error is not equal to DB_SUCCESS, return NULL */ upd_t* row_upd_build_difference_binary( dict_index_t* index, @@ -888,7 +889,8 @@ row_upd_build_difference_binary( bool no_sys, trx_t* trx, mem_heap_t* heap, - TABLE* mysql_table) + TABLE* mysql_table, + dberr_t* error) { upd_field_t* upd_field; dfield_t* dfield; @@ -994,6 +996,10 @@ row_upd_build_difference_binary( update->old_vrow, col, index, &v_heap, heap, NULL, thd, mysql_table, NULL, NULL, NULL); + if (vfield == NULL) { + *error = DB_COMPUTE_VALUE_FAILED; + return(NULL); + } if (!dfield_data_is_binary_equal( dfield, vfield->len, From 4736e3b67ff3e2915e0c84218899529f20611a4a Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Fri, 12 Oct 2018 07:35:31 +0530 Subject: [PATCH 058/214] Bug #28086754: OPTIMIZER SKIP THE RANGE SCAN ON SECOND COLUMN IN A COMPOSITE INDEX Issue: ------ CREATE TABLE test_ref ( a INT NOT NULL, b VARCHAR(20), c VARCHAR(20), d VARCHAR(3), id INT, PRIMARY KEY (a), KEY idx1 (id, c), KEY idx2 (id, d)); SELECT * FROM test_ref WHERE id = 3 and c LIKE 'gh%' ORDER BY c LIMIT 1; On 5.7: ------- idx1 with a range access is best option for this. idx1 covers both the conditions in the WHERE clause and will support ordering since column "c" is part of the index. But the optimizer choose ref access idx1. Reasons for this (reproducible only with data from user) : 1) Table scan is calculated as cheaper than range access on idx1. So using range access is ruled out. 2) The only other option is ref-access on idx1. 3) Later stage switch back to range access on the same index (can_switch_from_ref_to_range) isn't possible because range access was rejected altogether in Step 1. The problem with ref-access is that it uses only one keypart of idx1 -> the column "id". This makes the query execution slower. On trunk: --------- 1) Table scan is cheaper than range access on idx1. Range access on idx1 is rejected. 2) But since range scan on idx1 uses more key parts than ref, the ref-access on idx1 is also rejected. 3) Initially optimizer chooses a ref-access on idx2. 4) While evaluating options for "ORDER BY" it notices that idx1 provides ordering and also doesn't change the current access method (ref). At this stage the optimizer is unaware of the reasons for rejecting ref-access on idx1 earlier (Step 2) and chooses it. Solution On both 5.7 and trunk: ------------------------------- In test_quick_select() add a new parameter to ignore the cost of table scan. Range optimizer on the relevant key will be re-run by ignoring the cost of table scan (since it was calculated to be cheaper). On 5.7: ------- If the "dodgy_ref_cost" flag is set, that is ref-access might be using less key-parts than range but was calculated to be cheaper, then re-run the range optimizer and check the same. On trunk: --------- When a ref-access is chosen, check if it is possible to switch to range-access if more keyparts will be used. To achieve this call can_switch_from_ref_to_range() from test_if_skip_sort_order() when index for ref-access has changed. In can_switch_from_ref_to_range(), add a new parameter to force the switch to range even if it was rejected previously because a table scan is cheaper. --- mysql-test/include/range.inc | 147 +++++ mysql-test/r/opt_hints.result | 10 +- mysql-test/r/range_all.result | 48 ++ mysql-test/r/range_icp.result | 50 +- mysql-test/r/range_icp_mrr.result | 48 ++ mysql-test/r/range_mrr.result | 48 ++ mysql-test/r/range_mrr_cost.result | 50 +- mysql-test/r/range_none.result | 50 +- mysql-test/r/range_with_memory_limit.result | 54 ++ .../suite/gcol/r/gcol_keys_innodb.result | 4 + .../suite/gcol/r/gcol_keys_myisam.result | 4 + mysql-test/suite/opt_trace/include/range.inc | 6 - .../suite/opt_trace/r/bugs_no_prot_all.result | 4 + .../opt_trace/r/bugs_no_prot_none.result | 4 + .../suite/opt_trace/r/bugs_ps_prot_all.result | 4 + .../opt_trace/r/bugs_ps_prot_none.result | 4 + .../suite/opt_trace/r/range_no_prot.result | 575 +++++++++--------- .../suite/opt_trace/r/range_ps_prot.result | 575 +++++++++--------- sql/opt_range.cc | 9 +- sql/opt_range.h | 7 +- sql/sql_delete.cc | 3 +- sql/sql_executor.cc | 5 +- sql/sql_help.cc | 4 +- sql/sql_optimizer.cc | 57 +- sql/sql_update.cc | 3 +- 25 files changed, 1168 insertions(+), 605 deletions(-) diff --git a/mysql-test/include/range.inc b/mysql-test/include/range.inc index 1ff33c0aa2b6..b45f9e4e4d49 100644 --- a/mysql-test/include/range.inc +++ b/mysql-test/include/range.inc @@ -2544,3 +2544,150 @@ SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; + +--echo # +--echo # Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +--echo # COMPOSITE INDEX +--echo # + +CREATE TABLE test_ref ( + a INT PRIMARY KEY, + b VARCHAR(20), + c VARCHAR(20) DEFAULT NULL, + d VARCHAR(3) DEFAULT NULL, + id INT DEFAULT NULL, + KEY idx1 (id, c), + KEY idx2 (id, d)) ENGINE=INNODB ; + +--disable_query_log +INSERT INTO test_ref VALUES +( 27699, 'D007', 'gheennse', 'S', 7), +( 34876, 'D003', 'gheennse', 'S', 3), +( 70714, 'D007', 'gheennse', 'S', 7), +( 71945, 'D005', 'gheennse', 'S', 5), +( 95929, 'D003', 'gheennse', 'D', 3), +( 129342, 'D002', 'gheennse', 'S', 2), +( 146471, 'D003', 'gheennse', 'S', 3), +( 186302, 'D003', 'gheennse', 'S', 3), +( 248098, 'D003', 'gheennse', 'S', 3), +( 308317, 'D003', 'gheennse', 'D', 3), +( 317360, 'D005', 'gheennse', 'D', 5), +( 444176, 'D003', 'gheennse', 'A', 3), +( 460871, 'D003', 'gheennse', 'D', 3), +( 462396, 'D002', 'gheennse', 'S', 2), +( 477701, 'D007', 'gheennse', 'D', 7), +( 503689, 'D003', 'gheennse', 'S', 3), +( 505492, 'D003', 'gheennse', 'DD', 3), +( 516238, 'D003', 'gheennse', 'S', 3), +( 534333, 'D002', 'gheennse', 'D', 2), +( 565439, 'D007', 'gheennse', 'D', 7), +( 577221, 'D002', 'gheennse', 'S', 2), +( 633762, 'D002', 'gheennse', 'S', 2), +( 670506, 'D002', 'gheennse', 'D', 2), +( 676921, 'D007', 'gheennse', 'D', 7), +( 680607, 'D002', 'gheennse', 'D', 2), +( 694397, 'D003', 'gheennse', 'S', 3), +( 714547, 'D003', 'gheennse', 'S', 3), +( 717856, 'D003', 'gheennse', 'D', 3), +( 808061, 'D003', 'gheennse', 'S', 3), +( 864526, 'D003', 'gheennse', 'S', 3), +( 890043, 'D007', 'gheennse', 'S', 7), +( 910633, 'D003', 'gheennse', 'S', 3), +( 948201, 'D002', 'gheennse', 'S', 2), +( 949220, 'D005', 'gheennse', 'S', 5), +( 960404, 'D003', 'gheennse', 'S', 3), +( 1092448, 'D007', 'gheennse', 'D', 7), +( 1104681, 'D002', 'gheennse', 'S', 2), +( 1123559, 'D003', 'gheennse', 'S', 3), +( 1129004, 'D003', 'gheennse', 'S', 3), +( 1158830, 'D005', 'gheennse', 'D', 5), +( 1181872, 'D003', 'gheennse', 'S', 3), +( 1244160, 'D005', 'gheennse', 'S', 5), +( 1248290, 'D005', 'gheennse', 'D', 5), +( 1271990, 'D005', 'gheennse', 'S', 5), +( 1292696, 'D003', 'gheennse', 'S', 3), +( 1334421, 'D002', 'gheennse', 'S', 2), +( 1386182, 'D007', 'gheennse', 'S', 7), +( 1432466, 'D007', 'gheennse', 'D', 7), +( 1604224, 'D003', 'gheennse', 'S', 3), +( 1635704, 'D007', 'gheennse', 'S', 7), +( 1762832, 'D003', 'gheennse', 'D', 3), +( 1770649, 'D003', 'gheennse', 'S', 3), +( 1770299, 'D003', 'gheennse', 'S', 3), +( 1770399, 'D003', 'gheennse', 'S', 3), +( 1896320, 'D005', 'gheennse', 'S', 5), +( 1946091, 'D007', 'gheennse', 'S', 7), +( 1955807, 'D007', 'gheennse', 'S', 7), +( 1981281, 'D002', 'gheennse', 'D', 2), +( 1984746, 'D002', 'gheennse', 'S', 2), +( 2011617, 'D002', 'gheennse', 'S', 2), +( 2021745, 'D005', 'gheennse', 'D', 5), +( 2058339, 'D002', 'cheennse', 'D', 2), +( 2088903, 'D002', 'cheennse', 'S', 2), +( 2170936, 'D003', 'cheennse', 'S', 3), +( 2191014, 'D007', 'cheennse', 'S', 7), +( 2359396, 'D003', 'cheennse', 'D', 3), +( 2392181, 'D003', 'cheennse', 'D', 3), +( 2509548, 'D002', 'cheennse', 'D', 2), +( 2524317, 'D002', 'cheennse', 'S', 2), +( 2532146, 'D003', 'cheennse', 'S', 3), +( 2554387, 'D003', 'cheennse', 'S', 3), +( 2615723, 'D003', 'cheennse', 'D', 3), +( 2769368, 'D007', 'cheennse', 'S', 7), +( 2788698, 'D002', 'cheennse', 'D', 2), +( 2900141, 'D003', 'cheennse', 'D', 3), +( 2916874, 'D003', 'cheennse', 'S', 3), +( 2917505, 'D005', 'cheennse', 'D', 5), +( 3049543, 'D007', 'cheennse', 'D', 7), +( 3054225, 'D005', 'cheennse', 'S', 5), +( 3127100, 'D005', 'cheennse', 'S', 5), +( 3231967, 'D003', 'cheennse', 'DD', 3), +( 3239080, 'D005', 'cheennse', 'DD', 5), +( 3245821, 'D003', 'cheennse', 'DD', 3), +( 3492641, 'D003', 'cheennse', 'DD', 3), +( 3502099, 'D003', 'cheennse', 'S', 3), +( 3502400, 'D005', 'cheennse', 'DD', 5), +( 3652408, 'D003', 'cheennse', 'DD', 3), +( 3671827, 'D003', 'cheennse', 'S', 3), +( 3739085, 'D007', 'cheennse', 'S', 7), +( 3856727, 'D007', 'cheennse', 'S', 7), +( 3871123, 'D003', 'cheennse', 'S', 3), +( 3955047, 'D002', 'cheennse', 'DD', 2), +( 3995249, 'D003', 'cheennse', 'S', 3), +( 3996816, 'D002', 'cheennse', 'S', 2), +( 4037006, 'D003', 'cheennse', 'S', 3), +( 4040042, 'D003', 'cheennse', 'S', 3), +( 4126972, 'D003', 'cheennse', 'S', 3), +( 4163290, 'D005', 'cheennse', 'DD', 5), +( 4170771, 'D002', 'cheennse', 'DD', 2), +( 4209586, 'D003', 'cheennse', 'S', 3), +( 4267486, 'D003', 'cheennse', 'S', 3), +( 4317590, 'D005', 'cheennse', 'S', 5), +( 4318938, 'D002', 'cheennse', 'S', 2), +( 4363730, 'D007', 'cheennse', 'D', 7), +( 4455095, 'D005', 'cheennse', 'S', 5); +--enable_query_log +ANALYZE TABLE test_ref; + +let query1= +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; + +# test with descending order +let query2= +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; + +eval EXPLAIN $query1; +eval $query1; + +eval EXPLAIN $query2; +eval $query2; + +DROP TABLE test_ref; diff --git a/mysql-test/r/opt_hints.result b/mysql-test/r/opt_hints.result index 8047acffcffa..d4c3173c8640 100644 --- a/mysql-test/r/opt_hints.result +++ b/mysql-test/r/opt_hints.result @@ -102,21 +102,21 @@ EXPLAIN SELECT f2 FROM (SELECT f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using index condition +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) EXPLAIN SELECT /*+ NO_ICP(t3@qb1 f3_idx) */ f2 FROM (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using where Warnings: Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1` `f3_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) EXPLAIN SELECT /*+ NO_ICP(t3@qb1) */ f2 FROM (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using where Warnings: Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) # Expected warning for f1_idx key, unresolved name. @@ -124,7 +124,7 @@ EXPLAIN SELECT f2 FROM (SELECT /*+ NO_ICP(t3 f3_idx, f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using where Warnings: Warning 3128 Unresolved name `t3`@`select#2` `f1_idx` for NO_ICP hint Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f3_idx`) NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) @@ -133,7 +133,7 @@ EXPLAIN SELECT f2 FROM (SELECT /*+ NO_ICP(t3 f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using index condition +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using index condition Warnings: Warning 3128 Unresolved name `t3`@`select#2` `f1_idx` for NO_ICP hint Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) diff --git a/mysql-test/r/range_all.result b/mysql-test/r/range_all.result index c68ee9b54066..4d8b669fc20d 100644 --- a/mysql-test/r/range_all.result +++ b/mysql-test/r/range_all.result @@ -3687,4 +3687,52 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +DROP TABLE test_ref; set optimizer_switch=default; diff --git a/mysql-test/r/range_icp.result b/mysql-test/r/range_icp.result index 58d55e7dc221..dc7d45f1a4ee 100644 --- a/mysql-test/r/range_icp.result +++ b/mysql-test/r/range_icp.result @@ -1361,7 +1361,7 @@ Z In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using index condition +1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3687,4 +3687,52 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +DROP TABLE test_ref; set optimizer_switch=default; diff --git a/mysql-test/r/range_icp_mrr.result b/mysql-test/r/range_icp_mrr.result index 6ce7f6c981d4..9f512c786148 100644 --- a/mysql-test/r/range_icp_mrr.result +++ b/mysql-test/r/range_icp_mrr.result @@ -3687,4 +3687,52 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +DROP TABLE test_ref; set optimizer_switch=default; diff --git a/mysql-test/r/range_mrr.result b/mysql-test/r/range_mrr.result index daecc0d27858..299fce6e435e 100644 --- a/mysql-test/r/range_mrr.result +++ b/mysql-test/r/range_mrr.result @@ -3687,4 +3687,52 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +DROP TABLE test_ref; set optimizer_switch=default; diff --git a/mysql-test/r/range_mrr_cost.result b/mysql-test/r/range_mrr_cost.result index de3d0e46d7c0..73258a9dc922 100644 --- a/mysql-test/r/range_mrr_cost.result +++ b/mysql-test/r/range_mrr_cost.result @@ -1361,7 +1361,7 @@ Z In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using where +1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3687,4 +3687,52 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +DROP TABLE test_ref; set optimizer_switch=default; diff --git a/mysql-test/r/range_none.result b/mysql-test/r/range_none.result index 047effcc3b6c..ecc67f21c1fc 100644 --- a/mysql-test/r/range_none.result +++ b/mysql-test/r/range_none.result @@ -1360,7 +1360,7 @@ Z In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using where +1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3686,4 +3686,52 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +DROP TABLE test_ref; set optimizer_switch=default; diff --git a/mysql-test/r/range_with_memory_limit.result b/mysql-test/r/range_with_memory_limit.result index 455cd2dc91a4..de71b52bf918 100644 --- a/mysql-test/r/range_with_memory_limit.result +++ b/mysql-test/r/range_with_memory_limit.result @@ -4206,5 +4206,59 @@ SELECT @trace RLIKE "uses_more_keyparts"; SET optimizer_trace="enabled=off"; DROP PROCEDURE p; DROP TABLE t1, transactions; +# +# Bug #28086754: OPTIMIZER SKIP THE RANG SCAN ON SECOND COLUMN IN A +# COMPOSITE INDEX +# +CREATE TABLE test_ref ( +a INT PRIMARY KEY, +b VARCHAR(20), +c VARCHAR(20) DEFAULT NULL, +d VARCHAR(3) DEFAULT NULL, +id INT DEFAULT NULL, +KEY idx1 (id, c), +KEY idx2 (id, d)) ENGINE=INNODB ; +ANALYZE TABLE test_ref; +Table Op Msg_type Msg_text +test.test_ref analyze status OK +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 26 11.11 Using index condition +Warnings: +Warning 3170 Memory capacity of 50 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query. +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c +LIMIT 1; +a b c d id +34876 D003 gheennse S 3 +Warnings: +Warning 3170 Memory capacity of 50 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query. +EXPLAIN SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 26 11.11 Using where +Warnings: +Warning 3170 Memory capacity of 50 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query. +Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 +SELECT * +FROM test_ref +WHERE id=3 AND c LIKE 'gh%' +ORDER BY c DESC +LIMIT 1; +a b c d id +1770649 D003 gheennse S 3 +Warnings: +Warning 3170 Memory capacity of 50 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query. +DROP TABLE test_ref; SET RANGE_OPTIMIZER_MAX_MEM_SIZE= DEFAULT; # End of test for Bug#17769777 and Bug#17413040 diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result index 38e0613f7384..f2a4cec19cbe 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -719,6 +719,8 @@ EXPLAIN SELECT * FROM t1 ORDER BY f1 + 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -898,6 +900,8 @@ EXPLAIN SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index 604950ad1562..0eef8d36e08b 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -491,6 +491,8 @@ EXPLAIN SELECT * FROM t1 ORDER BY f1 + 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": false, @@ -669,6 +671,8 @@ EXPLAIN SELECT f1 + 1, MAX(GC) FROM t1 GROUP BY f1 + 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": false, diff --git a/mysql-test/suite/opt_trace/include/range.inc b/mysql-test/suite/opt_trace/include/range.inc index 0a80473a6a8a..c9d64c47d2c8 100644 --- a/mysql-test/suite/opt_trace/include/range.inc +++ b/mysql-test/suite/opt_trace/include/range.inc @@ -304,12 +304,6 @@ SELECT * FROM information_schema.OPTIMIZER_TRACE; --echo drop table t1; ---echo # ---echo # Tracing of when test_if_skip_sort_order() switches to another ---echo # index and we abandon ICP, ---echo # see "disabling_pushed_condition_on_old_index" in trace. ---echo # - CREATE TABLE t1 ( c1 VARCHAR(2) NOT NULL, i1 INTEGER NOT NULL, diff --git a/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result b/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result index 776110fad3ec..c96f88b716c1 100644 --- a/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result +++ b/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result @@ -3244,6 +3244,8 @@ SELECT 1 FROM t1 WHERE 1 LIKE { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -3623,6 +3625,8 @@ EXPLAIN SELECT c1, c2 FROM t1 ORDER BY c1 DESC LIMIT 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result b/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result index b26ce54a8eee..82bd7c72adec 100644 --- a/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result +++ b/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result @@ -2405,6 +2405,8 @@ SELECT 1 FROM t1 WHERE 1 LIKE { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -2784,6 +2786,8 @@ EXPLAIN SELECT c1, c2 FROM t1 ORDER BY c1 DESC LIMIT 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result b/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result index d066b990f89a..017bc8c42add 100644 --- a/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result +++ b/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result @@ -3085,6 +3085,8 @@ SELECT 1 FROM t1 WHERE 1 LIKE { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -3464,6 +3466,8 @@ EXPLAIN SELECT c1, c2 FROM t1 ORDER BY c1 DESC LIMIT 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result b/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result index 62d69e09860a..03b8e53c8b02 100644 --- a/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result +++ b/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result @@ -2286,6 +2286,8 @@ SELECT 1 FROM t1 WHERE 1 LIKE { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -2665,6 +2667,8 @@ EXPLAIN SELECT c1, c2 FROM t1 ORDER BY c1 DESC LIMIT 1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/mysql-test/suite/opt_trace/r/range_no_prot.result b/mysql-test/suite/opt_trace/r/range_no_prot.result index 972e20257fb7..80b09ae3fc84 100644 --- a/mysql-test/suite/opt_trace/r/range_no_prot.result +++ b/mysql-test/suite/opt_trace/r/range_no_prot.result @@ -895,6 +895,8 @@ EXPLAIN SELECT key2, MIN(key2_1) FROM t2 GROUP BY key2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t2`", "index_provides_order": true, @@ -1121,6 +1123,8 @@ EXPLAIN SELECT DISTINCT key2 FROM t2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t2`", "index_provides_order": true, @@ -1438,6 +1442,8 @@ GROUP BY key2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t2`", "index_provides_order": true, @@ -4751,71 +4757,75 @@ EXPLAIN SELECT * FROM t1 WHERE i1 > '2' ORDER BY i1, i2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", - "rows_estimation": { - "table": "`t1`", - "index": "k2", - "range_analysis": { - "table_scan": { - "rows": 2, - "cost": 4.5049 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "k1", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "k2", - "usable": true, - "key_parts": [ - "i1", - "i2" - ] /* key_parts */ - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "k2", - "ranges": [ - "2 < i1" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, + "steps": [ + { + "rows_estimation": { + "table": "`t1`", + "index": "k2", + "range_analysis": { + "table_scan": { "rows": 2, - "cost": 3.41, + "cost": 4.5049 + } /* table_scan */, + "potential_range_indexes": [ + { + "index": "k1", + "usable": false, + "cause": "not_applicable" + }, + { + "index": "k2", + "usable": true, + "key_parts": [ + "i1", + "i2" + ] /* key_parts */ + } + ] /* potential_range_indexes */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "chosen": false, + "cause": "not_group_by_or_distinct" + } /* group_index_range */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "k2", + "ranges": [ + "2 < i1" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": false, + "using_mrr": false, + "index_only": false, + "rows": 2, + "cost": 3.41, + "chosen": true + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "range_scan", + "index": "k2", + "rows": 2, + "ranges": [ + "2 < i1" + ] /* ranges */ + } /* range_access_plan */, + "rows_for_plan": 2, + "cost_for_plan": 3.41, "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "k2", - "rows": 2, - "ranges": [ - "2 < i1" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 3.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } /* rows_estimation */, + } /* chosen_range_access_summary */ + } /* range_analysis */ + } /* rows_estimation */ + } + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5083,6 +5093,8 @@ EXPLAIN SELECT DISTINCT i1 FROM t1 WHERE i1 >= '1' ORDER BY i1 DESC { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5095,6 +5107,8 @@ EXPLAIN SELECT DISTINCT i1 FROM t1 WHERE i1 >= '1' ORDER BY i1 DESC { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5120,6 +5134,8 @@ EXPLAIN SELECT DISTINCT i1 FROM t1 WHERE i1 >= '1' ORDER BY i1 DESC { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5414,67 +5430,69 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { ] /* considered_execution_plans */ }, { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "i1_idx", - "usable": true, - "key_parts": [ - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "v_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "v_idx", - "cost": 2.0063, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ + "check_if_range_uses_more_keyparts_than_ref": { + "rerunning_range_optimizer_for_single_index": { + "range_analysis": { + "table_scan": { + "rows": 5, + "cost": 2e308 + } /* table_scan */, + "potential_range_indexes": [ + { + "index": "PRIMARY", + "usable": false, + "cause": "not_applicable" + }, { "index": "i1_idx", - "ranges": [ - "1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": false, - "cause": "cost" + "usable": true, + "key_parts": [ + "i1", + "pk" + ] /* key_parts */ + }, + { + "index": "v_idx", + "usable": false, + "cause": "not_applicable" } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ + ] /* potential_range_indexes */, + "best_covering_index_scan": { + "index": "v_idx", + "cost": 2.0063, + "chosen": true + } /* best_covering_index_scan */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "chosen": false, + "cause": "not_group_by_or_distinct" + } /* group_index_range */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "i1_idx", + "ranges": [ + "1 <= i1 <= 1 AND pk < 3" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.21, + "chosen": false, + "cause": "cost" + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */ + } /* range_analysis */ + } /* rerunning_range_optimizer_for_single_index */ + } /* check_if_range_uses_more_keyparts_than_ref */ }, { "attaching_conditions_to_tables": { @@ -5796,75 +5814,77 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3 { ] /* considered_execution_plans */ }, { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "v_idx", - "usable": true, - "key_parts": [ - "v", - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "i1_i2_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ + "check_if_range_uses_more_keyparts_than_ref": { + "rerunning_range_optimizer_for_single_index": { + "range_analysis": { + "table_scan": { + "rows": 5, + "cost": 2e308 + } /* table_scan */, + "potential_range_indexes": [ { + "index": "PRIMARY", + "usable": false, + "cause": "not_applicable" + }, + { + "index": "v_idx", + "usable": true, + "key_parts": [ + "v", + "i1", + "pk" + ] /* key_parts */ + }, + { + "index": "i1_i2_idx", + "usable": false, + "cause": "not_applicable" + } + ] /* potential_range_indexes */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "chosen": false, + "cause": "not_group_by_or_distinct" + } /* group_index_range */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "v_idx", + "ranges": [ + "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.21, + "chosen": true + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "range_scan", "index": "v_idx", + "rows": 1, "ranges": [ "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "v_idx", - "rows": 1, - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 1, - "cost_for_plan": 2.21, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ + ] /* ranges */ + } /* range_access_plan */, + "rows_for_plan": 1, + "cost_for_plan": 2.21, + "chosen": true + } /* chosen_range_access_summary */ + } /* range_analysis */ + } /* rerunning_range_optimizer_for_single_index */ + } /* check_if_range_uses_more_keyparts_than_ref */ }, { "access_type_changed": { @@ -6142,89 +6162,50 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { ] /* considered_execution_plans */ }, { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 4, - "cost": 3.9 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "b", - "cost": 1.8044, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "potential_group_range_indexes": [ + "check_if_range_uses_more_keyparts_than_ref": { + "rerunning_range_optimizer_for_single_index": { + "range_analysis": { + "table_scan": { + "rows": 4, + "cost": 2e308 + } /* table_scan */, + "potential_range_indexes": [ { "index": "PRIMARY", - "covering": true, - "index_dives_for_eq_ranges": true, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "rows": 2, - "cost": 1.6 - } - ] /* potential_group_range_indexes */ - } /* group_index_range */, - "best_group_range_summary": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "chosen": true - } /* best_group_range_summary */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ + "usable": true, + "key_parts": [ + "a", + "b" + ] /* key_parts */ + }, { - "index": "PRIMARY", - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2, - "cost": 2.41, - "chosen": false, - "cause": "cost" + "index": "b", + "usable": false, + "cause": "not_applicable" } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { + ] /* potential_range_indexes */, + "best_covering_index_scan": { + "index": "b", + "cost": 1.8044, + "chosen": true + } /* best_covering_index_scan */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "potential_group_range_indexes": [ + { + "index": "PRIMARY", + "covering": true, + "index_dives_for_eq_ranges": true, + "ranges": [ + "1 <= a <= 1 AND b < 2" + ] /* ranges */, + "rows": 2, + "cost": 1.6 + } + ] /* potential_group_range_indexes */ + } /* group_index_range */, + "best_group_range_summary": { "type": "index_group", "index": "PRIMARY", "group_attribute": "b", @@ -6238,14 +6219,55 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { ] /* key_parts_used_for_access */, "ranges": [ "1 <= a <= 1 AND b < 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 1.6, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ + ] /* ranges */, + "chosen": true + } /* best_group_range_summary */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "PRIMARY", + "ranges": [ + "1 <= a <= 1 AND b < 2" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": true, + "using_mrr": false, + "index_only": true, + "rows": 2, + "cost": 2.41, + "chosen": false, + "cause": "cost" + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "index_group", + "index": "PRIMARY", + "group_attribute": "b", + "min_aggregate": false, + "max_aggregate": true, + "distinct_aggregate": false, + "rows": 2, + "cost": 1.6, + "key_parts_used_for_access": [ + "a" + ] /* key_parts_used_for_access */, + "ranges": [ + "1 <= a <= 1 AND b < 2" + ] /* ranges */ + } /* range_access_plan */, + "rows_for_plan": 2, + "cost_for_plan": 1.6, + "chosen": true + } /* chosen_range_access_summary */ + } /* range_analysis */ + } /* rerunning_range_optimizer_for_single_index */ + } /* check_if_range_uses_more_keyparts_than_ref */ }, { "access_type_changed": { @@ -6304,11 +6326,6 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { } 0 0 drop table t1; -# -# Tracing of when test_if_skip_sort_order() switches to another -# index and we abandon ICP, -# see "disabling_pushed_condition_on_old_index" in trace. -# CREATE TABLE t1 ( c1 VARCHAR(2) NOT NULL, i1 INTEGER NOT NULL, @@ -6546,6 +6563,8 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = '1' ORDER BY i1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/mysql-test/suite/opt_trace/r/range_ps_prot.result b/mysql-test/suite/opt_trace/r/range_ps_prot.result index e32a0f7ffb30..1a5814dacb6f 100644 --- a/mysql-test/suite/opt_trace/r/range_ps_prot.result +++ b/mysql-test/suite/opt_trace/r/range_ps_prot.result @@ -895,6 +895,8 @@ EXPLAIN SELECT key2, MIN(key2_1) FROM t2 GROUP BY key2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t2`", "index_provides_order": true, @@ -1121,6 +1123,8 @@ EXPLAIN SELECT DISTINCT key2 FROM t2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t2`", "index_provides_order": true, @@ -1438,6 +1442,8 @@ GROUP BY key2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t2`", "index_provides_order": true, @@ -4751,71 +4757,75 @@ EXPLAIN SELECT * FROM t1 WHERE i1 > '2' ORDER BY i1, i2 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", - "rows_estimation": { - "table": "`t1`", - "index": "k2", - "range_analysis": { - "table_scan": { - "rows": 2, - "cost": 4.5049 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "k1", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "k2", - "usable": true, - "key_parts": [ - "i1", - "i2" - ] /* key_parts */ - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "k2", - "ranges": [ - "2 < i1" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, + "steps": [ + { + "rows_estimation": { + "table": "`t1`", + "index": "k2", + "range_analysis": { + "table_scan": { "rows": 2, - "cost": 3.41, + "cost": 4.5049 + } /* table_scan */, + "potential_range_indexes": [ + { + "index": "k1", + "usable": false, + "cause": "not_applicable" + }, + { + "index": "k2", + "usable": true, + "key_parts": [ + "i1", + "i2" + ] /* key_parts */ + } + ] /* potential_range_indexes */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "chosen": false, + "cause": "not_group_by_or_distinct" + } /* group_index_range */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "k2", + "ranges": [ + "2 < i1" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": false, + "using_mrr": false, + "index_only": false, + "rows": 2, + "cost": 3.41, + "chosen": true + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "range_scan", + "index": "k2", + "rows": 2, + "ranges": [ + "2 < i1" + ] /* ranges */ + } /* range_access_plan */, + "rows_for_plan": 2, + "cost_for_plan": 3.41, "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "k2", - "rows": 2, - "ranges": [ - "2 < i1" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 3.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } /* rows_estimation */, + } /* chosen_range_access_summary */ + } /* range_analysis */ + } /* rows_estimation */ + } + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5083,6 +5093,8 @@ EXPLAIN SELECT DISTINCT i1 FROM t1 WHERE i1 >= '1' ORDER BY i1 DESC { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5095,6 +5107,8 @@ EXPLAIN SELECT DISTINCT i1 FROM t1 WHERE i1 >= '1' ORDER BY i1 DESC { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5120,6 +5134,8 @@ EXPLAIN SELECT DISTINCT i1 FROM t1 WHERE i1 >= '1' ORDER BY i1 DESC { { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, @@ -5414,67 +5430,69 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { ] /* considered_execution_plans */ }, { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "i1_idx", - "usable": true, - "key_parts": [ - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "v_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "v_idx", - "cost": 2.0063, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ + "check_if_range_uses_more_keyparts_than_ref": { + "rerunning_range_optimizer_for_single_index": { + "range_analysis": { + "table_scan": { + "rows": 5, + "cost": 2e308 + } /* table_scan */, + "potential_range_indexes": [ + { + "index": "PRIMARY", + "usable": false, + "cause": "not_applicable" + }, { "index": "i1_idx", - "ranges": [ - "1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": false, - "cause": "cost" + "usable": true, + "key_parts": [ + "i1", + "pk" + ] /* key_parts */ + }, + { + "index": "v_idx", + "usable": false, + "cause": "not_applicable" } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ + ] /* potential_range_indexes */, + "best_covering_index_scan": { + "index": "v_idx", + "cost": 2.0063, + "chosen": true + } /* best_covering_index_scan */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "chosen": false, + "cause": "not_group_by_or_distinct" + } /* group_index_range */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "i1_idx", + "ranges": [ + "1 <= i1 <= 1 AND pk < 3" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.21, + "chosen": false, + "cause": "cost" + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */ + } /* range_analysis */ + } /* rerunning_range_optimizer_for_single_index */ + } /* check_if_range_uses_more_keyparts_than_ref */ }, { "attaching_conditions_to_tables": { @@ -5796,75 +5814,77 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3 { ] /* considered_execution_plans */ }, { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "v_idx", - "usable": true, - "key_parts": [ - "v", - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "i1_i2_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ + "check_if_range_uses_more_keyparts_than_ref": { + "rerunning_range_optimizer_for_single_index": { + "range_analysis": { + "table_scan": { + "rows": 5, + "cost": 2e308 + } /* table_scan */, + "potential_range_indexes": [ + { + "index": "PRIMARY", + "usable": false, + "cause": "not_applicable" + }, + { + "index": "v_idx", + "usable": true, + "key_parts": [ + "v", + "i1", + "pk" + ] /* key_parts */ + }, { + "index": "i1_i2_idx", + "usable": false, + "cause": "not_applicable" + } + ] /* potential_range_indexes */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "chosen": false, + "cause": "not_group_by_or_distinct" + } /* group_index_range */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "v_idx", + "ranges": [ + "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.21, + "chosen": true + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "range_scan", "index": "v_idx", + "rows": 1, "ranges": [ "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "v_idx", - "rows": 1, - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 1, - "cost_for_plan": 2.21, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ + ] /* ranges */ + } /* range_access_plan */, + "rows_for_plan": 1, + "cost_for_plan": 2.21, + "chosen": true + } /* chosen_range_access_summary */ + } /* range_analysis */ + } /* rerunning_range_optimizer_for_single_index */ + } /* check_if_range_uses_more_keyparts_than_ref */ }, { "access_type_changed": { @@ -6142,89 +6162,50 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { ] /* considered_execution_plans */ }, { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 4, - "cost": 3.9 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "b", - "cost": 1.8044, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "potential_group_range_indexes": [ + "check_if_range_uses_more_keyparts_than_ref": { + "rerunning_range_optimizer_for_single_index": { + "range_analysis": { + "table_scan": { + "rows": 4, + "cost": 2e308 + } /* table_scan */, + "potential_range_indexes": [ { "index": "PRIMARY", - "covering": true, - "index_dives_for_eq_ranges": true, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "rows": 2, - "cost": 1.6 - } - ] /* potential_group_range_indexes */ - } /* group_index_range */, - "best_group_range_summary": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "chosen": true - } /* best_group_range_summary */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ + "usable": true, + "key_parts": [ + "a", + "b" + ] /* key_parts */ + }, { - "index": "PRIMARY", - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2, - "cost": 2.41, - "chosen": false, - "cause": "cost" + "index": "b", + "usable": false, + "cause": "not_applicable" } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { + ] /* potential_range_indexes */, + "best_covering_index_scan": { + "index": "b", + "cost": 1.8044, + "chosen": true + } /* best_covering_index_scan */, + "setup_range_conditions": [ + ] /* setup_range_conditions */, + "group_index_range": { + "potential_group_range_indexes": [ + { + "index": "PRIMARY", + "covering": true, + "index_dives_for_eq_ranges": true, + "ranges": [ + "1 <= a <= 1 AND b < 2" + ] /* ranges */, + "rows": 2, + "cost": 1.6 + } + ] /* potential_group_range_indexes */ + } /* group_index_range */, + "best_group_range_summary": { "type": "index_group", "index": "PRIMARY", "group_attribute": "b", @@ -6238,14 +6219,55 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { ] /* key_parts_used_for_access */, "ranges": [ "1 <= a <= 1 AND b < 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 1.6, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ + ] /* ranges */, + "chosen": true + } /* best_group_range_summary */, + "analyzing_range_alternatives": { + "range_scan_alternatives": [ + { + "index": "PRIMARY", + "ranges": [ + "1 <= a <= 1 AND b < 2" + ] /* ranges */, + "index_dives_for_eq_ranges": true, + "rowid_ordered": true, + "using_mrr": false, + "index_only": true, + "rows": 2, + "cost": 2.41, + "chosen": false, + "cause": "cost" + } + ] /* range_scan_alternatives */, + "analyzing_roworder_intersect": { + "usable": false, + "cause": "too_few_roworder_scans" + } /* analyzing_roworder_intersect */ + } /* analyzing_range_alternatives */, + "chosen_range_access_summary": { + "range_access_plan": { + "type": "index_group", + "index": "PRIMARY", + "group_attribute": "b", + "min_aggregate": false, + "max_aggregate": true, + "distinct_aggregate": false, + "rows": 2, + "cost": 1.6, + "key_parts_used_for_access": [ + "a" + ] /* key_parts_used_for_access */, + "ranges": [ + "1 <= a <= 1 AND b < 2" + ] /* ranges */ + } /* range_access_plan */, + "rows_for_plan": 2, + "cost_for_plan": 1.6, + "chosen": true + } /* chosen_range_access_summary */ + } /* range_analysis */ + } /* rerunning_range_optimizer_for_single_index */ + } /* check_if_range_uses_more_keyparts_than_ref */ }, { "access_type_changed": { @@ -6304,11 +6326,6 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { } 0 0 drop table t1; -# -# Tracing of when test_if_skip_sort_order() switches to another -# index and we abandon ICP, -# see "disabling_pushed_condition_on_old_index" in trace. -# CREATE TABLE t1 ( c1 VARCHAR(2) NOT NULL, i1 INTEGER NOT NULL, @@ -6546,6 +6563,8 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = '1' ORDER BY i1 { { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", + "steps": [ + ] /* steps */, "index_order_summary": { "table": "`t1`", "index_provides_order": true, diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ecb02d616129..cfe751015444 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2736,6 +2736,8 @@ static int fill_used_fields_bitmap(PARAM *param) to provide. Three-value logic: asc/desc/don't care needed_reg this info is used in make_join_select() even if there is no quick! quick[out] Calculated QUICK, or NULL + ignore_table_scan Disregard table scan while looking for range. + NOTES Updates the following: needed_reg - Bits for keys with may be used if all prev regs are read @@ -2796,9 +2798,8 @@ int test_quick_select(THD *thd, key_map keys_to_use, ha_rows limit, bool force_quick_range, const ORDER::enum_order interesting_order, const QEP_shared_owner *tab, - Item *cond, - key_map *needed_reg, - QUICK_SELECT_I **quick) + Item *cond, key_map *needed_reg, QUICK_SELECT_I **quick, + bool ignore_table_scan) { DBUG_ENTER("test_quick_select"); @@ -2834,7 +2835,7 @@ int test_quick_select(THD *thd, key_map keys_to_use, Cost_estimate cost_est= head->file->table_scan_cost(); cost_est.add_io(1.1); cost_est.add_cpu(scan_time); - if (head->force_index) + if (ignore_table_scan) { scan_time= DBL_MAX; cost_est.set_max_cost(); diff --git a/sql/opt_range.h b/sql/opt_range.h index 111e296d4640..2bc587ea3756 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1005,9 +1005,8 @@ int test_quick_select(THD *thd, key_map keys, table_map prev_tables, ha_rows limit, bool force_quick_range, const ORDER::enum_order interesting_order, const QEP_shared_owner *tab, - Item *cond, - key_map *needed_reg, - QUICK_SELECT_I **quick); + Item *cond, key_map *needed_reg, + QUICK_SELECT_I **quick, bool ignore_table_scan); class FT_SELECT: public QUICK_RANGE_SELECT { diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 368a4ab31624..43f36543ce2d 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -292,7 +292,8 @@ bool Sql_cmd_delete::mysql_delete(THD *thd, ha_rows limit) QUICK_SELECT_I *qck; zero_rows= test_quick_select(thd, keys_to_use, 0, limit, safe_update, ORDER::ORDER_NOT_RELEVANT, &qep_tab, - conds, &needed_reg_dummy, &qck) < 0; + conds, &needed_reg_dummy, &qck, + qep_tab.table()->force_index) < 0; qep_tab.set_quick(qck); } if (zero_rows) diff --git a/sql/sql_executor.cc b/sql/sql_executor.cc index a3508a9d8e1d..172be02b4890 100644 --- a/sql/sql_executor.cc +++ b/sql/sql_executor.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2407,7 +2407,8 @@ join_init_quick_read_record(QEP_TAB *tab) HA_POS_ERROR, false, // don't force quick range ORDER::ORDER_NOT_RELEVANT, tab, - tab->condition(), &needed_reg_dummy, &qck); + tab->condition(), &needed_reg_dummy, &qck, + tab->table()->force_index); DBUG_ASSERT(old_qck == NULL || old_qck != qck) ; tab->set_quick(qck); diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 7e7a9130fdb3..8abf72529276 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -608,7 +608,7 @@ bool prepare_simple_select(THD *thd, Item *cond, const bool impossible= test_quick_select(thd, keys_to_use, 0, HA_POS_ERROR, false, ORDER::ORDER_NOT_RELEVANT, tab, cond, - &needed_reg_dummy, &qck) < 0; + &needed_reg_dummy, &qck, tab->table()->force_index) < 0; tab->set_quick(qck); return impossible || (tab->quick() && tab->quick()->reset()); diff --git a/sql/sql_optimizer.cc b/sql/sql_optimizer.cc index 9f2011dc815f..f415234c7f05 100644 --- a/sql/sql_optimizer.cc +++ b/sql/sql_optimizer.cc @@ -1968,6 +1968,7 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, Opt_trace_object trace_skip_sort_order(trace, "reconsidering_access_paths_for_index_ordering"); trace_skip_sort_order.add_alnum("clause", clause_type); + Opt_trace_array trace_steps(trace, "steps"); if (ref_key >= 0) { @@ -2027,6 +2028,7 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, key_map new_ref_key_map; // Force the creation of quick select new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key. + Opt_trace_object trace_wrapper(trace); Opt_trace_object trace_recest(trace, "rows_estimation"); trace_recest.add_utf8_table(tab->table_ref). @@ -2041,8 +2043,8 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, false, // don't force quick range order->direction, tab, // we are after make_join_select(): - tab->condition(), &tab->needed_reg, - &qck) <= 0; + tab->condition(), &tab->needed_reg, &qck, + tab->table()->force_index) <= 0; DBUG_ASSERT(tab->quick() == save_quick); tab->set_quick(qck); if (no_quick) @@ -2127,6 +2129,7 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, best_key != ref_key) { tab->quick_order_tested.set_bit(best_key); + Opt_trace_object trace_wrapper(trace); Opt_trace_object trace_recest(trace, "rows_estimation"); trace_recest.add_utf8_table(tab->table_ref). @@ -2143,7 +2146,7 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, join->unit->select_limit_cnt, true, // force quick range order->direction, tab, tab->condition(), - &tab->needed_reg, &qck); + &tab->needed_reg, &qck, tab->table()->force_index); /* If tab->quick() pointed to another quick than save_quick, we would lose access to it and leak memory. @@ -2165,7 +2168,7 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, set_up_ref_access_to_key= false; } -check_reverse_order: +check_reverse_order: DBUG_ASSERT(order_direction != 0); if (order_direction == -1) // If ORDER BY ... DESC @@ -2372,6 +2375,7 @@ test_if_skip_sort_order(JOIN_TAB *tab, ORDER *order, ha_rows select_limit, } } + trace_steps.end(); Opt_trace_object trace_change_index(trace, "index_order_summary"); trace_change_index.add_utf8_table(tab->table_ref) @@ -2447,11 +2451,10 @@ bool JOIN::prune_table_partitions() access can utilize more keyparts than 'ref' access. Conditions for doing switching: - 1) Range access is possible. + 1) Range access is possible Or tab->dodgy_ref_cost is set. 2) This function is not relevant for FT, since there is no range access for that type of index. - 3) Used parts of key shouldn't have nullable parts, i.e we're - going to use 'ref' access, not ref_or_null. + 3) Used parts of key shouldn't have nullable parts & ref_or_null isn't used. 4) 'ref' access depends on a constant, not a value read from a table earlier in the join sequence. @@ -2497,8 +2500,7 @@ bool JOIN::prune_table_partitions() static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab) { - - if (tab->quick() && // 1) + if ((tab->quick() || tab->dodgy_ref_cost) && // 1) tab->position()->key->keypart != FT_KEYPART) // 2) { uint keyparts= 0, length= 0; @@ -2513,9 +2515,9 @@ static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab) dep_map) // 4) return false; - if (tab->position()->key->key == tab->quick()->index && // 5a) - length < tab->quick()->max_used_key_length) // 5b) - return true; + if (tab->quick() && + tab->position()->key->key == tab->quick()->index) // 5a) + return length < tab->quick()->max_used_key_length; // 5b) else if (tab->dodgy_ref_cost) // 6) { key_map new_ref_key_map; @@ -2523,7 +2525,10 @@ static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab) Opt_trace_context * const trace= &thd->opt_trace; Opt_trace_object trace_wrapper(trace); - Opt_trace_array + + Opt_trace_object + can_switch(trace, "check_if_range_uses_more_keyparts_than_ref"); + Opt_trace_object trace_setup_cond(trace, "rerunning_range_optimizer_for_single_index"); QUICK_SELECT_I *qck; @@ -2536,18 +2541,27 @@ static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab) tab->join_cond() ? tab->join_cond() : tab->join()->where_cond, &tab->needed_reg, - &qck) > 0) + &qck, true) > 0) { - delete tab->quick(); - tab->set_quick(qck); - return true; + if (length < qck->max_used_key_length) + { + delete tab->quick(); + tab->set_quick(qck); + return true; + } + else + { + Opt_trace_object (trace, "access_type_unchanged"). + add("ref_key_length", length). + add("range_key_length", qck->max_used_key_length); + delete qck; + } } } } return false; } - /** An utility function - apply heuristics and optimize access methods to tables. Currently this function can change REF to RANGE and ALL to INDEX scan if @@ -5945,7 +5959,7 @@ static ha_rows get_quick_record_count(THD *thd, JOIN_TAB *tab, ha_rows limit) ORDER::ORDER_NOT_RELEVANT, tab, tab->join_cond() ? tab->join_cond() : tab->join()->where_cond, - &tab->needed_reg, &qck); + &tab->needed_reg, &qck, tab->table()->force_index); tab->set_quick(qck); if (error == 1) @@ -9432,7 +9446,8 @@ static bool make_join_select(JOIN *join, Item *cond) false, // don't force quick range interesting_order, tab, tab->condition(), - &tab->needed_reg, &qck) < 0; + &tab->needed_reg, &qck, + tab->table()->force_index) < 0; tab->set_quick(qck); } tab->set_condition(orig_cond); @@ -9460,7 +9475,7 @@ static bool make_join_select(JOIN *join, Item *cond) false, //don't force quick range ORDER::ORDER_NOT_RELEVANT, tab, tab->condition(), &tab->needed_reg, - &qck) < 0; + &qck, tab->table()->force_index) < 0; tab->set_quick(qck); if (impossible_where) DBUG_RETURN(1); // Impossible WHERE diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 242b676edbe0..6616b3cedc4e 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -493,7 +493,8 @@ bool mysql_update(THD *thd, QUICK_SELECT_I *qck; impossible= test_quick_select(thd, keys_to_use, 0, limit, safe_update, ORDER::ORDER_NOT_RELEVANT, &qep_tab, - conds, &needed_reg_dummy, &qck) < 0; + conds, &needed_reg_dummy, &qck, + qep_tab.table()->force_index) < 0; qep_tab.set_quick(qck); } if (impossible) From 0c79729d3182a774047d8a3f5cf1d16574e08dc8 Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Mon, 15 Oct 2018 09:18:18 +0100 Subject: [PATCH 059/214] BUG#27928837 `HEAD->VARIABLES.GTID_NEXT.TYPE != UNDEFINED_GTID' Description ----------- The assertion with failing condition `head->variables.gtid_next.type != UNDEFINED_GROUP`, in function ` bool MYSQL_BIN_LOG::assign_automatic_gtids_to_flush_group(THD*)`, is generated while running an `XA ROLLBACK` statement with non-existing XID and `GTID_NEXT` is set to a specific UUID. Analysis -------- The *8de09762684577f4a891bba3344c79666d185006* commit altered the behaviour of `MYSQL_BIN_LOG::rollback` regarding XA transactions by always invoking `gtid_state->update_on_commit()` in order to persist the executed GTID. However, the specified code was introduced below the goto tag `end`, the default fallback goto tag - even for errors - meaning that the `gtid_state->update_on_commit()` will be invoked even if the `XA ROLLBACK` fails with an error - which is the case for this bug. Fix --- Only invoke `gtid_state->update_on_commit()`, while processing an `XA ROLLBACK`, if no error occurs. --- mysql-test/include/rpl_set_gtid_mode.inc | 19 ++- .../suite/binlog/r/binlog_gtid_next_xa.result | 2 +- .../binlog/r/binlog_gtid_unknown_xid.result | 33 ++++ .../binlog/t/binlog_gtid_unknown_xid.test | 145 ++++++++++++++++++ sql/binlog.cc | 3 +- 5 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result create mode 100644 mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test diff --git a/mysql-test/include/rpl_set_gtid_mode.inc b/mysql-test/include/rpl_set_gtid_mode.inc index 2d69e3e5c3f1..5d67f4c9ded4 100644 --- a/mysql-test/include/rpl_set_gtid_mode.inc +++ b/mysql-test/include/rpl_set_gtid_mode.inc @@ -16,6 +16,7 @@ # [--let $rpl_skip_sync= 1] # [--let $rpl_only_running_threads= 1] # [--let $rpl_debug= 1] +# [--let $no_extra_info= 0] # --source include/rpl_set_gtid_mode.inc # # Parameters: @@ -42,6 +43,12 @@ # # $rpl_debug=1 # See include/rpl_init.inc +# +# $no_extra_info=0 +# Do not print the mode and server after the include file name. This option +# allows to easly support tests that may invoke with dynamic parameter +# values. +# # Get the new gtid_mode --let $_rsgm_new_mode= $rpl_gtid_mode @@ -75,7 +82,17 @@ if ($_rsgm_server_list == '') } } ---let $include_filename= rpl_set_gtid_mode.inc [$_rsgm_new_mode on servers $_rsgm_server_list] +--let $_rsgm_mute= $no_extra_info +if ($_rsgm_mute == '') +{ + --let $_rsgm_mute= 0 +} + +--let $include_filename= rpl_set_gtid_mode.inc +if ($_rsgm_mute == 0) +{ + --let $include_filename= rpl_set_gtid_mode.inc [$_rsgm_new_mode on servers $_rsgm_server_list] +} --source include/begin_include_file.inc if ($rpl_inited) diff --git a/mysql-test/suite/binlog/r/binlog_gtid_next_xa.result b/mysql-test/suite/binlog/r/binlog_gtid_next_xa.result index 942cc8c6e362..6c046525abea 100644 --- a/mysql-test/suite/binlog/r/binlog_gtid_next_xa.result +++ b/mysql-test/suite/binlog/r/binlog_gtid_next_xa.result @@ -787,7 +787,7 @@ one 0 SELECT count(*) FROM mysql.gtid_executed FOR UPDATE; count(*) -16 +17 Warnings: Warning 3129 Please do not modify the gtid_executed table. This is a mysql internal system table to store GTIDs for committed transactions. Modifying it can lead to an inconsistent GTID state. [connection master] diff --git a/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result b/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result new file mode 100644 index 000000000000..51d92049a9b1 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result @@ -0,0 +1,33 @@ +CREATE TABLE t2(a INT); +SET @@AUTOCOMMIT=0; +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1'; +INSERT INTO t2 VALUES(1); +XA ROLLBACK 'xa1'; +ERROR XAE04: XAER_NOTA: Unknown XID +SET @@AUTOCOMMIT=1; +SET @@AUTOCOMMIT=0; +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:2'; +INSERT INTO t2 VALUES(2); +XA COMMIT 'xa1'; +ERROR XAE04: XAER_NOTA: Unknown XID +SET @@AUTOCOMMIT=1; +XA START 'xa1'; +XA END 'xa1'; +XA PREPARE 'xa1'; +SET @@AUTOCOMMIT=0; +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:3'; +INSERT INTO t2 VALUES(3); +XA ROLLBACK 'xa1'; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the NON-EXISTING state +SET @@AUTOCOMMIT=1; +SET @@AUTOCOMMIT=0; +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:4'; +INSERT INTO t2 VALUES(4); +XA COMMIT 'xa1'; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the NON-EXISTING state +SET @@AUTOCOMMIT=1; +include/assert.inc [All inserts were committed, XA statements and respective failures, were disregarded] +SET SESSION GTID_NEXT='AUTOMATIC'; +DROP TABLE t2; +SET @@AUTOCOMMIT=DEFAULT_AUTOCOMMIT; +RESET MASTER; diff --git a/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test b/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test new file mode 100644 index 000000000000..c736cfe72739 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test @@ -0,0 +1,145 @@ +# ==== Purpose ==== +# +# The purpose of this test is to ensure that the server properly disregards XA +# transaction related statements that try to operate upon an unknown XID, when +# on SBR. +# +# ==== Requirements ==== +# +# R1. Ensure that execution proceeds normaly after trying - and failling - to +# execute `XA COMMIT / ROLLBACK` with an unkown XID. +# +# ==== Implementation ==== +# +# Ensure that the server properly disregards XA related statements that operate +# on unknown XIDs given the following setup / statements combinations: +# +# TC1. Manual GTID and apply `XA ROLLBACK` with unkown XID +# -------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +# 2) Set `GTID_NEXT` to manually introduced value. +# 3) Execute a DML statement. +# 4) Execute `XA ROLLBACK` with an unknown XID. +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +# +# TC2. Manual GTID and apply `XA ROLLBACK` with unkown XID +# -------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +# 2) Set `GTID_NEXT` to manually introduced value. +# 3) Execute a DML statement. +# 4) Execute `XA ROLLBACK` with an unknown XID. +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +# +# TC3. Manual GTID and apply `XA ROLLBACK` to an existent XA transaction +# -------------------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +# 2) Set `GTID_NEXT` to manually introduced value. +# 3) Execute a DML statement. +# 4) Execute `XA ROLLBACK` with an existent XID. +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +# +# TC4. Manual GTID and apply `XA COMMIT` to an existent XA transaction +# ----------------------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +# 2) Set `GTID_NEXT` to manually introduced value. +# 3) Execute a DML statement. +# 4) Execute `XA COMMIT` with an existent XID. +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +# +# ==== References ==== +# +# BUG#27928837 `HEAD->VARIABLES.GTID_NEXT.TYPE != UNDEFINED_GTID` + +--source include/have_gtid.inc + +--let $current_autocommit= `SELECT @@AUTOCOMMIT` + +CREATE TABLE t2(a INT); + +# TC1. Manual GTID and apply `XA ROLLBACK` with unkown XID +# -------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +SET @@AUTOCOMMIT=0; +# 2) Set `GTID_NEXT` to manually introduced value. +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1'; +# 3) Execute a DML statement. +INSERT INTO t2 VALUES(1); +# 4) Execute `XA ROLLBACK` with an unknown XID. +--error ER_XAER_NOTA +XA ROLLBACK 'xa1'; +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +SET @@AUTOCOMMIT=1; +# + +# TC2. Manul GTID and apply `XA ROLLBACK` with unkown XID +# ----------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +SET @@AUTOCOMMIT=0; +# 2) Set `GTID_NEXT` to manually introduced value. +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:2'; +# 3) Execute a DML statement. +INSERT INTO t2 VALUES(2); +# 4) Execute `XA COMMIT` with an unknown XID. +--error ER_XAER_NOTA +XA COMMIT 'xa1'; +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +SET @@AUTOCOMMIT=1; +# + +--connect (other_conn, 127.0.0.1,root,,test,$MASTER_MYPORT,) +XA START 'xa1'; +XA END 'xa1'; +XA PREPARE 'xa1'; +--disconnect other_conn + +--connection default +# TC3. Manual GTID and apply `XA ROLLBACK` to an existent XA transaction +# -------------------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +SET @@AUTOCOMMIT=0; +# 2) Set `GTID_NEXT` to manually introduced value. +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:3'; +# 3) Execute a DML statement. +INSERT INTO t2 VALUES(3); +# 4) Execute `XA ROLLBACK` with an existent XID. +--error ER_XAER_RMFAIL +XA ROLLBACK 'xa1'; +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +SET @@AUTOCOMMIT=1; +# + +# TC4. Manual GTID and apply `XA COMMIT` to an existent XA transaction +# ----------------------------------------------------------------------- +# 1) Ensure that `AUTOCOMMIT` is OFF. +SET @@AUTOCOMMIT=0; +# 2) Set `GTID_NEXT` to manually introduced value. +SET SESSION GTID_NEXT='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:4'; +# 3) Execute a DML statement. +INSERT INTO t2 VALUES(4); +# 4) Execute `XA COMMIT` with an existent XID. +--error ER_XAER_RMFAIL +XA COMMIT 'xa1'; +# 5) Set `AUTOCOMMIT` to the default value so that the DML statement gets +# commited. +SET @@AUTOCOMMIT=1; +# + +--let $assert_text= All inserts were committed, XA statements and respective failures, were disregarded +--let $assert_cond= "[SELECT COUNT(1) FROM t2]" = "4" +--source include/assert.inc + +SET SESSION GTID_NEXT='AUTOMATIC'; + +DROP TABLE t2; + +--replace_result $current_autocommit DEFAULT_AUTOCOMMIT +--eval SET @@AUTOCOMMIT=$current_autocommit + +RESET MASTER; diff --git a/sql/binlog.cc b/sql/binlog.cc index 939b5ee929c3..b3856b129fca 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -2576,7 +2576,8 @@ int MYSQL_BIN_LOG::rollback(THD *thd, bool all) { error= ha_rollback_low(thd, all); /* Successful XA-rollback commits the new gtid_state */ - gtid_state->update_on_commit(thd); + if (!error && !thd->is_error()) + gtid_state->update_on_commit(thd); } /* When a statement errors out on auto-commit mode it is rollback From e5e8c9d1b2e0e6bf85faa8941f1142f17bd38f17 Mon Sep 17 00:00:00 2001 From: Aakanksha Verma Date: Wed, 17 Oct 2018 14:25:16 +0530 Subject: [PATCH 060/214] Bug #28470805 DELETE CASCADE CRASHES AS FOREIGN TABLE'S VIRT COL DATA NOT UPDATED ON RESTART PROBLEM ======= 1) We have a parent and child table & child table has a virtual column with a secondary index defined on it.It also has delete cascade defined on the fk constarint. 2) We try to delete a tuple from parent table after restart. 3) When doing a delete a parent row we try to load the child table in dictionary for enforcing the fk constraint. While loading the child table we are initiliazing the virtual column template meta data for the virtual column. 4) Failing to initliaze it causes a crash when we are trying remove the secondary index rows defined on virtual column . FIX === In case of delete cascade, initiliaze the virtual column template meta data info for the child table if the virtual column is affected by foreign key. Reviewed by : bin su Aditya A RB:20686 --- storage/innobase/row/row0ins.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index e17588ecf54d..e7ae2dcb5612 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1270,6 +1270,11 @@ row_ins_foreign_check_on_constraint( clust_index, tmp_heap); } + if (cascade->is_delete && foreign->v_cols != NULL + && foreign->v_cols->size() > 0 + && table->vc_templ == NULL) { + innobase_init_vc_templ(table); + } if (node->is_delete ? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) : (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)) { From 603eaa2e670b15be92db11191f8b19c6e789d76c Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Thu, 18 Oct 2018 12:16:47 +0530 Subject: [PATCH 061/214] Bug#28183718: CANNOT SHUTDOWN MYSQLD WHEN LAST BINLOG HAS GTIDS TO SAVE AND AUTOCOMMIT=0 Problem: ======= When autocommit is set to 0 on GR setup, it is not possible to shutdown the R/O server. The message like below is printed forever. 11:41.655154Z 0 [Note] InnoDB: Starting shutdown... 11:41.755413Z 0 [Note] InnoDB: Dumping buffer pool(s) to 12:42.453581Z 0 [Note] InnoDB: Waiting for 1 active transactions to finish Analysis: ========= In group replication setup when single primary mode is enabled the secondary servers will have their 'super_read_only=ON'. During shutdown the main server thread will try to save the executed gtid set in 'gtid_executed' table. But since the 'super_read_only' mode is enabled on the server the update operation fails. When AUTOCOMMIT=0 the transaction that was started while opening the 'gtid_executed' table doesn't complete. This makes the main server thread to wait indefinitely for the transaction to complete. When AUTOCOMMIT=1, even though update to 'gtid_executed' operation fails as 'super_read_only' is on, it completes the active transaction. Hence shutdwon is complete but table is not updated. The gtid_executed table is updated upon next server restart as part of following code. /* Save unsaved GTIDs into gtid_executed table, in the following four cases: 1. the upgrade case. 2. the case that a slave is provisioned from a backup of the master and the slave is cleaned by RESET MASTER and RESET SLAVE before this. 3. the case that no binlog rotation happened from the last RESET MASTER on the server before it crashes. 4. The set of GTIDs of the last binlog is not saved into the gtid_executed table if server crashes, so we save it into gtid_executed table and executed_gtids during recovery from the crash. */ if (gtid_state->save(>ids_in_binlog_not_in_table) == -1) Fix: ==== The main server thread should update the 'gtid_executed' table even when 'super_read_only mode' is turned on. 'skip_readonly_check' flag is enabled now, for the thread which tries to update executed gtid's, in the system table during shutdown. --- .../binlog/r/binlog_shutdown_hang.result | 15 ++++++ .../suite/binlog/t/binlog_shutdown_hang.test | 51 +++++++++++++++++++ sql/rpl_gtid_persist.cc | 9 +++- sql/rpl_gtid_persist.h | 3 +- 4 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_shutdown_hang.result create mode 100644 mysql-test/suite/binlog/t/binlog_shutdown_hang.test diff --git a/mysql-test/suite/binlog/r/binlog_shutdown_hang.result b/mysql-test/suite/binlog/r/binlog_shutdown_hang.result new file mode 100644 index 000000000000..f1d24b19021e --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_shutdown_hang.result @@ -0,0 +1,15 @@ +RESET MASTER; +CREATE TABLE t (f INT PRIMARY KEY) ENGINE=INNODB; +INSERT INTO t VALUES (10); +SET GLOBAL autocommit= 0; +SET GLOBAL super_read_only= ON; +# restart +# +# Verify that we can get correct gtid sets after server restarts +# +include/assert.inc [committed gtid set is MASTER_UUID:1-2] +SELECT * FROM mysql.gtid_executed; +source_uuid interval_start interval_end +MASTER_UUID 1 2 +DROP TABLE t; +RESET MASTER; diff --git a/mysql-test/suite/binlog/t/binlog_shutdown_hang.test b/mysql-test/suite/binlog/t/binlog_shutdown_hang.test new file mode 100644 index 000000000000..28264503cbfb --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_shutdown_hang.test @@ -0,0 +1,51 @@ +# ==== Purpose ==== +# +# Test verifies that server shutdown doesn't hang when +# +# * Gtid's are enabled. +# * AUTOCOMMIT=0 +# * super_read_only=ON +# +# ==== Implementation ==== +# +# Do some operations on master like CREATE/INSERT so that GTIDs are generated. +# Shutdown and restart the server. +# Shutdown should not hang. +# Upon restart verify the content of 'gtid_executed' table. +# +# ==== References ==== +# +# Bug#28183718: CANNOT SHUTDOWN MYSQLD WHEN LAST BINLOG HAS +# GTIDS TO SAVE AND AUTOCOMMIT=0 +# + +--source include/have_gtid.inc + +# For reseting mysql.gtid_executed table +RESET MASTER; + +CREATE TABLE t (f INT PRIMARY KEY) ENGINE=INNODB; + +INSERT INTO t VALUES (10); + +SET GLOBAL autocommit= 0; +SET GLOBAL super_read_only= ON; + +--source include/restart_mysqld.inc + +--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` + +--echo # +--echo # Verify that we can get correct gtid sets after server restarts +--echo # +--let $assert_text= committed gtid set is MASTER_UUID:1-2 +--let $assert_cond= @@GLOBAL.GTID_EXECUTED = "$master_uuid:1-2" +--source include/assert.inc + +--replace_result $master_uuid MASTER_UUID +SELECT * FROM mysql.gtid_executed; + +DROP TABLE t; + +# Cleanup +RESET MASTER; diff --git a/sql/rpl_gtid_persist.cc b/sql/rpl_gtid_persist.cc index df5457ebb72b..120223011338 100644 --- a/sql/rpl_gtid_persist.cc +++ b/sql/rpl_gtid_persist.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -132,10 +132,15 @@ THD *Gtid_table_access_context::create_thd() */ lex_start(thd); mysql_reset_thd_for_next_command(thd); - + thd->set_skip_readonly_check(); return(thd); } +void Gtid_table_access_context::drop_thd(THD *thd) +{ + thd->reset_skip_readonly_check(); + System_table_access::drop_thd(thd); +} void Gtid_table_access_context::before_open(THD* thd) { diff --git a/sql/rpl_gtid_persist.h b/sql/rpl_gtid_persist.h index c12c75c2cf1d..61b02a09cbc7 100644 --- a/sql/rpl_gtid_persist.h +++ b/sql/rpl_gtid_persist.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -82,6 +82,7 @@ class Gtid_table_access_context : public System_table_access @retval THD* Pointer to thread structure */ THD *create_thd(); + void drop_thd(THD* thd); private: /* Pointer to new created THD. */ THD *m_drop_thd_object; From b23672edddde2dc63a9398f9803714b4e10bdcc4 Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Fri, 19 Oct 2018 16:42:49 +0100 Subject: [PATCH 062/214] BUG#27928837 `HEAD->VARIABLES.GTID_NEXT.TYPE != UNDEFINED_GTID' [post-push] Problem ------- The test script `binlog_gtid.binlog_gtid_unknown_xid` is failling sporadically on PB2 due to a difference in expect error codes: mysqltest: At line 110: Query 'XA ROLLBACK 'xa1'' failed with wrong error 1397: 'XAER_NOTA: Unknown XID', should have failed with error '1399'. Analysis -------- This problem happens when the test is ran several times in a row, leading to the conclusion that something has not been cleaned up properly. After analysis, the conclusion is that an XA transaction that is started in the test script is never commited or rolled back. Fix --- 1) Rollback the XA transaction at the end of the test script 2) Verify that are no pending XA transactions --- .../suite/binlog/r/binlog_gtid_unknown_xid.result | 2 ++ .../suite/binlog/t/binlog_gtid_unknown_xid.test | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result b/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result index 51d92049a9b1..33757571dfc1 100644 --- a/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result +++ b/mysql-test/suite/binlog/r/binlog_gtid_unknown_xid.result @@ -28,6 +28,8 @@ ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction SET @@AUTOCOMMIT=1; include/assert.inc [All inserts were committed, XA statements and respective failures, were disregarded] SET SESSION GTID_NEXT='AUTOMATIC'; +XA ROLLBACK 'xa1'; +include/assert.inc [All XA transactions were cleared] DROP TABLE t2; SET @@AUTOCOMMIT=DEFAULT_AUTOCOMMIT; RESET MASTER; diff --git a/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test b/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test index c736cfe72739..b0152872b562 100644 --- a/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test +++ b/mysql-test/suite/binlog/t/binlog_gtid_unknown_xid.test @@ -97,6 +97,10 @@ XA START 'xa1'; XA END 'xa1'; XA PREPARE 'xa1'; --disconnect other_conn +# Wait for the `other_conn` to be cleared from the server +--connection default +--let $wait_condition = SELECT COUNT(*) = 0 FROM information_schema.processlist WHERE id = '$connection_id' +--source include/wait_condition.inc --connection default # TC3. Manual GTID and apply `XA ROLLBACK` to an existent XA transaction @@ -135,11 +139,14 @@ SET @@AUTOCOMMIT=1; --let $assert_cond= "[SELECT COUNT(1) FROM t2]" = "4" --source include/assert.inc +# CLEAN UP SET SESSION GTID_NEXT='AUTOMATIC'; - +XA ROLLBACK 'xa1'; +--let $pending = query_get_value(XA RECOVER, data, 1) +--let $assert_text= All XA transactions were cleared +--let $assert_cond= "$pending" = "No such row" +--source include/assert.inc DROP TABLE t2; - --replace_result $current_autocommit DEFAULT_AUTOCOMMIT --eval SET @@AUTOCOMMIT=$current_autocommit - RESET MASTER; From 11eb38267edc0b483e01017564077995132bcd08 Mon Sep 17 00:00:00 2001 From: Sachin Agarwal Date: Tue, 23 Oct 2018 18:33:16 +0530 Subject: [PATCH 063/214] Bug #28491099 [FATAL] MEMORY BLOCK IS INVALID | INNODB: ASSERTION FAILURE: UT0UT.CC:670 Problem: 1. For partition table, memory for blob_heap is allocated and released by partition. During Alter operation on partition table, ha_innobase::commit_inplace_alter_table() consider blob_heap as a part of prebuild and free blob_heap. Later when partition tries to free blob_heap, it hits an assert. 2. For unordered scan, each partition uses blob_heap from the first partition. In ha_innobase::commit_inplace_alter_table(), after rebuilding table, it frees prebuilt data for each partition. First partition frees blob_heap and other partitions have pointer to same blob_heap. When next partition tries to free blob data, it hits assert. Fix: Added a check. If ha_alter_info have modification for partition table then set blob_heap to NULL. It will restrict row_prebuilt_free() from freeing blob_heap. RB: #20691 Reviewed by : bin.x.su@oracle.com, aditya.a@oracle.com --- .../suite/innodb/r/partition-blob.result | 18 ++++++++++++++++++ mysql-test/suite/innodb/t/partition-blob.test | 16 ++++++++++++++++ storage/innobase/dict/dict0dict.cc | 17 ----------------- storage/innobase/handler/handler0alter.cc | 7 ++++++- storage/innobase/include/dict0dict.h | 9 +++++++++ storage/innobase/include/dict0dict.ic | 16 +++++++++++++++- 6 files changed, 64 insertions(+), 19 deletions(-) diff --git a/mysql-test/suite/innodb/r/partition-blob.result b/mysql-test/suite/innodb/r/partition-blob.result index 619dbddf1c17..9d2bc093b2f2 100644 --- a/mysql-test/suite/innodb/r/partition-blob.result +++ b/mysql-test/suite/innodb/r/partition-blob.result @@ -29,3 +29,21 @@ f3 2 3 DROP TABLE t1; +# +# Bug #28491099 [FATAL] MEMORY BLOCK IS INVALID | INNODB: ASSERTION +# FAILURE: UT0UT.CC:670 +# +set sql_mode=''; +Warnings: +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +CREATE TABLE t1(a INT, b TEXT NOT NULL) PARTITION BY RANGE(a) +(PARTITION p0 VALUES LESS THAN (6), PARTITION p1 VALUES LESS THAN (9), +PARTITION p2 VALUES LESS THAN MAXVALUE); +INSERT INTO t1(a) VALUES(0); +Warnings: +Warning 1364 Field 'b' doesn't have a default value +ALTER TABLE t1 ADD COLUMN c DATE NOT NULL; +ALTER TABLE t1 drop partition p0; +ALTER TABLE t1 ADD COLUMN d DATE NOT NULL; +DROP TABLE t1; +SET sql_mode = default; diff --git a/mysql-test/suite/innodb/t/partition-blob.test b/mysql-test/suite/innodb/t/partition-blob.test index 420f71d16d6f..629b04e39ee0 100644 --- a/mysql-test/suite/innodb/t/partition-blob.test +++ b/mysql-test/suite/innodb/t/partition-blob.test @@ -34,3 +34,19 @@ HAVING (SELECT 1 FROM t1 HAVING f2 LIMIT 1) ORDER BY f3; DROP TABLE t1; + + +--echo # +--echo # Bug #28491099 [FATAL] MEMORY BLOCK IS INVALID | INNODB: ASSERTION +--echo # FAILURE: UT0UT.CC:670 +--echo # +set sql_mode=''; +CREATE TABLE t1(a INT, b TEXT NOT NULL) PARTITION BY RANGE(a) +(PARTITION p0 VALUES LESS THAN (6), PARTITION p1 VALUES LESS THAN (9), +PARTITION p2 VALUES LESS THAN MAXVALUE); +INSERT INTO t1(a) VALUES(0); +ALTER TABLE t1 ADD COLUMN c DATE NOT NULL; +ALTER TABLE t1 drop partition p0; +ALTER TABLE t1 ADD COLUMN d DATE NOT NULL; +DROP TABLE t1; +SET sql_mode = default; diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index fba59b42158f..3464591852a7 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -3547,23 +3547,6 @@ dict_index_build_internal_fts( } /*====================== FOREIGN KEY PROCESSING ========================*/ -/** Check whether the dict_table_t is a partition. -A partitioned table on the SQL level is composed of InnoDB tables, -where each InnoDB table is a [sub]partition including its secondary indexes -which belongs to the partition. -@param[in] table Table to check. -@return true if the dict_table_t is a partition else false. */ -UNIV_INLINE -bool -dict_table_is_partition( - const dict_table_t* table) -{ - /* Check both P and p on all platforms in case it was moved to/from - WIN. */ - return(strstr(table->name.m_name, "#p#") - || strstr(table->name.m_name, "#P#")); -} - /*********************************************************************//** Checks if a table is referenced by foreign keys. @return TRUE if table is referenced by a foreign key */ diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 04f1ab8d6ef5..f02ddbb3c967 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -8880,7 +8880,11 @@ ha_innobase::commit_inplace_alter_table( bool update_own_prebuilt = (m_prebuilt == ctx->prebuilt); trx_t* const user_trx = m_prebuilt->trx; - + mem_heap_t* const temp_blob_heap + = ctx->prebuilt->blob_heap; + if (dict_table_is_partition(ctx->new_table)) { + ctx->prebuilt->blob_heap = NULL; + } row_prebuilt_free(ctx->prebuilt, TRUE); /* Drop the copy of the old table, which was @@ -8901,6 +8905,7 @@ ha_innobase::commit_inplace_alter_table( trx_start_if_not_started(user_trx, true); user_trx->will_lock++; m_prebuilt->trx = user_trx; + m_prebuilt->blob_heap = temp_blob_heap; } DBUG_INJECT_CRASH("ib_commit_inplace_crash", crash_inject_count++); diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 29538351714e..89b71d65a790 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -2122,6 +2122,15 @@ void dict_allocate_mem_intrinsic_cache( dict_index_t* index); +/** Check whether the table is a partitioned table. +@param[in] table Table to check. +@return true if the table is a partitioned table else false. */ +UNIV_INLINE +bool +dict_table_is_partition( + const dict_table_t* table); + + #endif /* !UNIV_HOTBACKUP */ #ifndef UNIV_NONINL diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 0087ff6bb949..9557e95261ad 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1998,4 +1998,18 @@ dict_allocate_mem_intrinsic_cache( new (index->last_sel_cur) last_ops_cur_t(); } +/** Check whether the table is a partitioned table. +@param[in] table Table to check. +@return true if the table is a partitioned table else false. */ +UNIV_INLINE +bool +dict_table_is_partition( + const dict_table_t* table) +{ + /* Check both P and p on all platforms in case it was moved to/from + WIN. */ + return(strstr(table->name.m_name, "#p#") + || strstr(table->name.m_name, "#P#")); +} + #endif /* !UNIV_HOTBACKUP */ From a943539dff1460aa772829d6784690ed46f34257 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Thu, 25 Oct 2018 06:37:38 +0200 Subject: [PATCH 064/214] From 14c5bb954071f3e31de43ca252c56631bc0e55be Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Fri, 26 Oct 2018 14:33:49 +0200 Subject: [PATCH 065/214] From 2348605ee29bb425c3d495905519e2e05da63ae6 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 29 Oct 2018 17:50:14 +0530 Subject: [PATCH 066/214] From dd494c36e8d3767271ebab2025bd1d17f2aa65e4 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Tue, 30 Oct 2018 09:24:18 +0100 Subject: [PATCH 067/214] From c1e63e1cc766f64a09c5d0822cdb6506dbee61e5 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 31 Oct 2018 08:29:29 +0100 Subject: [PATCH 068/214] From 9827f13989dcd470d8e8c88164b34e48afc18666 Mon Sep 17 00:00:00 2001 From: Neha Kumari Date: Thu, 1 Nov 2018 11:23:53 +0530 Subject: [PATCH 069/214] Bug#28606948: BACKPORT OF BUG#24670909 TO 5.7.22 Backported the changes from mysql-8.0 to mysql-5.7 BUG#24670909: Problem: Previously, a session disconnect causes DROP TEMPORARY TABLE IF EXISTS to be binlogged for all the opened temp tables in that session. Even though temporary table operation are not otherwise binlogged in row or mixed mode, this was done regardless of binary log format in use, as it was not tracked, whether a particular temp table was not created in STATEMENT mode - in which case it does need the DROP. For ROW/MIXED users, this behavior causes spurious binlog writes and GTIDs generated on otherwise read only servers. Fix: Track the binlog format at temporary table create time (open_table_uncached and after final decide_logging_format call for CREATE ... SELECT), and that can be used to decide whether a DROP should be logged or not in method close_temporary_tables. --- .../extra/binlog_tests/drop_temp_table.test | 79 ++++++++++++++----- .../mix_innodb_myisam_binlog.test | 17 ++-- ...gtid_disconnect_drop_temporary_table.test} | 16 +++- ...op_temp_table_on_disconnect_row_mix.result | 22 ++++++ ..._drop_temp_table_on_disconnect_stmt.result | 28 +++++++ .../binlog/r/binlog_row_drop_tmp_tbl.result | 32 ++++---- .../r/binlog_row_mix_innodb_myisam.result | 3 - .../binlog/r/binlog_stm_drop_tmp_tbl.result | 23 +++++- ...drop_temp_table_on_disconnect_row_mix.test | 60 ++++++++++++++ ...og_drop_temp_table_on_disconnect_stmt.test | 56 +++++++++++++ ...tid_disconnect_drop_temporary_table.result | 62 +++++++++++++++ ...id_disconnect_drop_temporary_table.result} | 0 ..._gtid_disconnect_drop_temporary_table.test | 8 ++ ..._gtid_disconnect_drop_temporary_table.test | 8 ++ sql/sql_base.cc | 48 +++++------ sql/sql_insert.cc | 4 + sql/table.cc | 10 +++ sql/table.h | 22 ++++++ 18 files changed, 423 insertions(+), 75 deletions(-) rename mysql-test/{suite/rpl/t/rpl_gtid_disconnect_drop_temporary_table.test => extra/rpl_tests/gtid_disconnect_drop_temporary_table.test} (88%) create mode 100644 mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_row_mix.result create mode 100644 mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_stmt.result create mode 100644 mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_row_mix.test create mode 100644 mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_stmt.test create mode 100644 mysql-test/suite/rpl/r/rpl_row_gtid_disconnect_drop_temporary_table.result rename mysql-test/suite/rpl/r/{rpl_gtid_disconnect_drop_temporary_table.result => rpl_stm_mix_gtid_disconnect_drop_temporary_table.result} (100%) create mode 100644 mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 25cbfcb7c90b..e203bda21bc3 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -67,8 +67,11 @@ connection con2; SELECT GET_LOCK("a",10); let $VERSION=`SELECT VERSION()`; -let $wait_binlog_event=DROP /*!40005 TEMPORARY */ TABLE IF EXISTS; -source include/wait_for_binlog_event.inc; +if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) +{ + let $wait_binlog_event=DROP /*!40005 TEMPORARY */ TABLE IF EXISTS; + source include/wait_for_binlog_event.inc; +} source include/show_binlog_events.inc; DROP DATABASE `drop-temp+table-test`; @@ -86,27 +89,58 @@ DROP DATABASE `drop-temp+table-test`; RESET MASTER; -CREATE TABLE t1 ( i text ); +if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) +{ + CREATE TABLE t1 ( i text ); + + --connect(con1,localhost,root,,) + CREATE TEMPORARY TABLE ttmp1 ( i text ); + SET @@session.binlog_format=ROW; + INSERT INTO t1 VALUES ('1'); + SELECT @@session.binlog_format; + --disconnect con1 + + -- connection default + --let $wait_binlog_event= DROP + --source include/wait_for_binlog_event.inc + --let $mask_binlog_commit_events= 1 + -- source include/show_binlog_events.inc + --let $mask_binlog_commit_events= 0 + DROP TABLE t1; + RESET MASTER; +} ---connect(con1,localhost,root,,) -CREATE TEMPORARY TABLE ttmp1 ( i text ); -SET @@session.binlog_format=ROW; -INSERT INTO t1 VALUES ('1'); -SELECT @@session.binlog_format; ---disconnect con1 +# End of 4.1 tests --- connection default ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc ---let $mask_binlog_commit_events= 1 --- source include/show_binlog_events.inc ---let $mask_binlog_commit_events= 0 -RESET MASTER; +--echo # +--echo # Bug 83003: Using temporary tables on slaves increases GTID sequence number +--echo # -DROP TABLE t1; +--source include/count_sessions.inc +--connect (con1,localhost,root,,) -# End of 4.1 tests +SET @saved_binlog_format= @@SESSION.binlog_format; +SET SESSION binlog_format= STATEMENT; +CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB; +SET SESSION binlog_format= @saved_binlog_format; + +# Check with both transactional and non-transactional tables as those are logged +# separately in close_temporary_tables. +CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trx(a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 0; +CREATE TEMPORARY TABLE temp_binlog_disabled(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 1; + +--disconnect con1 +--connection default +--source include/wait_until_count_sessions.inc + +--source include/show_binlog_events.inc + +# End of 5.6 tests --echo # --echo # BUG#21638823: ASSERTION FAILED: --echo # THD->GET_TRANSACTION()->IS_EMPTY(TRANSACTION_CTX::STMT) || THD @@ -133,8 +167,11 @@ XA END 'idle_at_disconnect'; --disconnect con3 --source include/wait_until_disconnected.inc --connection default ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc +if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) +{ + --let $wait_binlog_event= DROP + --source include/wait_for_binlog_event.inc +} --echo # Dump binlog to show that, either the generated DROP comes after tx --echo # commit (stmt or mixed), or there is no trace of the XA txn and --echo # the temp table (row) @@ -151,4 +188,4 @@ XA ROLLBACK 'idle_when_drop_temp'; # clean up the binary log at in the end of the test # case as well. -RESET MASTER; \ No newline at end of file +RESET MASTER; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index 8aac9474b578..7e8e55fd5829 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -241,13 +241,16 @@ disconnect con2; # Wait until con2 disconnects --source include/wait_until_disconnected.inc connection con3; -# Bug #22084462 - MYSQL TEST BINLOG.BINLOG_ROW_MIX_INNODB_MYISAM FAILS -# Wait to ensure that drop temporary tables events -# are present in binary log. ---let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) # (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) ---let $limit= 0,4 ---let $wait_for_binlog_events= 1 ---source include/assert_binlog_events.inc +if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) +{ + # Bug #22084462 - MYSQL TEST BINLOG.BINLOG_ROW_MIX_INNODB_MYISAM FAILS + # Wait to ensure that drop temporary tables events + # are present in binary log. + --let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) # (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) + --let $limit= 0,4 + --let $wait_for_binlog_events= 1 + --source include/assert_binlog_events.inc +} select get_lock("lock1",60); source include/show_binlog_events.inc; do release_lock("lock1"); diff --git a/mysql-test/suite/rpl/t/rpl_gtid_disconnect_drop_temporary_table.test b/mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test similarity index 88% rename from mysql-test/suite/rpl/t/rpl_gtid_disconnect_drop_temporary_table.test rename to mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test index 577b5f1fa213..efd7bfb71af0 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_disconnect_drop_temporary_table.test +++ b/mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test @@ -92,10 +92,13 @@ while ($i <= 4) --echo # Disconnecting. --disconnect con1 - # Verify that the binlog contains the expected events. - --let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) - --let $wait_for_binlog_events= 1 - --source include/assert_binlog_events.inc + if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) + { + # Verify that the binlog contains the expected events. + --let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) + --let $wait_for_binlog_events= 1 + --source include/assert_binlog_events.inc + } # Sync with slave and assert slave has dropped the temp table. --source include/sync_slave_sql_with_master.inc @@ -106,6 +109,11 @@ while ($i <= 4) # Verify that one gtid was added if gtid_mode=on --connection master --let $gtid_step_gtid_mode_agnostic= 1 + --let $gtid_step_count= 0 + if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) + { + --let $gtid_step_count= 1 + } --source include/gtid_step_assert.inc --inc $i diff --git a/mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_row_mix.result b/mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_row_mix.result new file mode 100644 index 000000000000..944dcbd4aced --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_row_mix.result @@ -0,0 +1,22 @@ +RESET MASTER; +CREATE TABLE t1(a INT) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=MyISAM; +SET @saved_binlog_format= @@SESSION.binlog_format; +SET SESSION binlog_format= 'STATEMENT'; +CREATE TEMPORARY TABLE tmp10 (a INT); +SET SESSION binlog_format= @saved_binlog_format; +CREATE TEMPORARY TABLE tmp1 ENGINE=InnoDB SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp2 ENGINE=MyISAM SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp3 ENGINE=MyISAM SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp4 ENGINE=InnoDB SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp5 (a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE tmp6 (a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE tmp7 LIKE t1; +CREATE TEMPORARY TABLE tmp8 LIKE t2; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; CREATE TABLE t2(a INT) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp10 (a INT) +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `tmp10` +DROP TABLE t1, t2; diff --git a/mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_stmt.result b/mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_stmt.result new file mode 100644 index 000000000000..a0432263cc33 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_drop_temp_table_on_disconnect_stmt.result @@ -0,0 +1,28 @@ +RESET MASTER; +CREATE TABLE t1(a INT) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE tmp1 ENGINE=InnoDB SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp2 ENGINE=MyISAM SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp3 ENGINE=MyISAM SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp4 ENGINE=InnoDB SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp5 (a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE tmp6 (a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE tmp7 LIKE t1; +CREATE TEMPORARY TABLE tmp8 LIKE t2; +SET SESSION binlog_format= 'ROW'; +CREATE TEMPORARY TABLE tmp10 (a INT); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; CREATE TABLE t2(a INT) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1 ENGINE=InnoDB SELECT * FROM t1 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp2 ENGINE=MyISAM SELECT * FROM t2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp3 ENGINE=MyISAM SELECT * FROM t1 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp4 ENGINE=InnoDB SELECT * FROM t2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp5 (a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp6 (a INT) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp7 LIKE t1 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp8 LIKE t2 +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `tmp7`,`tmp5`,`tmp4`,`tmp1` +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `tmp8`,`tmp6`,`tmp3`,`tmp2` +DROP TABLE t1, t2; diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index fb858cb361a3..2b1ab7512c7b 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -34,26 +34,25 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE I master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ -master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` DROP DATABASE `drop-temp+table-test`; RESET MASTER; -CREATE TABLE t1 ( i text ); -CREATE TEMPORARY TABLE ttmp1 ( i text ); -SET @@session.binlog_format=ROW; -INSERT INTO t1 VALUES ('1'); -SELECT @@session.binlog_format; -@@session.binlog_format -ROW +# +# Bug 83003: Using temporary tables on slaves increases GTID sequence number +# +SET @saved_binlog_format= @@SESSION.binlog_format; +SET SESSION binlog_format= STATEMENT; +CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB; +SET SESSION binlog_format= @saved_binlog_format; +CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trx(a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 0; +CREATE TEMPORARY TABLE temp_binlog_disabled(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 1; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i text ) -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` -RESET MASTER; -DROP TABLE t1; +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp_needs_logging` # # BUG#21638823: ASSERTION FAILED: # THD->GET_TRANSACTION()->IS_EMPTY(TRANSACTION_CTX::STMT) || THD @@ -80,7 +79,6 @@ XA END 'idle_at_disconnect'; # the temp table (row) include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp` # # Start XA txn and leave in XA_idle XA START 'idle_when_drop_temp'; diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 91247a8f1a06..829b5ecf940d 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -261,7 +261,6 @@ set autocommit=0; create table t2 (n int) engine=innodb; insert into t2 values (3); include/save_binlog_position.inc -include/assert_binlog_events.inc [(Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) # (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*)] select get_lock("lock1",60); get_lock("lock1",60) 1 @@ -298,8 +297,6 @@ master-bin.000001 # Table_map # # table_id: # (test.t0) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb -master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ti` -master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1` do release_lock("lock1"); drop table t0,t2; set autocommit=0; diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 244e8dd005ab..ad854fa90dda 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -60,8 +60,29 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` -RESET MASTER; DROP TABLE t1; +RESET MASTER; +# +# Bug 83003: Using temporary tables on slaves increases GTID sequence number +# +SET @saved_binlog_format= @@SESSION.binlog_format; +SET SESSION binlog_format= STATEMENT; +CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB; +SET SESSION binlog_format= @saved_binlog_format; +CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trx(a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 0; +CREATE TEMPORARY TABLE temp_binlog_disabled(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 1; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_non_trx(a INT) ENGINE=MyISAM +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp_needs_logging_in_stmt`,`temp_trx`,`temp_needs_logging` +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp_non_trx` # # BUG#21638823: ASSERTION FAILED: # THD->GET_TRANSACTION()->IS_EMPTY(TRANSACTION_CTX::STMT) || THD diff --git a/mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_row_mix.test b/mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_row_mix.test new file mode 100644 index 000000000000..556671e9a005 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_row_mix.test @@ -0,0 +1,60 @@ +# ====== Purpose ======= +# +# This test verifies that DROP for a temporary table created +# in Row mode is not logged in binlog at session disconnect. +# +# ====== Implementation ====== +# +# Create temporary tables in Row mode using different engines, +# also create a temporary table in Statement mode, now when you connect to the session +# after a disconnect print the output of show binlog events. +# This will verify that the DROP for temporary table created in statement +# mode is written to binary log at session disconnect, but for the temporary table +# created in Row mode no DROP statement for temporary table is logged at session +# disconnect. +# +# ====== References ======= +# +# Bug#28606948:BACKPORT OF BUG #24670909 TO 5.7.22 +# +# The name of this file has row_mix even though we are just testing in row +# format because we want the name of tests to be consistent in 5.7 and 8.0 + +--source include/have_log_bin.inc +--source include/have_myisam.inc +--source include/have_binlog_format_row.inc + +RESET MASTER; + +CREATE TABLE t1(a INT) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=MyISAM; + +--source include/count_sessions.inc + +--connect(con1,localhost,root) + +SET @saved_binlog_format= @@SESSION.binlog_format; +# A DROP for tmp10 should be binlogged because CREATE TABLE is +# created in Statement mode + +SET SESSION binlog_format= 'STATEMENT'; +CREATE TEMPORARY TABLE tmp10 (a INT); +SET SESSION binlog_format= @saved_binlog_format; + +# No DROP should be logged for any of the statements below +CREATE TEMPORARY TABLE tmp1 ENGINE=InnoDB SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp2 ENGINE=MyISAM SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp3 ENGINE=MyISAM SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp4 ENGINE=InnoDB SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp5 (a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE tmp6 (a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE tmp7 LIKE t1; +CREATE TEMPORARY TABLE tmp8 LIKE t2; + +--disconnect con1 +--connection default +--source include/wait_until_count_sessions.inc + +--source include/show_binlog_events.inc + +DROP TABLE t1, t2; diff --git a/mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_stmt.test b/mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_stmt.test new file mode 100644 index 000000000000..d8d30addf839 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_drop_temp_table_on_disconnect_stmt.test @@ -0,0 +1,56 @@ +# ====== Purpose ======= +# +# This test verifies that DROP for a temporary table created +# in Row mode is not logged in binlog at session disconnect. +# +# ====== Implementation ====== +# +# Create temporary tables in statement or mixed mode using different engines, +# also create a temporary table in Row mode, now when you connect to the session +# after a disconnect print the output of show binlog events. +# This will verify that the DROP for temporary table created in stmt or mixed +# mode is written to binary log at session disconnect, but for the temporary table +# created in Row mode no DROP statement for temporary table is logged at session +# disconnect. +# +# ====== References ======= +# +# Bug#28606948:BACKPORT OF BUG #24670909 TO 5.7.22 +# + +--source include/have_log_bin.inc +--source include/have_myisam.inc +--source include/have_binlog_format_mixed_or_statement.inc + +RESET MASTER; + +CREATE TABLE t1(a INT) ENGINE=InnoDB; +CREATE TABLE t2(a INT) ENGINE=MyISAM; + +--source include/count_sessions.inc + +--connect(con1,localhost,root) + +# A DROP should be logged for the following tables because CREATE TABLE +# is logged +CREATE TEMPORARY TABLE tmp1 ENGINE=InnoDB SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp2 ENGINE=MyISAM SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp3 ENGINE=MyISAM SELECT * FROM t1; +CREATE TEMPORARY TABLE tmp4 ENGINE=InnoDB SELECT * FROM t2; +CREATE TEMPORARY TABLE tmp5 (a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE tmp6 (a INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE tmp7 LIKE t1; +CREATE TEMPORARY TABLE tmp8 LIKE t2; + +SET SESSION binlog_format= 'ROW'; +# No DROP should be logged for tmp10 +CREATE TEMPORARY TABLE tmp10 (a INT); + +--disconnect con1 +--connection default +--source include/wait_until_count_sessions.inc + +--source include/show_binlog_events.inc + +DROP TABLE t1, t2; + diff --git a/mysql-test/suite/rpl/r/rpl_row_gtid_disconnect_drop_temporary_table.result b/mysql-test/suite/rpl/r/rpl_row_gtid_disconnect_drop_temporary_table.result new file mode 100644 index 000000000000..9c2e506831a5 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_gtid_disconnect_drop_temporary_table.result @@ -0,0 +1,62 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +CREATE TABLE t (a INT); +---- 1. Disconnect after SET GTID_NEXT ---- +include/rpl_connect.inc [creating con1] +[connection con1] +CREATE TEMPORARY TABLE tt (a INT); +SET GTID_NEXT = '#'; +include/save_binlog_position.inc +include/gtid_step_reset.inc +# Disconnecting. +include/sync_slave_sql_with_master.inc +include/assert.inc [Slave should not have any open temporary tables.] +include/gtid_step_assert.inc [count=0, only_count=0] +---- 2. Disconnect in the middle of transaction ---- +include/rpl_connect.inc [creating con1] +[connection con1] +CREATE TEMPORARY TABLE tt (a INT); +SET GTID_NEXT = '#'; +BEGIN; +INSERT INTO t VALUES (1); +include/save_binlog_position.inc +include/gtid_step_reset.inc +# Disconnecting. +include/sync_slave_sql_with_master.inc +include/assert.inc [Slave should not have any open temporary tables.] +include/gtid_step_assert.inc [count=0, only_count=0] +---- 3. Disconnect after COMMIT ---- +include/rpl_connect.inc [creating con1] +[connection con1] +CREATE TEMPORARY TABLE tt (a INT); +SET GTID_NEXT = '#'; +BEGIN; +INSERT INTO t VALUES (1); +COMMIT; +include/save_binlog_position.inc +include/gtid_step_reset.inc +# Disconnecting. +include/sync_slave_sql_with_master.inc +include/assert.inc [Slave should not have any open temporary tables.] +include/gtid_step_assert.inc [count=0, only_count=0] +---- 4. Disconnect after ROLLBACK ---- +include/rpl_connect.inc [creating con1] +[connection con1] +CREATE TEMPORARY TABLE tt (a INT); +SET GTID_NEXT = '#'; +BEGIN; +INSERT INTO t VALUES (1); +ROLLBACK; +include/save_binlog_position.inc +include/gtid_step_reset.inc +# Disconnecting. +include/sync_slave_sql_with_master.inc +include/assert.inc [Slave should not have any open temporary tables.] +include/gtid_step_assert.inc [count=0, only_count=0] +---- Clean up ---- +DROP TABLE t; +include/sync_slave_sql_with_master.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_disconnect_drop_temporary_table.result b/mysql-test/suite/rpl/r/rpl_stm_mix_gtid_disconnect_drop_temporary_table.result similarity index 100% rename from mysql-test/suite/rpl/r/rpl_gtid_disconnect_drop_temporary_table.result rename to mysql-test/suite/rpl/r/rpl_stm_mix_gtid_disconnect_drop_temporary_table.result diff --git a/mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test b/mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test new file mode 100644 index 000000000000..29076f636a99 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test @@ -0,0 +1,8 @@ +# This is a wrapper for gtid_disconnect_drop_temporary_table.test +# so that the same test can be used for mix/statement and row mode +# The o/p of the above mentioned test varies with binlog format due to +# Bug#28606948 + +--source include/have_binlog_format_row.inc + +--source extra/rpl_tests/gtid_disconnect_drop_temporary_table.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test b/mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test new file mode 100644 index 000000000000..f9d510af99b5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test @@ -0,0 +1,8 @@ +# This is a wrapper for gtid_disconnect_drop_temporary_table.test +# so that the same test can be used for mix/statement and row mode +# The o/p of the above mentioned test varies with binlog format due to +# Bug#28606948 + +--source include/have_binlog_format_mixed_or_statement.inc + +--source extra/rpl_tests/gtid_disconnect_drop_temporary_table.test diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8cdd317ad91e..958246f08c34 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1945,7 +1945,7 @@ bool close_temporary_tables(THD *thd) /* scan sorted tmps to generate sequence of DROP */ for (table= thd->temporary_tables; table; table= next) { - if (is_user_table(table)) + if (is_user_table(table) && table->should_binlog_drop_if_temp()) { bool save_thread_specific_used= thd->thread_specific_used; my_thread_id save_pseudo_thread_id= thd->variables.pseudo_thread_id; @@ -1966,27 +1966,28 @@ bool close_temporary_tables(THD *thd) table= next) { /* Separate transactional from non-transactional temp tables */ - if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) - { - found_trans_table= true; - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query_trans, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query_trans.append(','); - } - else if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) - { - found_non_trans_table= true; - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query_non_trans, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query_non_trans.append(','); + if (table->should_binlog_drop_if_temp()) { + if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) { + found_trans_table= true; + /* + We are going to add ` around the table names and possible more + due to special characters + */ + append_identifier(thd, &s_query_trans, table->s->table_name.str, + strlen(table->s->table_name.str)); + s_query_trans.append(','); + } + else if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) + { + found_non_trans_table= true; + /* + We are going to add ` around the table names and possible more + due to special characters + */ + append_identifier(thd, &s_query_non_trans, table->s->table_name.str, + strlen(table->s->table_name.str)); + s_query_non_trans.append(','); + } } next= table->next; @@ -2069,6 +2070,7 @@ bool close_temporary_tables(THD *thd) else { next= table->next; + mysql_lock_remove(thd, thd->lock, table); close_temporary(table, 1, 1); slave_closed_temp_tables++; } @@ -6970,6 +6972,8 @@ TABLE *open_table_uncached(THD *thd, const char *path, const char *db, if (add_to_temporary_tables_list) { + tmp_table->set_binlog_drop_if_temp(!thd->is_current_stmt_binlog_disabled() + && !thd->is_current_stmt_binlog_format_row()); /* growing temp list at the head */ tmp_table->next= thd->temporary_tables; if (tmp_table->next) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 83f863388bd1..d8616a067354 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2804,6 +2804,10 @@ int Query_result_create::prepare2() return error; TABLE const *const table = *tables; + create_table->table->set_binlog_drop_if_temp( + !thd->is_current_stmt_binlog_disabled() + && !thd->is_current_stmt_binlog_format_row()); + if (thd->is_current_stmt_binlog_format_row() && !table->s->tmp_table) { diff --git a/sql/table.cc b/sql/table.cc index 698ed2988ee6..12bd23e4cb21 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -7931,3 +7931,13 @@ void TABLE::blobs_need_not_keep_old_value() (down_cast(vfield))->set_keep_old_value(false); } } + +void TABLE::set_binlog_drop_if_temp(bool should_binlog) +{ + should_binlog_drop_if_temp_flag= should_binlog; +} + +bool TABLE::should_binlog_drop_if_temp(void) const +{ + return should_binlog_drop_if_temp_flag; +} diff --git a/sql/table.h b/sql/table.h index e7e967b982f1..246f6c76e0fb 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1468,12 +1468,34 @@ struct TABLE @returns false for success, true for error */ bool contains_records(THD *thd, bool *retval); +private: + + /** + This flag decides whether or not we should log the drop temporary table + command. + */ + bool should_binlog_drop_if_temp_flag; +public: /** Virtual fields of type BLOB have a flag m_keep_old_value. This flag is set to false for all such fields in this table. */ void blobs_need_not_keep_old_value(); + + /** + Set the variable should_binlog_drop_if_temp_flag, so that + the logging of temporary tables can be decided. + + @param should_binlog the value to set flag should_binlog_drop_if_temp_flag + */ + void set_binlog_drop_if_temp(bool should_binlog); + + /** + @return whether should_binlog_drop_if_temp_flag flag is + set or not + */ + bool should_binlog_drop_if_temp(void) const; }; From 7dd239b00997751f611cb0f463d985c9bad76d8b Mon Sep 17 00:00:00 2001 From: Bin Su Date: Fri, 2 Nov 2018 13:32:57 +0800 Subject: [PATCH 070/214] Bug#28448853 - ASSERTION FAILURE: ROW0LOG.CC:2153 ROW_LOG_TABLE_APPLY (THR=0X7F7C7C050030 This is due to DML(update) log written during online DDL was not logged correctly or as expected. If there are no changes on virutal column or the changed virtual columns are not on any index, then there is actually no need to write any log for them. In the rollback case, the code path will write empty record for both old and new virtual columns, which introduces a new scenario for log parser. However, the parser only expects a 2 bytes length marker if there is nothing to be logged, rather than two consecutive 2 bytes length marker. So the fix should be that if there is nothing to be logged for new virtual column value, then there is also nothing to be logged for old virtual column value in the update case. So only one 2 bytes length marker would be kept for parser to understand the scenario, rather than two markers. RB: 20787 Reviewed-by: Sunny Bains --- .../suite/innodb/r/virtual_debug.result | 32 ++++++++++++ mysql-test/suite/innodb/t/virtual_debug.test | 49 +++++++++++++++++++ storage/innobase/row/row0log.cc | 21 ++++++-- 3 files changed, 97 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/innodb/r/virtual_debug.result b/mysql-test/suite/innodb/r/virtual_debug.result index 368f243d47fc..d4b2b3ca08a5 100644 --- a/mysql-test/suite/innodb/r/virtual_debug.result +++ b/mysql-test/suite/innodb/r/virtual_debug.result @@ -252,3 +252,35 @@ a d b c vadcol vbcol vbidxcol 2 2 rocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaoocrocalrulcrcaurcuccoolrouuocacaooaucauualcucuoucucclolcllloocuarcoorlaccarocouuaoorcolloucraoaaooc 0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo0.366710324443464crllooolarlollorlulololucrluacoorrrluroluroocouauacacruloulcurlraorcrclrolcocrrcoccolourrooclrcocruruauallo 3 oc roc DROP TABLE ibstd_07; SET DEBUG_SYNC = 'RESET'; +# +# BUG#28448853 - ASSERTION FAILURE: ROW0LOG.CC:2153 ROW_LOG_TABLE_APPLY (THR=0X7F7C7C050030 +# +CREATE TABLE t1(a INT NOT NULL, d INT NOT NULL, b VARCHAR(198) NOT NULL, c CHAR(84), vbcol CHAR(2) AS (substr(b, 2, 2)) VIRTUAL); +INSERT INTO t1(a, d, b, c) VALUES(200, 300, '1.3.1415926535', 'hello world'); +SELECT * FROM t1; +a d b c vbcol +200 300 1.3.1415926535 hello world .3 +SET DEBUG_SYNC = 'inplace_after_index_build SIGNAL altered WAIT_FOR dmls_done'; +ALTER TABLE t1 ROW_FORMAT = COMPRESSED;; +SET DEBUG_SYNC = 'now WAIT_FOR altered'; +START TRANSACTION; +UPDATE t1 SET b = '6.1516179' WHERE a = 200; +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dmls_done'; +SET DEBUG_SYNC = 'reset'; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `d` int(11) NOT NULL, + `b` varchar(198) NOT NULL, + `c` char(84) DEFAULT NULL, + `vbcol` char(2) GENERATED ALWAYS AS (substr(`b`,2,2)) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED +SELECT * FROM t1; +a d b c vbcol +200 300 1.3.1415926535 hello world .3 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/virtual_debug.test b/mysql-test/suite/innodb/t/virtual_debug.test index a589cd0d497e..6483fa9fafa7 100644 --- a/mysql-test/suite/innodb/t/virtual_debug.test +++ b/mysql-test/suite/innodb/t/virtual_debug.test @@ -312,3 +312,52 @@ disconnect con1; SET DEBUG_SYNC = 'RESET'; --source include/wait_until_count_sessions.inc + + + +--echo # +--echo # BUG#28448853 - ASSERTION FAILURE: ROW0LOG.CC:2153 ROW_LOG_TABLE_APPLY (THR=0X7F7C7C050030 +--echo # + +CREATE TABLE t1(a INT NOT NULL, d INT NOT NULL, b VARCHAR(198) NOT NULL, c CHAR(84), vbcol CHAR(2) AS (substr(b, 2, 2)) VIRTUAL); + +INSERT INTO t1(a, d, b, c) VALUES(200, 300, '1.3.1415926535', 'hello world'); + +SELECT * FROM t1; + +connect (conn1, localhost, root,,); + +connection default; + +SET DEBUG_SYNC = 'inplace_after_index_build SIGNAL altered WAIT_FOR dmls_done'; + +--send ALTER TABLE t1 ROW_FORMAT = COMPRESSED; + +connection conn1; + +SET DEBUG_SYNC = 'now WAIT_FOR altered'; + +START TRANSACTION; +UPDATE t1 SET b = '6.1516179' WHERE a = 200; +ROLLBACK; + +SET DEBUG_SYNC = 'now SIGNAL dmls_done'; + +disconnect conn1; + +connection default; + +reap; + +SET DEBUG_SYNC = 'reset'; + +CHECK TABLE t1; + +SHOW CREATE TABLE t1; + +SELECT * FROM t1; + +DROP TABLE t1; + + +--source include/wait_until_count_sessions.inc diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index bfea2a8f8b42..1801c11fc60a 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -967,11 +967,17 @@ row_log_table_low( + (extra_size >= 0x80) + rec_offs_size(offsets) - omit_size; if (ventry && ventry->n_v_fields > 0) { - ulint v_extra = 0; - mrec_size += rec_get_converted_size_temp( + ulint v_extra = 0; + uint64_t rec_size = rec_get_converted_size_temp( new_index, NULL, 0, ventry, &v_extra); - if (o_ventry) { + mrec_size += rec_size; + + /* If there is actually nothing to be logged for new entry, + then there must be also nothing to do with old entry. + In this case, make it same with the case below, by only keep + 2 bytes length marker */ + if (rec_size > 2 && o_ventry != NULL) { mrec_size += rec_get_converted_size_temp( new_index, NULL, 0, o_ventry, &v_extra); } @@ -1028,11 +1034,16 @@ row_log_table_low( b += rec_offs_data_size(offsets); if (ventry && ventry->n_v_fields > 0) { + uint64_t new_v_size; + rec_convert_dtuple_to_temp( b, new_index, NULL, 0, ventry); - b += mach_read_from_2(b); + new_v_size = mach_read_from_2(b); + b += new_v_size; - if (o_ventry) { + /* Nothing for new entry to be logged, + skip the old one too. */ + if (new_v_size != 2 && o_ventry != NULL) { rec_convert_dtuple_to_temp( b, new_index, NULL, 0, o_ventry); b += mach_read_from_2(b); From 5521020be51c8b0f049f9c59f6c5499fdb5219e0 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Fri, 2 Nov 2018 12:35:56 +0100 Subject: [PATCH 071/214] From bfc2e06204d913ca3593b64888747a6334f904c9 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Mon, 5 Nov 2018 14:44:34 +0530 Subject: [PATCH 072/214] Bug25364178: XA PREPARE INCONSISTENT WITH XTRABACKUP Post push fix for sporadic failure of flush_read_lock.test --- mysql-test/t/flush_read_lock.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test index 6541639df33e..4a40bee89a5f 100644 --- a/mysql-test/t/flush_read_lock.test +++ b/mysql-test/t/flush_read_lock.test @@ -1844,6 +1844,7 @@ xa end 'test1'; xa prepare 'test1'; --echo # Disconnect temporary connection disconnect con_tmp; +--source include/wait_until_disconnected.inc --echo # Create temporary connection for XA transaction. connect (con_tmp,localhost,root,,); xa start 'test2'; @@ -1852,6 +1853,7 @@ xa end 'test2'; xa prepare 'test2'; --echo # Disconnect temporary connection disconnect con_tmp; +--source include/wait_until_disconnected.inc --echo # Switching to connection '$con_aux1'. connection $con_aux1; flush tables with read lock; From fd0abb16247e70c9edb58ebed7e300e278e5f743 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Tue, 16 Oct 2018 17:34:13 +0530 Subject: [PATCH 073/214] BUG#28022129: NOW() DOESN'T HONOR NO_ZERO_DATE SQL_MODE Analysis ======== CREATE TABLE..SELECT generates zero date as default value for temporal columns in STRICT, NO_ZERO_DATE mode when the columns are not based on source table columns directly. CREATE TABLE..SELECT generates implicit default values for columns without a default value which in case of temporal columns contains zero date component. The implict defaults generated are marked as explicit default value (because the flag 'NO_DEFAULT_VALUE_FLAG' is not set), thus skipping the checks which validate the default value based on the SQL mode. Hence tables with zero date are created in strict mode. Fix === The function "create_table_from_items()" has been modified to mark columns having date component which are based on expressions and not source table columns directly as having no default value in strict mode i.e 'NO_DEFAULT_VALUE_FLAG' flag is set in such cases. This ensures that tables are created without zero date as default value. --- mysql-test/r/create.result | 71 ++++++++++++++++++++++++++++ mysql-test/r/temporal_literal.result | 22 ++++----- mysql-test/t/create.test | 62 ++++++++++++++++++++++++ sql/sql_insert.cc | 12 ++++- 4 files changed, 155 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 9c4e37512158..0a5ae112376d 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -2006,3 +2006,74 @@ DROP TABLE t1, t2, t3, t4; DROP TABLE t1, t2, t3, t4; SET GLOBAL innodb_default_row_format= @saved_innodb_default_row_format; SET SESSION show_create_table_verbosity= @saved_show_create_table_verbosity; +# +# Bug#28022129: NOW() DOESN?T HONOR NO_ZERO_DATE SQL_MODE +# +SET @saved_mode= @@sql_mode; +CREATE TABLE t1(fld1 int); +# NO_ZERO_DATE and STRICT SQL mode. +CREATE TABLE t2 SELECT fld1, CURDATE() fld2 FROM t1; +CREATE TABLE t3 AS SELECT now(); +# With patch, zero date is not generated as default. +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fld1` int(11) DEFAULT NULL, + `fld2` date NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `now()` datetime NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2, t3; +SET SQL_MODE= "NO_ZERO_DATE"; +Warnings: +Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. +Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. +# NO_ZERO_DATE SQL mode. +CREATE TABLE t2 SELECT fld1, CURDATE() fld2 FROM t1; +CREATE TABLE t3 AS SELECT now(); +# Zero date is generated as default in non strict mode. +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fld1` int(11) DEFAULT NULL, + `fld2` date NOT NULL DEFAULT '0000-00-00' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `now()` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1, t2, t3; +SET SQL_MODE= DEFAULT; +# Test cases added for coverage. +CREATE TABLE t1(fld1 DATETIME NOT NULL DEFAULT '1111:11:11'); +# CREATE TABLE..SELECT using fields of another table. +CREATE TABLE t2 AS SELECT * FROM t1; +# Default value is copied from the source table column. +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fld1` datetime NOT NULL DEFAULT '1111-11-11 00:00:00' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +# CREATE TABLE..SELECT based on trigger fields. +CREATE TABLE t1 (fld1 INT, fld2 DATETIME DEFAULT '1211:1:1'); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +BEGIN +CREATE TEMPORARY TABLE t2 AS SELECT NEW.fld1, NEW.fld2; +END +| +INSERT INTO t1 VALUES (1, '1111:11:11'); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TEMPORARY TABLE `t2` ( + `fld1` int(11) DEFAULT NULL, + `fld2` datetime DEFAULT '1211-01-01 00:00:00' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TEMPORARY TABLE t2; +SET SQL_MODE= @saved_mode; diff --git a/mysql-test/r/temporal_literal.result b/mysql-test/r/temporal_literal.result index 0fa1b1db3af4..7e246b511f96 100644 --- a/mysql-test/r/temporal_literal.result +++ b/mysql-test/r/temporal_literal.result @@ -245,14 +245,14 @@ TIMESTAMP'2010-01-01 10:10:10.123456'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `TIMESTAMP'2010-01-01 10:10:10'` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `TIMESTAMP'2010-01-01 10:10:10.'` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `TIMESTAMP'2010-01-01 10:10:10.1'` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `TIMESTAMP'2010-01-01 10:10:10.12'` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `TIMESTAMP'2010-01-01 10:10:10.123'` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `TIMESTAMP'2010-01-01 10:10:10.1234'` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `TIMESTAMP'2010-01-01 10:10:10.12345'` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `TIMESTAMP'2010-01-01 10:10:10.123456'` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `TIMESTAMP'2010-01-01 10:10:10'` datetime NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.'` datetime NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.1'` datetime(1) NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.12'` datetime(2) NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.123'` datetime(3) NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.1234'` datetime(4) NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.12345'` datetime(5) NOT NULL, + `TIMESTAMP'2010-01-01 10:10:10.123456'` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @@ -263,9 +263,9 @@ CREATE TABLE t1 AS SELECT SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `{ts'2001-01-01 10:10:10'}` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `{ts'2001-01-01 10:10:10.'}` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `{ts'2001-01-01 10:10:10.123456'}` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `{ts'2001-01-01 10:10:10'}` datetime NOT NULL, + `{ts'2001-01-01 10:10:10.'}` datetime NOT NULL, + `{ts'2001-01-01 10:10:10.123456'}` datetime(6) NOT NULL, `2001-01-01` varchar(10) NOT NULL DEFAULT '' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 040d9c68b981..df0552d63d5a 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1880,3 +1880,65 @@ DROP TABLE t1, t2, t3, t4; DROP TABLE t1, t2, t3, t4; SET GLOBAL innodb_default_row_format= @saved_innodb_default_row_format; SET SESSION show_create_table_verbosity= @saved_show_create_table_verbosity; + + +--echo # +--echo # Bug#28022129: NOW() DOESN?T HONOR NO_ZERO_DATE SQL_MODE +--echo # + +SET @saved_mode= @@sql_mode; + +CREATE TABLE t1(fld1 int); + +--echo # NO_ZERO_DATE and STRICT SQL mode. + +CREATE TABLE t2 SELECT fld1, CURDATE() fld2 FROM t1; +CREATE TABLE t3 AS SELECT now(); + +--echo # With patch, zero date is not generated as default. +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +DROP TABLE t2, t3; + +SET SQL_MODE= "NO_ZERO_DATE"; + +--echo # NO_ZERO_DATE SQL mode. +CREATE TABLE t2 SELECT fld1, CURDATE() fld2 FROM t1; +CREATE TABLE t3 AS SELECT now(); + +--echo # Zero date is generated as default in non strict mode. +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +DROP TABLE t1, t2, t3; + +SET SQL_MODE= DEFAULT; + +--echo # Test cases added for coverage. + +CREATE TABLE t1(fld1 DATETIME NOT NULL DEFAULT '1111:11:11'); + +--echo # CREATE TABLE..SELECT using fields of another table. +CREATE TABLE t2 AS SELECT * FROM t1; +--echo # Default value is copied from the source table column. +SHOW CREATE TABLE t2; + +DROP TABLE t1, t2; + +--echo # CREATE TABLE..SELECT based on trigger fields. +CREATE TABLE t1 (fld1 INT, fld2 DATETIME DEFAULT '1211:1:1'); + +DELIMITER |; +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +BEGIN + CREATE TEMPORARY TABLE t2 AS SELECT NEW.fld1, NEW.fld2; +END +| +DELIMITER ;| + +INSERT INTO t1 VALUES (1, '1111:11:11'); +SHOW CREATE TABLE t2; + +DROP TABLE t1; +DROP TEMPORARY TABLE t2; +SET SQL_MODE= @saved_mode; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d8616a067354..bf30c64da071 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2613,7 +2613,17 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, table_field= ((Item_field *) item)->field; break; default: - table_field= NULL; + { + /* + If the expression is of temporal type having date and non-nullable, + a zero date is generated. If in strict mode, then zero date is + invalid. For such cases no default is generated. + */ + table_field= NULL; + if (tmp_table_field->is_temporal_with_date() && + thd->is_strict_mode() && !item->maybe_null) + tmp_table_field->flags|= NO_DEFAULT_VALUE_FLAG; + } } DBUG_ASSERT(tmp_table_field->gcol_info== NULL && tmp_table_field->stored_in_db); From c1a7c105b5e82afad7b03a76831e6676acc4f167 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Mon, 5 Nov 2018 16:00:24 +0530 Subject: [PATCH 074/214] Bug#28483283: BACKPORT BUGFIX 26929724 TO MYSQL 5.5 AND 5.6 Description: MYISAM index corruption occurs for bulk insert or repair table which involves "repair by sorting" algorithm. Analysis: The index corruption happens because of the incorrect sorting done by "my_qsort2()". This happens for a bulk insert with more than 450001959 rows or repair table with more than 450001959 rows. In 5.7, "my_qsort2()" is replaced by std::sort() as part of Bug#26929724. Fix:- Back ported Bug#26929724 fix to ensure MyISAM repair by sorting algorithm uses std::sort(). --- storage/myisam/CMakeLists.txt | 4 ++-- storage/myisam/myisamdef.h | 10 +++++++++- storage/myisam/{sort.c => sort.cc} | 30 ++++++++++++++++++++++-------- 3 files changed, 33 insertions(+), 11 deletions(-) rename storage/myisam/{sort.c => sort.cc} (98%) diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt index 0cc89a48f44f..100e834b6e64 100644 --- a/storage/myisam/CMakeLists.txt +++ b/storage/myisam/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c mi_rfirst.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c - rt_split.c sort.c sp_key.c mi_extrafunc.h myisamdef.h + rt_split.c sort.cc sp_key.c mi_extrafunc.h myisamdef.h rt_index.h mi_rkey.c) MYSQL_ADD_PLUGIN(myisam ${MYISAM_SOURCES} diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 0521da273cbe..76814508df8a 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -474,6 +474,10 @@ extern mysql_mutex_t THR_LOCK_myisam; #define mysql_rwlock_wrlock(A) {} #define mysql_rwlock_rdlock(A) {} #define mysql_rwlock_unlock(A) {} +#endif + +#ifdef __cplusplus +extern "C" { #endif /* Some extern variables */ @@ -637,6 +641,10 @@ extern ulonglong mi_safe_mul(ulonglong a,ulonglong b); extern int _mi_ft_update(MI_INFO *info, uint keynr, uchar *keybuf, const uchar *oldrec, const uchar *newrec, my_off_t pos); +#ifdef __cplusplus +} +#endif + struct st_sort_info; diff --git a/storage/myisam/sort.c b/storage/myisam/sort.cc similarity index 98% rename from storage/myisam/sort.c rename to storage/myisam/sort.cc index f28e7802847e..37b8ac21ed98 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,9 @@ them in sorted order through SORT_INFO functions. */ +#include +#include +#include #include "fulltext.h" #if defined(__WIN__) #include @@ -36,6 +39,17 @@ #define MYF_RW MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL) #define DISK_BUFFER_SIZE (IO_SIZE*16) +class Key_compare : + public std::binary_function +{ +public: + Key_compare(MI_SORT_PARAM *param) : info(param) {} + bool operator()(const uchar *a, const uchar *b) + { + return info->key_cmp(info, &a, &b) < 0; + } + MI_SORT_PARAM *info; +}; /* Pointers of functions for store and read keys from temp file @@ -568,7 +582,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_BUFFER) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= (uchar *) my_malloc(length, MYF(0)))) break; length=length*3/4; } @@ -655,8 +669,8 @@ static int write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, uint sort_length=info->key_length; DBUG_ENTER("write_keys"); - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + std::sort(sort_keys, sort_keys + count, Key_compare(info)); + if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -698,8 +712,8 @@ static int write_keys_varlen(MI_SORT_PARAM *info, int err; DBUG_ENTER("write_keys_varlen"); - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + std::sort(sort_keys, sort_keys + count, Key_compare(info)); + if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -740,8 +754,8 @@ static int write_index(MI_SORT_PARAM *info, register uchar **sort_keys, { DBUG_ENTER("write_index"); - my_qsort2((uchar*) sort_keys,(size_t) count,sizeof(uchar*), - (qsort2_cmp) info->key_cmp,info); + std::sort(sort_keys, sort_keys + count, Key_compare(info)); + while (count--) { if ((*info->key_write)(info,*sort_keys++)) From ade9927d2ea73ba34e3bd2c2d8cae02a7100e295 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Mon, 5 Nov 2018 19:46:02 +0530 Subject: [PATCH 075/214] BUG#28022129: NOW() DOESN'T HONOR NO_ZERO_DATE SQL_MODE Post push fix for test failure. --- mysql-test/r/type_temporal_fractional.result | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/type_temporal_fractional.result b/mysql-test/r/type_temporal_fractional.result index 7d36c75d3a00..f46c51d3a584 100644 --- a/mysql-test/r/type_temporal_fractional.result +++ b/mysql-test/r/type_temporal_fractional.result @@ -73,13 +73,13 @@ NOW(0), NOW(1), NOW(2), NOW(3), NOW(4), NOW(5), NOW(6); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `NOW(0)` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `NOW(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `NOW(2)` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `NOW(3)` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `NOW(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `NOW(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `NOW(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `NOW(0)` datetime NOT NULL, + `NOW(1)` datetime(1) NOT NULL, + `NOW(2)` datetime(2) NOT NULL, + `NOW(3)` datetime(3) NOT NULL, + `NOW(4)` datetime(4) NOT NULL, + `NOW(5)` datetime(5) NOT NULL, + `NOW(6)` datetime(6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @@ -89,13 +89,13 @@ SYSDATE(4), SYSDATE(5), SYSDATE(6); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `SYSDATE(0)` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SYSDATE(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `SYSDATE(2)` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `SYSDATE(3)` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `SYSDATE(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `SYSDATE(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `SYSDATE(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `SYSDATE(0)` datetime NOT NULL, + `SYSDATE(1)` datetime(1) NOT NULL, + `SYSDATE(2)` datetime(2) NOT NULL, + `SYSDATE(3)` datetime(3) NOT NULL, + `SYSDATE(4)` datetime(4) NOT NULL, + `SYSDATE(5)` datetime(5) NOT NULL, + `SYSDATE(6)` datetime(6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT From 114c50326ae987bc9cbd4510829fc204e89b1990 Mon Sep 17 00:00:00 2001 From: Przemek Skibinski Date: Fri, 2 Nov 2018 13:40:47 +0100 Subject: [PATCH 076/214] PS-4781: sql_yacc.yy uses SQLCOM_SELECT instead of SQLCOM_SHOW_XXXX_STATS 1. Add missing SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS, SQLCOM_SHOW_CLIENT_STATS, SQLCOM_SHOW_THREAD_STATS to `init_sql_command_flags()` and `mysql_execute_command()` 2. Use proper SQLCOM_SHOW_XXXX_STATS in `sql_yacc.yy` for `SHOW XXXX_STATISTICS;` instead of SQLCOM_SELECT 3. Re-record percona_userstat.result --- mysql-test/r/percona_userstat.result | 4 ++-- sql/sql_parse.cc | 10 ++++++++++ sql/sql_yacc.yy | 10 +++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/percona_userstat.result b/mysql-test/r/percona_userstat.result index 3c44a7a9dc7d..39a0caf5779d 100644 --- a/mysql-test/r/percona_userstat.result +++ b/mysql-test/r/percona_userstat.result @@ -61,10 +61,10 @@ SHOW TABLE_STATISTICS; Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes SHOW THREAD_STATISTICS; Thread_id Total_connections Concurrent_connections Connected_time Busy_time Cpu_time Bytes_received Bytes_sent Binlog_bytes_written Rows_fetched Rows_updated Table_rows_read Select_commands Update_commands Other_commands Commit_transactions Rollback_transactions Denied_connections Lost_connections Access_denied Empty_queries Total_ssl_connections -THREAD_ID 1 0 CONNECTED_TIME BUSY_TIME CPU_TIME 350 0 0 4 0 0 8 0 0 0 0 0 0 0 4 0 +THREAD_ID 1 0 CONNECTED_TIME BUSY_TIME CPU_TIME 350 0 0 3 0 0 5 0 3 0 0 0 0 0 2 0 SHOW USER_STATISTICS; User Total_connections Concurrent_connections Connected_time Busy_time Cpu_time Bytes_received Bytes_sent Binlog_bytes_written Rows_fetched Rows_updated Table_rows_read Select_commands Update_commands Other_commands Commit_transactions Rollback_transactions Denied_connections Lost_connections Access_denied Empty_queries Total_ssl_connections -root 1 0 CONNECTED_TIME BUSY_TIME CPU_TIME 413 0 0 5 0 0 9 0 1 0 0 0 0 0 4 0 +root 1 0 CONNECTED_TIME BUSY_TIME CPU_TIME 413 0 0 3 0 0 5 0 5 0 0 0 0 0 2 0 SET GLOBAL thread_statistics= @thread_statistics_old; SELECT Select_commands, Update_commands, Other_commands, Rows_fetched diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e743848933f2..f664e66d462c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -480,6 +480,11 @@ void init_update_queries(void) sql_command_flags[SQLCOM_SHOW_TABLE_STATUS]= (CF_STATUS_COMMAND | CF_SHOW_TABLE_COMMAND | CF_REEXECUTION_FRAGILE); + sql_command_flags[SQLCOM_SHOW_USER_STATS]= CF_STATUS_COMMAND; + sql_command_flags[SQLCOM_SHOW_TABLE_STATS]= CF_STATUS_COMMAND; + sql_command_flags[SQLCOM_SHOW_INDEX_STATS]= CF_STATUS_COMMAND; + sql_command_flags[SQLCOM_SHOW_CLIENT_STATS]= CF_STATUS_COMMAND; + sql_command_flags[SQLCOM_SHOW_THREAD_STATS]= CF_STATUS_COMMAND; sql_command_flags[SQLCOM_CREATE_USER]= CF_CHANGES_DATA; sql_command_flags[SQLCOM_RENAME_USER]= CF_CHANGES_DATA; @@ -3084,6 +3089,11 @@ mysql_execute_command(THD *thd) case SQLCOM_SHOW_COLLATIONS: case SQLCOM_SHOW_STORAGE_ENGINES: case SQLCOM_SHOW_PROFILE: + case SQLCOM_SHOW_USER_STATS: + case SQLCOM_SHOW_TABLE_STATS: + case SQLCOM_SHOW_INDEX_STATS: + case SQLCOM_SHOW_CLIENT_STATS: + case SQLCOM_SHOW_THREAD_STATS: case SQLCOM_SELECT: { thd->status_var.last_query_cost= 0.0; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 720ed735892a..64b52eb75465 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -12860,35 +12860,35 @@ show_param: | CLIENT_STATS_SYM wild_and_where { LEX *lex= Lex; - Lex->sql_command= SQLCOM_SELECT; + Lex->sql_command= SQLCOM_SHOW_CLIENT_STATS; if (prepare_schema_table(YYTHD, lex, 0, SCH_CLIENT_STATS)) MYSQL_YYABORT; } | USER_STATS_SYM wild_and_where { LEX *lex= Lex; - lex->sql_command= SQLCOM_SELECT; + lex->sql_command= SQLCOM_SHOW_USER_STATS; if (prepare_schema_table(YYTHD, lex, 0, SCH_USER_STATS)) MYSQL_YYABORT; } | THREAD_STATS_SYM wild_and_where { LEX *lex= Lex; - Lex->sql_command= SQLCOM_SELECT; + Lex->sql_command= SQLCOM_SHOW_THREAD_STATS; if (prepare_schema_table(YYTHD, lex, 0, SCH_THREAD_STATS)) MYSQL_YYABORT; } | TABLE_STATS_SYM wild_and_where { LEX *lex= Lex; - lex->sql_command= SQLCOM_SELECT; + lex->sql_command= SQLCOM_SHOW_TABLE_STATS; if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_STATS)) MYSQL_YYABORT; } | INDEX_STATS_SYM wild_and_where { LEX *lex= Lex; - lex->sql_command= SQLCOM_SELECT; + lex->sql_command= SQLCOM_SHOW_INDEX_STATS; if (prepare_schema_table(YYTHD, lex, 0, SCH_INDEX_STATS)) MYSQL_YYABORT; } From 2517485511dfa72695e66c1f631e5b54092b0faa Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Thu, 1 Nov 2018 14:58:29 +0200 Subject: [PATCH 077/214] Add new selinux rules for tokudb and fix flush_caches --- build-ps/percona-server.spec | 8 +++++--- policy/selinux/percona-server.te | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/build-ps/percona-server.spec b/build-ps/percona-server.spec index d76e6c3e6ee4..9f2ed425c12d 100644 --- a/build-ps/percona-server.spec +++ b/build-ps/percona-server.spec @@ -345,8 +345,10 @@ Group: Applications/Databases BuildArch: noarch %endif Requires: selinux-policy +Requires: policycoreutils +Requires(pre): policycoreutils Requires(post): policycoreutils -Requires(postun): policycoreutils +Requires(postun): policycoreutils %if 0%{?rhel} == 6 BuildRequires: selinux-policy @@ -585,9 +587,9 @@ install -d $RBR%{_libdir}/mysql/plugin install -d -m 0750 $RBR/var/lib/mysql-files # SElinux -pushd ${MBD}/policy +pushd ${MBD}/policy/selinux make -f /usr/share/selinux/devel/Makefile -install -D -m 0644 $MBD/policy/percona-server.pp $RBR%{_datadir}/selinux/packages/percona-server/percona-server.pp +install -D -m 0644 $MBD/policy/selinux/percona-server.pp $RBR%{_datadir}/selinux/packages/percona-server/percona-server.pp popd # SElinux END diff --git a/policy/selinux/percona-server.te b/policy/selinux/percona-server.te index b45b7feb9842..3ce6fce2d27c 100644 --- a/policy/selinux/percona-server.te +++ b/policy/selinux/percona-server.te @@ -8,12 +8,21 @@ require { type fixed_disk_device_t; type mysqld_t; type tmpfs_t; + type sysctl_vm_t; + type sysfs_t; class sock_file { getattr unlink create }; class capability { sys_nice sys_resource }; class blk_file { read write open }; class file { append write getattr read create unlink open setattr }; class dir { search read write remove_name open add_name }; class process { siginh noatsecure rlimitinh }; + class file getattr; + class file write; + class file open; + class dir { add_name create write }; + class file create; + class file { getattr open read }; + } #============= mysqld_safe_t ============== @@ -26,6 +35,12 @@ allow mysqld_safe_t user_tmp_t:sock_file { getattr unlink }; #!!!! This avc has a dontaudit rule in the current policy allow mysqld_safe_t mysqld_t:process { siginh rlimitinh noatsecure }; +allow mysqld_safe_t sysctl_vm_t:file getattr; +allow mysqld_safe_t sysctl_vm_t:file write; +allow mysqld_safe_t sysctl_vm_t:file open; + +allow mysqld_safe_t sysfs_t:file { getattr open read write }; + #============= mysqld_t ============== allow mysqld_t fixed_disk_device_t:blk_file { read write open }; allow mysqld_t tmp_t:sock_file { create unlink }; @@ -37,3 +52,6 @@ allow mysqld_t user_tmp_t:dir { write add_name }; allow mysqld_t user_tmp_t:file create; allow mysqld_t tmp_t:file { append create read write open getattr unlink setattr }; + +allow mysqld_t user_tmp_t:dir { add_name create write }; +allow mysqld_t user_tmp_t:file create; From b120e227fa314046b3786d3ed65d03d691a19b51 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 12 Oct 2018 11:55:44 +0200 Subject: [PATCH 078/214] Bug#28897799 BACKPORT TO 5.7: WORKAROUND ASAN BUG FOR TIRPC This is a backport of: Bug#28785835 WORKAROUND ASAN BUG FOR TIRPC Sun RPC, and XDR, is being removed from glibc, and into a separate libtirpc library. This is not compatible with libasan. The interceptor functions inserted into the code will segfault. As a workaround, do LD_PRELOAD=/lib64/libtirpc.so For dynamically linked libasan (default for gcc), we must preload that as well. This currently affects fedora, but will likely also affect other linux variants in the future. This patch also enables ASAN suppressions in asan.supp This patch also enables LSAN suppressions in lsan.supp Change-Id: I1bc777482535ce21595a48ae12679c325667d722 (cherry picked from commit aa9698313b6d412265608fe9f1ffc05938448f81) --- mysql-test/asan.supp | 17 +++++++ mysql-test/lib/My/SafeProcess/CMakeLists.txt | 44 ++++++++++++++++++- .../lib/My/SafeProcess/read_ldd_output.cmake | 31 +++++++++++++ mysql-test/lib/My/SafeProcess/safe_process.cc | 15 ++++++- mysql-test/lsan.supp | 19 ++++++++ mysql-test/mysql-test-run.pl | 4 +- 6 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 mysql-test/lib/My/SafeProcess/read_ldd_output.cmake create mode 100644 mysql-test/lsan.supp diff --git a/mysql-test/asan.supp b/mysql-test/asan.supp index 41e85f2f72cb..fee118aaca18 100644 --- a/mysql-test/asan.supp +++ b/mysql-test/asan.supp @@ -1,3 +1,20 @@ +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# ASAN suppressions for gcc/clang + # Warning: this works for clang-3.7 and later odr_violation:*yaSSL* odr_violation:*TaoCrypt* diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 1381d8d4eadd..ef7b43e19f69 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. -# +# Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. @@ -22,6 +22,13 @@ SET(INSTALL_ARGS COMPONENT Test ) +UNSET(HAVE_TIRPC) +# rpcgen.cmake will store RPC_INCLUDE_DIR in the cache +IF(RPC_INCLUDE_DIR STREQUAL "/usr/include/tirpc") + ADD_DEFINITIONS(-DHAVE_TIRPC) + SET(HAVE_TIRPC 1) +ENDIF() + IF (WIN32) MYSQL_ADD_EXECUTABLE(my_safe_process safe_process_win.cc ${INSTALL_ARGS}) MYSQL_ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc ${INSTALL_ARGS}) @@ -29,6 +36,39 @@ ELSE() MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS}) ENDIF() +# Sun RPC, and XDR, is being removed from glibc, and into a separate libtirpc +# library. This is not compatible with libasan. The interceptor functions +# inserted into the code will segfault. +# As a workaround, do LD_PRELOAD=/lib64/libtirpc.so +# For dynamically linked libasan (default for gcc), we must preload that as well +IF(HAVE_ASAN AND HAVE_TIRPC) + TARGET_INCLUDE_DIRECTORIES(my_safe_process + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + + ADD_CUSTOM_COMMAND( + OUTPUT asan_test.c + COMMAND ${CMAKE_COMMAND} -E echo "int main() { return 0; }" > asan_test.c + VERBATIM + ) + SET_SOURCE_FILES_PROPERTIES(asan_test.c PROPERTIES GENERATED TRUE) + + ADD_EXECUTABLE(asan_test asan_test.c) + ADD_CUSTOM_COMMAND( + OUTPUT ldd_asan_test_result + DEPENDS asan_test + COMMAND ldd asan_test > ldd_asan_test_result) + + ADD_CUSTOM_TARGET(extract_asan_library_name + DEPENDS ldd_asan_test_result + COMMAND ${CMAKE_COMMAND} + -DINFILE=${CMAKE_CURRENT_BINARY_DIR}/ldd_asan_test_result + -DOUTFILE=${CMAKE_CURRENT_BINARY_DIR}/asan_library_name.h + -P ${CMAKE_CURRENT_SOURCE_DIR}/read_ldd_output.cmake + ) + + ADD_DEPENDENCIES(my_safe_process extract_asan_library_name) +ENDIF() + INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test ) diff --git a/mysql-test/lib/My/SafeProcess/read_ldd_output.cmake b/mysql-test/lib/My/SafeProcess/read_ldd_output.cmake new file mode 100644 index 000000000000..592244698c75 --- /dev/null +++ b/mysql-test/lib/My/SafeProcess/read_ldd_output.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +FILE(READ ${INFILE} LDD_FILE_CONTENTS) +STRING(REPLACE "\n" ";" LDD_FILE_LINES ${LDD_FILE_CONTENTS}) + +SET(ASAN_LIBRARY_NAME) +FOREACH(LINE ${LDD_FILE_LINES}) + STRING(REGEX MATCH "^[\t ]*(libasan.so.[0-9]) => ([/a-z0-9.]+)" XXX ${LINE}) + IF(CMAKE_MATCH_1) +# MESSAGE(STATUS "LINE ${LINE}") +# MESSAGE(STATUS "XXX ${XXX}") +# MESSAGE(STATUS "CMAKE_MATCH_1 ${CMAKE_MATCH_1}") +# MESSAGE(STATUS "CMAKE_MATCH_2 ${CMAKE_MATCH_2}") + SET(ASAN_LIBRARY_NAME ${CMAKE_MATCH_2}) + ENDIF() +ENDFOREACH() +FILE(WRITE ${OUTFILE} + "const char *asan_library_name=\"${ASAN_LIBRARY_NAME}\";") diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index 52e0a78477e1..b13adab5479f 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,6 +54,9 @@ #include #include #include +#include + +#include "my_config.h" int verbose= 0; volatile sig_atomic_t terminated= 0; @@ -293,6 +296,16 @@ int main(int argc, char* const argv[] ) // Close write end close(pfd[1]); +#if defined(HAVE_ASAN) && defined(HAVE_TIRPC) +#include "asan_library_name.h" + std::string ld_preload = "LD_PRELOAD="; + if (strlen(asan_library_name) > 0) { + ld_preload.append(asan_library_name); + ld_preload.append(":"); + } + ld_preload.append("/lib64/libtirpc.so"); + putenv(strdup(ld_preload.c_str())); +#endif if (execvp(child_argv[0], child_argv) < 0) die("Failed to exec child"); } diff --git a/mysql-test/lsan.supp b/mysql-test/lsan.supp new file mode 100644 index 000000000000..cff513dc59c8 --- /dev/null +++ b/mysql-test/lsan.supp @@ -0,0 +1,19 @@ +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# LSAN suppressions for gcc/clang +leak:Perl_safesyscalloc +leak:Perl_safesysmalloc +leak:Perl_safesysrealloc diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3880e5aac453..a39d80036301 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2854,7 +2854,9 @@ sub environment_setup { $ENV{'VALGRIND_TEST'}= $opt_valgrind; # Make sure LeakSanitizer exits if leaks are found - $ENV{'LSAN_OPTIONS'}= "exitcode=42"; + $ENV{'LSAN_OPTIONS'} = "exitcode=42,suppressions=${glob_mysql_test_dir}/lsan.supp"; + + $ENV{'ASAN_OPTIONS'} = "suppressions=${glob_mysql_test_dir}/asan.supp"; # Add dir of this perl to aid mysqltest in finding perl my $perldir= dirname($^X); From 1e73b835aaa709c031b7e67b364f8181f757ab47 Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Tue, 6 Nov 2018 13:14:17 +0100 Subject: [PATCH 079/214] PS-4881: Add LLVM/clang 7 to Travis-CI 1. Add clang-7 to the list of compilers 2. Cache the commit number of last successful build and use it for pushes to the trunk. It fixes issues when "Auto cancel branch builds" is turned on at https://travis-ci.org/percona/percona-server/settings --- .travis.yml | 69 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index d0da0f487efb..3cef153e8e5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,33 +41,37 @@ matrix: os: osx # 2 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) - env: VERSION=6.0 BUILD=RelWithDebInfo + env: VERSION=7 BUILD=RelWithDebInfo compiler: clang # 3 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) - env: VERSION=5.0 BUILD=Debug + env: VERSION=6.0 BUILD=Debug compiler: clang # 4 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) - env: VERSION=4.0 BUILD=Debug + env: VERSION=5.0 BUILD=Debug compiler: clang # 5 + - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) + env: VERSION=4.0 BUILD=Debug + compiler: clang + # 6 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=8 BUILD=Debug compiler: gcc - # 6 + # 7 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=7 BUILD=Debug compiler: gcc - # 7 + # 8 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=6 BUILD=Debug compiler: gcc - # 8 + # 9 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=5 BUILD=Debug compiler: gcc - # 9 + # 10 - if: repo != percona/percona-server OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=4.8 BUILD=Debug compiler: gcc @@ -81,33 +85,37 @@ matrix: os: osx # 2 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) - env: VERSION=6.0 BUILD=Debug + env: VERSION=7 BUILD=Debug compiler: clang # 3 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) - env: VERSION=5.0 BUILD=RelWithDebInfo + env: VERSION=6.0 BUILD=RelWithDebInfo compiler: clang # 4 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) - env: VERSION=4.0 BUILD=RelWithDebInfo + env: VERSION=5.0 BUILD=RelWithDebInfo compiler: clang # 5 + - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) + env: VERSION=4.0 BUILD=RelWithDebInfo + compiler: clang + # 6 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) env: VERSION=8 BUILD=RelWithDebInfo compiler: gcc - # 6 + # 7 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) env: VERSION=7 BUILD=RelWithDebInfo compiler: gcc - # 7 + # 8 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) env: VERSION=6 BUILD=RelWithDebInfo compiler: gcc - # 8 + # 9 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) env: VERSION=5 BUILD=RelWithDebInfo compiler: gcc - # 9 + # 10 - if: branch =~ fullci OR repo = percona/percona-server AND type IN (push, pull_request, cron) env: VERSION=4.8 BUILD=RelWithDebInfo compiler: gcc @@ -116,33 +124,37 @@ matrix: # Configurations to be run after merging a pull request for percona/percona-server # 1 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) - env: VERSION=6.0 BUILD=RelWithDebInfo INVERTED=ON + env: VERSION=7 BUILD=RelWithDebInfo INVERTED=ON compiler: clang # 2 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) - env: VERSION=5.0 BUILD=RelWithDebInfo INVERTED=ON + env: VERSION=6.0 BUILD=RelWithDebInfo INVERTED=ON compiler: clang # 3 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) - env: VERSION=4.0 BUILD=RelWithDebInfo INVERTED=ON + env: VERSION=5.0 BUILD=RelWithDebInfo INVERTED=ON compiler: clang # 4 + - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) + env: VERSION=4.0 BUILD=RelWithDebInfo INVERTED=ON + compiler: clang + # 5 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=8 BUILD=RelWithDebInfo INVERTED=ON compiler: gcc - # 5 + # 6 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=7 BUILD=RelWithDebInfo INVERTED=ON compiler: gcc - # 6 + # 7 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=6 BUILD=RelWithDebInfo INVERTED=ON compiler: gcc - # 7 + # 8 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=5 BUILD=RelWithDebInfo INVERTED=ON compiler: gcc - #8 + # 9 - if: branch =~ extraci OR repo = percona/percona-server AND type IN (push, cron) env: VERSION=4.8 BUILD=RelWithDebInfo INVERTED=ON compiler: gcc @@ -155,7 +167,7 @@ script: echo --- JOB_NUMBER=$JOB_NUMBER TRAVIS_COMMIT=$TRAVIS_COMMIT TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG TRAVIS_BRANCH=$TRAVIS_BRANCH TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH - echo --- Perform all Travis jobs or only jobs that are included in ENV_VAR_JOB_NUMBERS list if it is defined; - JOB_NUMBERS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27"; + JOB_NUMBERS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"; if [[ "$ENV_VAR_JOB_NUMBERS" != "" ]]; then JOB_NUMBERS=$ENV_VAR_JOB_NUMBERS; fi; @@ -165,13 +177,15 @@ script: travis_terminate 0; fi; - # For the trunk use TRAVIS_COMMIT_RANGE but "Auto cancel branch builds" has to be turned off at https://travis-ci.org/percona/percona-server/settings # For pull requests and feature branches replace TRAVIS_COMMIT_RANGE with the range from the root to the tip of the branch + # For the trunk use the commit number of last successful build if exists - if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]] || [[ "$TRAVIS_REPO_SLUG" != "percona/percona-server" ]]; then if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]]; then TRAVIS_COMMIT=$TRAVIS_COMMIT^2; fi; git fetch https://github.com/percona/percona-server.git $PARENT_BRANCH:master_repo_$PARENT_BRANCH; PARENT_COMMIT=$(git rev-list --first-parent --topo-order $TRAVIS_COMMIT ^master_repo_$PARENT_BRANCH | tail -1); TRAVIS_COMMIT_RANGE=$PARENT_COMMIT^..$TRAVIS_COMMIT; + else + if [ -s "$CCACHE_DIR/last_commit.txt" ]; then TRAVIS_COMMIT_RANGE=$(cat $CCACHE_DIR/last_commit.txt)..$TRAVIS_COMMIT; fi; fi; if MODIFIED_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE 2>/dev/null); then echo -e "--- Modified files in $TRAVIS_COMMIT_RANGE:\n$MODIFIED_FILES"; @@ -269,9 +283,12 @@ script: echo --- CMAKE_OPT=\"$CMAKE_OPT\"; echo --- ENV_VAR_CMAKE_OPT=\"$ENV_VAR_CMAKE_OPT\"; cmake .. $CMAKE_OPT $ENV_VAR_CMAKE_OPT; - CMAKE_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME)); - echo --- CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds. - - make -j2 + + - CMAKE_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME)); + echo --- CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds.; + make -j2; + if [[ "$?" == "0" ]]; then echo $TRAVIS_COMMIT > $CCACHE_DIR/last_commit.txt; fi; + - ccache --show-stats; BUILD_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME - $CMAKE_TIME)); echo --- Total time $SECONDS seconds. Build time $BUILD_TIME seconds. CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds. From 465153d0a4c5f5b2835f7e97d9c8f4a07cedb10e Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 12 Nov 2018 11:27:43 +0530 Subject: [PATCH 080/214] From 1a1e585721c55aaf2cf144bf804534fc466fe32a Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 12 Nov 2018 13:51:42 +0530 Subject: [PATCH 081/214] From 78f25d2809ad457e81f90342239c9bc32a36cdfa Mon Sep 17 00:00:00 2001 From: Venkatesh Venugopal Date: Mon, 12 Nov 2018 16:26:59 +0530 Subject: [PATCH 082/214] Bug#26997096: RELAY_LOG_SPACE IS INACCURATE AND LEAKS Problem ------- The Relay_Log_Space variable shown in SHOW SLAVE STATUS is sometimes much higher than the actual disk space used by relay logs. Analysis -------- This is because we are not writing to Relay_log_info::log_space_total in a synchronized manner. i.e, no lock is being taken by the IO thread while updating the variable. Fix --- The Relay_log_info::log_space_total is now guarded by the Relay_log_info::log_space_lock and this protects concurrent update on Relay_log_info::log_space_total. --- ...rpl_relay_log_space_synchronization.result | 23 +++++++ .../rpl_relay_log_space_synchronization.test | 64 +++++++++++++++++++ sql/binlog.cc | 25 ++++++++ sql/binlog.h | 13 +--- sql/rpl_rli.cc | 11 +++- sql/rpl_slave.cc | 22 +++---- sql/rpl_slave.h | 4 +- sql/sql_reload.cc | 2 +- 8 files changed, 136 insertions(+), 28 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_relay_log_space_synchronization.result create mode 100644 mysql-test/suite/rpl/t/rpl_relay_log_space_synchronization.test diff --git a/mysql-test/suite/rpl/r/rpl_relay_log_space_synchronization.result b/mysql-test/suite/rpl/r/rpl_relay_log_space_synchronization.result new file mode 100644 index 000000000000..925e6b6731fe --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_relay_log_space_synchronization.result @@ -0,0 +1,23 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +CREATE TABLE t1 (i INT); +include/sync_slave_sql_with_master.inc +include/stop_slave_sql.inc +SET GLOBAL debug='+d,wait_in_purge_index_entry'; +FLUSH LOCAL RELAY LOGS; +START SLAVE SQL_THREAD; +SET DEBUG_SYNC="now WAIT_FOR in_purge_index_entry"; +[connection master] +INSERT INTO t1 VALUES (1); +[connection slave] +include/assert.inc [IO Thread is waiting for Relay_log_info::log_space_lock.] +SET DEBUG_SYNC="now SIGNAL go_ahead_sql"; +[connection master] +DROP TABLE t1; +include/sync_slave_sql_with_master.inc +SET GLOBAL debug='-d,wait_in_purge_index_entry'; +SET DEBUG_SYNC="RESET"; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_relay_log_space_synchronization.test b/mysql-test/suite/rpl/t/rpl_relay_log_space_synchronization.test new file mode 100644 index 000000000000..04d40445ef13 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_relay_log_space_synchronization.test @@ -0,0 +1,64 @@ +# === Purpose === +# +# This test verifies that SQL and IO threads update the +# rli->relay_log_space_total variable in a synchronized manner. +# +# === Implementation === +# +# 1. On Slave, make the SQL thread to purge relay logs and halt +# the SQL thread in MYSQL_BIN_LOG::purge_index_entry function +# using debug sync utility. +# 2. Do a DML on master so that IO thread calls queue_event and +# updates rli->relay_log_space_total. +# 3. Verify that IO thread is waiting rli->log_space_lock until it is released +# by SQL thread. +# +# === References === +# +# Bug#26997096 RELAY_LOG_SPACE IS INACCURATE AND LEAKS + +# This test case is binlog_format agnostic +--source include/have_binlog_format_row.inc +# This test case uses debug_sync +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/master-slave.inc + +CREATE TABLE t1 (i INT); + +--source include/sync_slave_sql_with_master.inc +--source include/stop_slave_sql.inc +SET GLOBAL debug='+d,wait_in_purge_index_entry'; + +# Create a new relay log so the START SLAVE SQL_THREAD tries +# to purge the old relay logs and hits the debug point. +FLUSH LOCAL RELAY LOGS; +START SLAVE SQL_THREAD; +SET DEBUG_SYNC="now WAIT_FOR in_purge_index_entry"; + +# Do a DML on master so that IO thread calls queue_event and +# updates rli->relay_log_space_total. +--source include/rpl_connection_master.inc +INSERT INTO t1 VALUES (1); +--source include/rpl_connection_slave.inc + +# Wait until IO thread tries to take a log_space_lock. +--let $io_thread_id = `SELECT THREAD_ID FROM performance_schema.threads WHERE NAME like '%slave_io%'` +--let $wait_condition= SELECT EVENT_NAME= 'wait/synch/mutex/sql/Relay_log_info::log_space_lock' FROM performance_schema.events_waits_current WHERE THREAD_ID=$io_thread_id +--source include/wait_condition.inc + +# Since SQL thread has taken the rli->log_space_lock, IO thread should wait until +# the lock is released. Assert that IO thread is waiting for rli->log_space_lock. +--let $assert_text= IO Thread is waiting for Relay_log_info::log_space_lock. +--let $assert_cond= "[SELECT EVENT_NAME FROM performance_schema.events_waits_current WHERE THREAD_ID=$io_thread_id]" = "wait/synch/mutex/sql/Relay_log_info::log_space_lock" +--source include/assert.inc + +SET DEBUG_SYNC="now SIGNAL go_ahead_sql"; + +# Cleanup +--source include/rpl_connection_master.inc +DROP TABLE t1; +--source include/sync_slave_sql_with_master.inc +SET GLOBAL debug='-d,wait_in_purge_index_entry'; +SET DEBUG_SYNC="RESET"; +--source include/rpl_end.inc diff --git a/sql/binlog.cc b/sql/binlog.cc index 05519df7196c..73fb6a1f4d5d 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -4843,6 +4843,13 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space, DBUG_PRINT("info",("purging %s",log_info.log_file_name)); if (!mysql_file_delete(key_file_binlog, log_info.log_file_name, MYF(0))) { + DBUG_EXECUTE_IF("wait_in_purge_index_entry", + { + const char action[] = "now SIGNAL in_purge_index_entry WAIT_FOR go_ahead_sql"; + DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(action))); + DBUG_SET("-d,wait_in_purge_index_entry"); + };); + if (decrease_log_space) *decrease_log_space-= s.st_size; } @@ -6412,6 +6419,24 @@ void MYSQL_BIN_LOG::close(uint exiting, bool need_lock_log, DBUG_VOID_RETURN; } +void MYSQL_BIN_LOG::harvest_bytes_written(Relay_log_info* rli, bool need_log_space_lock) +{ +#ifndef DBUG_OFF + char buf1[22],buf2[22]; +#endif + DBUG_ENTER("harvest_bytes_written"); + if (need_log_space_lock) + mysql_mutex_lock(&rli->log_space_lock); + else + mysql_mutex_assert_owner(&rli->log_space_lock); + rli->log_space_total+= bytes_written; + DBUG_PRINT("info",("relay_log_space: %s bytes_written: %s", + llstr(rli->log_space_total,buf1), llstr(bytes_written,buf2))); + bytes_written=0; + if (need_log_space_lock) + mysql_mutex_unlock(&rli->log_space_lock); + DBUG_VOID_RETURN; +} void MYSQL_BIN_LOG::set_max_size(ulong max_size_arg) { diff --git a/sql/binlog.h b/sql/binlog.h index 5e50659a75ab..4f3ef06eabba 100644 --- a/sql/binlog.h +++ b/sql/binlog.h @@ -543,18 +543,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG { bytes_written = 0; } - void harvest_bytes_written(ulonglong* counter) - { -#ifndef DBUG_OFF - char buf1[22],buf2[22]; -#endif - DBUG_ENTER("harvest_bytes_written"); - (*counter)+=bytes_written; - DBUG_PRINT("info",("counter: %s bytes_written: %s", llstr(*counter,buf1), - llstr(bytes_written,buf2))); - bytes_written=0; - DBUG_VOID_RETURN; - } + void harvest_bytes_written(Relay_log_info *rli, bool need_log_space_lock); void set_max_size(ulong max_size_arg); void signal_update(); int wait_for_update_relay_log(THD* thd, const struct timespec * timeout); diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index f2e4dc246e2a..7b57d3243e70 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -344,6 +344,7 @@ static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo) { MY_STAT s; DBUG_ENTER("add_relay_log"); + mysql_mutex_assert_owner(&rli->log_space_lock); if (!mysql_file_stat(key_file_relaylog, linfo->log_file_name, &s, MYF(0))) { @@ -363,16 +364,21 @@ int Relay_log_info::count_relay_log_space() { LOG_INFO flinfo; DBUG_ENTER("Relay_log_info::count_relay_log_space"); + mysql_mutex_lock(&log_space_lock); log_space_total= 0; if (relay_log.find_log_pos(&flinfo, NullS, 1)) { sql_print_error("Could not find first log while counting relay log space."); + mysql_mutex_unlock(&log_space_lock); DBUG_RETURN(1); } do { if (add_relay_log(this, &flinfo)) + { + mysql_mutex_unlock(&log_space_lock); DBUG_RETURN(1); + } } while (!relay_log.find_next_log(&flinfo, 1)); /* As we have counted everything, including what may have written in a @@ -380,6 +386,7 @@ int Relay_log_info::count_relay_log_space() twice. */ relay_log.reset_bytes_written(); + mysql_mutex_unlock(&log_space_lock); DBUG_RETURN(0); } @@ -1995,7 +2002,7 @@ void Relay_log_info::end_info() relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT, true/*need_lock_log=true*/, true/*need_lock_index=true*/); - relay_log.harvest_bytes_written(&log_space_total); + relay_log.harvest_bytes_written(this, true/*need_log_space_lock=true*/); /* Delete the slave's temporary tables from memory. In the future there will be other actions than this, to ensure persistance diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc index 7f21f4c6c9ee..6cd2906de85b 100644 --- a/sql/rpl_slave.cc +++ b/sql/rpl_slave.cc @@ -2807,7 +2807,7 @@ static bool wait_for_relay_log_space(Relay_log_info* rli) if (rli->sql_force_rotate_relay) { mysql_mutex_lock(&mi->data_lock); - rotate_relay_log(mi); + rotate_relay_log(mi, false/*need_log_space_lock=false*/); mysql_mutex_unlock(&mi->data_lock); rli->sql_force_rotate_relay= false; } @@ -2861,7 +2861,7 @@ static int write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi) "failed to write a Rotate event" " to the relay log, SHOW SLAVE STATUS may be" " inaccurate"); - rli->relay_log.harvest_bytes_written(&rli->log_space_total); + rli->relay_log.harvest_bytes_written(rli, true/*need_log_space_lock=true*/); if (flush_master_info(mi, TRUE)) { error= 1; @@ -6560,7 +6560,7 @@ static int process_io_create_file(Master_info* mi, Create_file_log_event* cev) "error writing Exec_load event to relay log"); goto err; } - mi->rli->relay_log.harvest_bytes_written(&mi->rli->log_space_total); + mi->rli->relay_log.harvest_bytes_written(mi->rli, true/*need_log_space_lock=true*/); break; } if (unlikely(cev_not_written)) @@ -6575,7 +6575,7 @@ static int process_io_create_file(Master_info* mi, Create_file_log_event* cev) goto err; } cev_not_written=0; - mi->rli->relay_log.harvest_bytes_written(&mi->rli->log_space_total); + mi->rli->relay_log.harvest_bytes_written(mi->rli, true/*need_log_space_lock=true*/); } else { @@ -6589,7 +6589,7 @@ static int process_io_create_file(Master_info* mi, Create_file_log_event* cev) "error writing Append_block event to relay log"); goto err; } - mi->rli->relay_log.harvest_bytes_written(&mi->rli->log_space_total); + mi->rli->relay_log.harvest_bytes_written(mi->rli, true/*need_log_space_lock=true*/); } } } @@ -6659,7 +6659,7 @@ static int process_io_rotate(Master_info *mi, Rotate_log_event *rev) Rotate the relay log makes binlog format detection easier (at next slave start or mysqlbinlog) */ - int ret= rotate_relay_log(mi); + int ret= rotate_relay_log(mi, true/*need_log_space_lock=true*/); DBUG_RETURN(ret); } @@ -6773,7 +6773,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, delete ev; DBUG_RETURN(1); } - rli->relay_log.harvest_bytes_written(&rli->log_space_total); + rli->relay_log.harvest_bytes_written(rli, true/*need_log_space_lock=true*/); } delete ev; mi->set_master_log_pos(mi->get_master_log_pos() + inc_pos); @@ -6831,7 +6831,7 @@ static int queue_binlog_ver_3_event(Master_info *mi, const char *buf, delete ev; DBUG_RETURN(1); } - rli->relay_log.harvest_bytes_written(&rli->log_space_total); + rli->relay_log.harvest_bytes_written(rli, true/*need_log_space_lock=true*/); delete ev; mi->set_master_log_pos(mi->get_master_log_pos() + inc_pos); err: @@ -7365,7 +7365,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) { mi->set_master_log_pos(mi->get_master_log_pos() + inc_pos); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->get_master_log_pos())); - rli->relay_log.harvest_bytes_written(&rli->log_space_total); + rli->relay_log.harvest_bytes_written(rli, true/*need_log_space_lock=true*/); } else { @@ -8248,7 +8248,7 @@ event(errno: %d cur_log->error: %d)", is void). */ -int rotate_relay_log(Master_info* mi) +int rotate_relay_log(Master_info* mi, bool need_log_space_lock) { DBUG_ENTER("rotate_relay_log"); @@ -8286,7 +8286,7 @@ int rotate_relay_log(Master_info* mi) If the log is closed, then this will just harvest the last writes, probably 0 as they probably have been harvested. */ - rli->relay_log.harvest_bytes_written(&rli->log_space_total); + rli->relay_log.harvest_bytes_written(rli, need_log_space_lock); end: DBUG_RETURN(error); } diff --git a/sql/rpl_slave.h b/sql/rpl_slave.h index 1ebdfc2b1a92..069c33c8ec5a 100644 --- a/sql/rpl_slave.h +++ b/sql/rpl_slave.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -326,7 +326,7 @@ void init_thread_mask(int* mask,Master_info* mi,bool inverse); void set_slave_thread_options(THD* thd); void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli); int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli); -int rotate_relay_log(Master_info* mi); +int rotate_relay_log(Master_info* mi, bool need_log_space_lock); pthread_handler_t handle_slave_io(void *arg); pthread_handler_t handle_slave_sql(void *arg); diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 56f0de1d6bf9..78d93647f02a 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -177,7 +177,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, if (active_mi != NULL) { mysql_mutex_lock(&active_mi->data_lock); - if (rotate_relay_log(active_mi)) + if (rotate_relay_log(active_mi, true/*need_log_space_lock=true*/)) *write_to_binlog= -1; mysql_mutex_unlock(&active_mi->data_lock); } From 4106159525a4ef6d831dda088a72b9f37c32bafa Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Tue, 13 Nov 2018 11:59:55 +0100 Subject: [PATCH 083/214] Bug#28900691 BACKPORT BUG#28443958 TO MYSQL-5.7 When certification information was too big to transmit an event was generated that caused failures in all group members. To avoid this, we no longer send this information if its size is too big. We instead encode an error that will make the joiner leave the group. --- include/mysql/group_replication_priv.h | 7 + .../group_replication/include/certifier.h | 12 +- .../plugin/group_replication/src/certifier.cc | 14 ++ .../src/handlers/certification_handler.cc | 18 ++- ...slave_max_allowed_packet_dependency.result | 70 +++------- ...gr_slave_max_allowed_packet_dependency.cnf | 11 -- ...r_slave_max_allowed_packet_dependency.test | 132 +++++++----------- sql/log_event.cc | 10 +- sql/log_event.h | 14 +- sql/rpl_group_replication.cc | 4 + 10 files changed, 141 insertions(+), 151 deletions(-) delete mode 100644 rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.cnf diff --git a/include/mysql/group_replication_priv.h b/include/mysql/group_replication_priv.h index 384efe92e31e..028d6685e469 100644 --- a/include/mysql/group_replication_priv.h +++ b/include/mysql/group_replication_priv.h @@ -188,5 +188,12 @@ void global_thd_manager_remove_thd(THD *thd); */ const char* get_write_set_algorithm_string(unsigned int algorithm); +/** + Returns the value of slave_max_allowed_packet. + + @return slave_max_allowed_packet +*/ +unsigned long get_slave_max_allowed_packet(); + #endif /* GROUP_REPLICATION_PRIV_INCLUDE */ diff --git a/rapid/plugin/group_replication/include/certifier.h b/rapid/plugin/group_replication/include/certifier.h index 9191a7384d6a..789fba8e67ea 100644 --- a/rapid/plugin/group_replication/include/certifier.h +++ b/rapid/plugin/group_replication/include/certifier.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -197,6 +197,12 @@ class Certifier: public Certifier_interface Certifier(); virtual ~Certifier(); + /** + Key used to store errors in the certification info + on View_change_log_event. + */ + static const std::string CERTIFICATION_INFO_ERROR_NAME; + /** Initialize certifier. @@ -296,9 +302,9 @@ class Certifier: public Certifier_interface @note if concurrent access is introduce to these variables, locking is needed in this method - @param cert_info certification info retrieved from recovery procedure + @param[in] cert_info certification info retrieved from recovery procedure - @retval > 0 Error during setting certfication info. + @retval > 0 Error during setting certification info. @retval = 0 Everything went fine. */ virtual int set_certification_info(std::map *cert_info); diff --git a/rapid/plugin/group_replication/src/certifier.cc b/rapid/plugin/group_replication/src/certifier.cc index c3ac7d7fc62c..95cc715caa00 100644 --- a/rapid/plugin/group_replication/src/certifier.cc +++ b/rapid/plugin/group_replication/src/certifier.cc @@ -24,6 +24,8 @@ #include "sql_service_command.h" const std::string Certifier::GTID_EXTRACTED_NAME= "gtid_extracted"; +const std::string Certifier::CERTIFICATION_INFO_ERROR_NAME = + "certification_info_error"; static void *launch_broadcast_thread(void* arg) { @@ -1548,6 +1550,18 @@ int Certifier::set_certification_info(std::map *cert_i { DBUG_ENTER("Certifier::set_certification_info"); DBUG_ASSERT(cert_info != NULL); + + if (cert_info->size() == 1) { + std::map::iterator it = + cert_info->find(CERTIFICATION_INFO_ERROR_NAME); + if (it != cert_info->end()) { + log_message(MY_ERROR_LEVEL, + "The certification information could not be set in this server: '%s'", + it->second.c_str()); + DBUG_RETURN(1); + } + } + mysql_mutex_lock(&LOCK_certification_info); clear_certification_info(); diff --git a/rapid/plugin/group_replication/src/handlers/certification_handler.cc b/rapid/plugin/group_replication/src/handlers/certification_handler.cc index 3a5d389dd283..0dede254f551 100644 --- a/rapid/plugin/group_replication/src/handlers/certification_handler.cc +++ b/rapid/plugin/group_replication/src/handlers/certification_handler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -503,7 +503,21 @@ Certification_handler::extract_certification_info(Pipeline_event *pevent, std::map cert_info; cert_module->get_certification_info(&cert_info); - vchange_event->set_certification_info(&cert_info); + size_t event_size = 0; + vchange_event->set_certification_info(&cert_info, &event_size); + + /* + If certification information is too big this event can't be transmitted + as it would cause failures on all group members. + To avoid this, we now instead encode an error that will make the joiner + leave the group. + */ + if (event_size > get_slave_max_allowed_packet()) { + cert_info.clear(); + cert_info[Certifier::CERTIFICATION_INFO_ERROR_NAME] = + "Certification information is too large for transmission."; + vchange_event->set_certification_info(&cert_info, &event_size); + } //Assure the last known local transaction was already executed error= wait_for_local_transaction_execution(); diff --git a/rapid/plugin/group_replication/tests/mtr/r/gr_slave_max_allowed_packet_dependency.result b/rapid/plugin/group_replication/tests/mtr/r/gr_slave_max_allowed_packet_dependency.result index c1f1be7a51d9..f3f6f5100634 100644 --- a/rapid/plugin/group_replication/tests/mtr/r/gr_slave_max_allowed_packet_dependency.result +++ b/rapid/plugin/group_replication/tests/mtr/r/gr_slave_max_allowed_packet_dependency.result @@ -1,81 +1,55 @@ -include/group_replication.inc [rpl_server_count=3] +include/group_replication.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection server1] -# 1. Start three server(disable certification database garbage collection). - -# 1A. Bootstrap server1. +# 1. Bootstrap server1 (disable certification database garbage collection). +# Set slave_max_allowed_packet to lowest value [connection server1] include/start_and_bootstrap_group_replication.inc SET @debug_save1= @@GLOBAL.DEBUG; SET @@GLOBAL.DEBUG= 'd,group_replication_do_not_clear_certification_database'; -# 1B. Set slave_max_allowed_packet to lowest value and start server2. -[connection server2] SET @debug_save_slave_max_allowed_packet= @@GLOBAL.slave_max_allowed_packet; SET GLOBAL slave_max_allowed_packet=1024; -include/start_group_replication.inc -SET @debug_save2= @@GLOBAL.DEBUG; -SET @@GLOBAL.DEBUG= 'd,group_replication_do_not_clear_certification_database'; -set session sql_log_bin=0; -call mtr.add_suppression("Unable to convert the event into a packet on the applier.*"); -call mtr.add_suppression("Failed to fetch transaction data containing required transaction info for applier"); -call mtr.add_suppression("Error at event handling.*"); -call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group."); -call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); -call mtr.add_suppression("Slave SQL for channel 'group_replication_applier'.*"); -call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); -set session sql_log_bin=1; -# 1C. Setup environment on server3, do not start GR yet. -[connection server3] -SET @debug_save3= @@GLOBAL.DEBUG; -SET @@GLOBAL.DEBUG= 'd,group_replication_do_not_clear_certification_database'; # 2. Generate 200 transactions on server1 to increase # certification database size. - [connection server1] CREATE TABLE t1 (a INT PRIMARY KEY); -# 3. Start GR on server3, View_change packet will be high in size. - -[connection server3] -include/start_group_replication.inc - -# 4. Server2 can only handle small packet sizes, so it will go in error state. +# 3. Start GR on server2, view_change packet will be high in size. +# Without certification information, server 2 can't join and moves to ERROR state [connection server2] -include/gr_wait_for_member_state.inc -include/assert_grep.inc [Found the expected error about log event entry exceeded slave_max_allowed_packet.] - -# 5. Server1 can handle 1GB packet size(default) so it will become donor and -# assist server3 to come ONLINE. +include/start_group_replication.inc +include/assert_grep.inc [Found the expected error about the view change log even being over size] +# 4. Set a bigger value of slave_max_allowed_packet on server1 +# Restart server2 and see it come ONLINE. [connection server1] -include/rpl_gr_wait_for_number_of_members.inc - -# 6. Restart GR on server2 with large value of slave_max_allowed_packet -# to make it ONLINE. - +SET @@GLOBAL.slave_max_allowed_packet=@debug_save_slave_max_allowed_packet; [connection server2] include/stop_group_replication.inc -SET @@GLOBAL.slave_max_allowed_packet=@debug_save_slave_max_allowed_packet; include/start_group_replication.inc [connection server1] include/rpl_gr_wait_for_number_of_members.inc -# 7. Verification. - -include/diff_tables.inc [server1:t1, server2:t1, server3:t1] - -# 8. Cleanup. +# 5. Verification. +include/diff_tables.inc [server1:t1, server2:t1] +# 6. Cleanup. DROP TABLE t1; [connection server1] SET @@GLOBAL.DEBUG= @debug_save1; [connection server2] -SET @@GLOBAL.DEBUG= @debug_save2; -[connection server3] -SET @@GLOBAL.DEBUG= @debug_save3; +SET session sql_log_bin=0; +call mtr.add_suppression("The certification information could not be set in this server: 'Certification information is too large for transmission.'"); +call mtr.add_suppression("Error when processing certification information in the recovery process"); +call mtr.add_suppression("Fatal error during the recovery process of Group Replication. The server will leave the group."); +call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); +call mtr.add_suppression("All donors left. Aborting group replication recovery."); +call mtr.add_suppression("Skipping leave operation: member already left the group."); +call mtr.add_suppression("On shutdown there was a timeout receiving a view change. This can lead to a possible inconsistent state. Check the log for more details"); +SET session sql_log_bin=1; include/group_replication_end.inc diff --git a/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.cnf b/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.cnf deleted file mode 100644 index 30847abcd9cc..000000000000 --- a/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.cnf +++ /dev/null @@ -1,11 +0,0 @@ -!include ../my.cnf - -[mysqld.1] - -[mysqld.2] - -[mysqld.3] - -[ENV] -SERVER_MYPORT_3= @mysqld.3.port -SERVER_MYSOCK_3= @mysqld.3.socket diff --git a/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.test b/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.test index f21d67ac3c97..75155e6d9c71 100644 --- a/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.test +++ b/rapid/plugin/group_replication/tests/mtr/t/gr_slave_max_allowed_packet_dependency.test @@ -1,82 +1,58 @@ ################################################################################ -# This test checks that group replication applier thread is dependant upon -# slave_max_allowed_packet and allows processing of larger View_change packets. +# This test checks that group replication applier thread is dependent upon +# slave_max_allowed_packet to allow the processing of larger View_change packets. +# If the certification database is too big to transmit, all donors will encode +# an error instead that will make the joiner fail. +# +# References: +# BUG#26770576: ALL MEMBERS ARE EXITED FROM GR WHEN 1/3 NODE TRIED TO REJOIN AFTER SHUTDOWN +# BUG#28443958: ALL MEMBERS ARE EXITED FROM GR WHEN 1/4 NODE TRIED TO REJOIN AFTER NETWORK DROP # # Test: -# 0. The test requires three servers. -# 1. Start three server(disable certification database garbage collection). -# 1A. Bootstrap server1. -# 1B. Set slave_max_allowed_packet to lowest value and start server2. -# 1C. Setup environment on server3, do not start GR yet. +# 0. The test requires two server in multi primary mode +# 1. Bootstrap server1 (disable certification database garbage collection). +# Set slave_max_allowed_packet to lowest value # 2. Generate 200 transactions on server1 to increase # certification database size. -# 3. Start GR on server3, View_change packet will be high in size. -# 4. Server2 can only handle small packet sizes, so it will go in error state. -# 5. Server1 can handle 1GB packet size(default) so it will become donor and -# assist server3 to come ONLINE. -# 6. Restart GR on server2 with large value of slave_max_allowed_packet -# to make it ONLINE. -# 7. Verification. -# 8. Cleanup. +# 3. Start GR on server2, view_change packet will be high in size. +# Without certification information, server 2 can't join and moves to ERROR state +# 4. Set a bigger value of slave_max_allowed_packet on server1 +# Restart server2 and see it come ONLINE. +# 5. Verification. +# 6. Cleanup. ################################################################################ --source include/big_test.inc --source include/have_debug.inc --source ../inc/have_group_replication_plugin.inc ---let $rpl_server_count= 3 --let $rpl_skip_group_replication_start= 1 --source ../inc/group_replication.inc --echo ---echo # 1. Start three server(disable certification database garbage collection). ---echo +--echo # 1. Bootstrap server1 (disable certification database garbage collection). +--echo # Set slave_max_allowed_packet to lowest value ---echo # 1A. Bootstrap server1. --let $rpl_connection_name= server1 --source include/rpl_connection.inc --source ../inc/start_and_bootstrap_group_replication.inc SET @debug_save1= @@GLOBAL.DEBUG; SET @@GLOBAL.DEBUG= 'd,group_replication_do_not_clear_certification_database'; ---echo # 1B. Set slave_max_allowed_packet to lowest value and start server2. ---let $rpl_connection_name= server2 ---source include/rpl_connection.inc SET @debug_save_slave_max_allowed_packet= @@GLOBAL.slave_max_allowed_packet; SET GLOBAL slave_max_allowed_packet=1024; ---source include/start_group_replication.inc -SET @debug_save2= @@GLOBAL.DEBUG; -SET @@GLOBAL.DEBUG= 'd,group_replication_do_not_clear_certification_database'; - -set session sql_log_bin=0; -call mtr.add_suppression("Unable to convert the event into a packet on the applier.*"); -call mtr.add_suppression("Failed to fetch transaction data containing required transaction info for applier"); -call mtr.add_suppression("Error at event handling.*"); -call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group."); -call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); -call mtr.add_suppression("Slave SQL for channel 'group_replication_applier'.*"); -call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); -set session sql_log_bin=1; - ---echo # 1C. Setup environment on server3, do not start GR yet. ---let $rpl_connection_name= server3 ---source include/rpl_connection.inc -SET @debug_save3= @@GLOBAL.DEBUG; -SET @@GLOBAL.DEBUG= 'd,group_replication_do_not_clear_certification_database'; --echo --echo # 2. Generate 200 transactions on server1 to increase --echo # certification database size. ---echo ## We have disabled cleaning of certification database. -## We have limited Member 2, packet size to 1 KB slave_max_allowed_packet. -## Member2 will go in ERROR state if any packet is bigger then -## MAX (slave_max_allowed_packet,binlog-row-event-max-size + -## MAX_LOG_EVENT_HEADER i.e. 12251 as of now) -## Member1 uses default value which is 1GB as of now. so it will process -## View_change packet successfully. +## We have limited packet size to 1 KB slave_max_allowed_packet. +## The certification will not be encoded and member2 will +## go to ERROR state if the view change log event to be generated is bigger then +## slave_max_allowed_packet ## As of now size of certification database is growing to approx 13339 ## which includes (12+48)*200 and other View_change information. + --let $rpl_connection_name= server1 --source include/rpl_connection.inc CREATE TABLE t1 (a INT PRIMARY KEY); @@ -90,63 +66,54 @@ WHILE($rows) --enable_query_log --echo ---echo # 3. Start GR on server3, View_change packet will be high in size. ---echo ---let $rpl_connection_name= server3 ---source include/rpl_connection.inc ---source include/start_group_replication.inc +--echo # 3. Start GR on server2, view_change packet will be high in size. +--echo # Without certification information, server 2 can't join and moves to ERROR state ---echo ---echo # 4. Server2 can only handle small packet sizes, so it will go in error state. --echo --let $rpl_connection_name= server2 --source include/rpl_connection.inc ---let $group_replication_member_state= ERROR ---source ../inc/gr_wait_for_member_state.inc + +--let $group_replication_start_member_state= ERROR +--source include/start_group_replication.inc + +# Safety sleep against delays on writing +--sleep 1 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err --let $assert_only_after = CURRENT_TEST: group_replication.gr_slave_max_allowed_packet_dependency --let $assert_count = 1 ---let $assert_select = log event entry exceeded slave_max_allowed_packet; Increase slave_max_allowed_packet ---let $assert_text = Found the expected error about log event entry exceeded slave_max_allowed_packet. +--let $assert_select = The certification information could not be set in this server: 'Certification information is too large for transmission.' +--let $assert_text = Found the expected error about the view change log even being over size --source include/assert_grep.inc --echo ---echo # 5. Server1 can handle 1GB packet size(default) so it will become donor and ---echo # assist server3 to come ONLINE. ---echo +--echo # 4. Set a bigger value of slave_max_allowed_packet on server1 +--echo # Restart server2 and see it come ONLINE. --let $rpl_connection_name= server1 --source include/rpl_connection.inc ---let $group_replication_number_of_members= 2 ---source ../inc/gr_wait_for_number_of_members.inc ---echo ---echo # 6. Restart GR on server2 with large value of slave_max_allowed_packet ---echo # to make it ONLINE. ---echo +SET @@GLOBAL.slave_max_allowed_packet=@debug_save_slave_max_allowed_packet; + --let $rpl_connection_name= server2 --source include/rpl_connection.inc ---source include/stop_group_replication.inc -SET @@GLOBAL.slave_max_allowed_packet=@debug_save_slave_max_allowed_packet; +--source include/stop_group_replication.inc --let $wait_timeout=150 --source include/start_group_replication.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc ---let $group_replication_number_of_members= 3 +--let $group_replication_number_of_members= 2 --source ../inc/gr_wait_for_number_of_members.inc --echo ---echo # 7. Verification. ---echo +--echo # 5. Verification. ---let $diff_tables=server1:t1, server2:t1, server3:t1 +--let $diff_tables=server1:t1, server2:t1 --source include/diff_tables.inc --echo ---echo # 8. Cleanup. ---echo +--echo # 6. Cleanup. DROP TABLE t1; @@ -156,10 +123,15 @@ SET @@GLOBAL.DEBUG= @debug_save1; --let $rpl_connection_name= server2 --source include/rpl_connection.inc -SET @@GLOBAL.DEBUG= @debug_save2; ---let $rpl_connection_name= server3 ---source include/rpl_connection.inc -SET @@GLOBAL.DEBUG= @debug_save3; +SET session sql_log_bin=0; +call mtr.add_suppression("The certification information could not be set in this server: 'Certification information is too large for transmission.'"); +call mtr.add_suppression("Error when processing certification information in the recovery process"); +call mtr.add_suppression("Fatal error during the recovery process of Group Replication. The server will leave the group."); +call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); +call mtr.add_suppression("All donors left. Aborting group replication recovery."); +call mtr.add_suppression("Skipping leave operation: member already left the group."); +call mtr.add_suppression("On shutdown there was a timeout receiving a view change. This can lead to a possible inconsistent state. Check the log for more details"); +SET session sql_log_bin=1; --source ../inc/group_replication_end.inc diff --git a/sql/log_event.cc b/sql/log_event.cc index 62ddd235a754..863e41591c8b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -14301,19 +14301,23 @@ bool View_change_log_event::write_data_map(IO_CACHE* file, /* Updates the certification info map. */ -void -View_change_log_event::set_certification_info(std::map *info) -{ +void View_change_log_event::set_certification_info( + std::map *info, size_t *event_size) { DBUG_ENTER("View_change_log_event::set_certification_database_snapshot"); certification_info.clear(); + *event_size = Binary_log_event::VIEW_CHANGE_HEADER_LEN; std::map::iterator it; for(it= info->begin(); it != info->end(); ++it) { std::string key= it->first; std::string value= it->second; certification_info[key]= value; + *event_size += it->first.length() + it->second.length(); } + *event_size += + (ENCODED_CERT_INFO_KEY_SIZE_LEN + ENCODED_CERT_INFO_VALUE_LEN) * + certification_info.size(); DBUG_VOID_RETURN; } diff --git a/sql/log_event.h b/sql/log_event.h index 27c9a4ed2bd1..00a56118f6b2 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -4440,11 +4440,17 @@ class View_change_log_event: public binary_log::View_change_event, char* get_view_id() { return view_id; } /** - Sets the certification info + Sets the certification info in the event - @param db the database - */ - void set_certification_info(std::map *info); + @note size is calculated on this method as the size of the data + might render the log even invalid. Also due to its size doing it + here avoid looping over the data multiple times. + + @param[in] info certification info to be written + @param[out] event_size the event size after this operation + */ + void set_certification_info(std::map *info, + size_t *event_size); /** Returns the certification info diff --git a/sql/rpl_group_replication.cc b/sql/rpl_group_replication.cc index 0f11ffaf348c..b6b51237dc97 100644 --- a/sql/rpl_group_replication.cc +++ b/sql/rpl_group_replication.cc @@ -402,3 +402,7 @@ void global_thd_manager_remove_thd(THD *thd) { Global_THD_manager::get_instance()->remove_thd(thd); } + +unsigned long get_slave_max_allowed_packet() { + return slave_max_allowed_packet; +} From ef7ecb91f1d55cbc9a2e6a4a481544c1b182bc98 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Thu, 1 Nov 2018 10:33:22 +0100 Subject: [PATCH 084/214] PS-4989: Fixing innodb_track_changed_pages debug validation In debug builds, this setting is allowed to be turned off temporarily after it was turned on during startup. Howewer memory garbage also caused it to be accidentally turned on when it was disabled at startup. --- ...> percona_changed_page_bmp_debug_tracking_off.result} | 6 ++++++ ...rcona_changed_page_bmp_debug_tracking_off-master.opt} | 0 ... => percona_changed_page_bmp_debug_tracking_off.test} | 9 +++++++++ storage/innobase/handler/ha_innodb.cc | 4 +++- 4 files changed, 18 insertions(+), 1 deletion(-) rename mysql-test/suite/innodb/r/{percona_changed_page_bmp_1368530.result => percona_changed_page_bmp_debug_tracking_off.result} (67%) rename mysql-test/suite/innodb/t/{percona_changed_page_bmp_1368530-master.opt => percona_changed_page_bmp_debug_tracking_off-master.opt} (100%) rename mysql-test/suite/innodb/t/{percona_changed_page_bmp_1368530.test => percona_changed_page_bmp_debug_tracking_off.test} (71%) diff --git a/mysql-test/suite/innodb/r/percona_changed_page_bmp_1368530.result b/mysql-test/suite/innodb/r/percona_changed_page_bmp_debug_tracking_off.result similarity index 67% rename from mysql-test/suite/innodb/r/percona_changed_page_bmp_1368530.result rename to mysql-test/suite/innodb/r/percona_changed_page_bmp_debug_tracking_off.result index 775d51e7b747..283401effe2f 100644 --- a/mysql-test/suite/innodb/r/percona_changed_page_bmp_1368530.result +++ b/mysql-test/suite/innodb/r/percona_changed_page_bmp_debug_tracking_off.result @@ -1,5 +1,11 @@ SET @@GLOBAL.innodb_track_changed_pages=TRUE; ERROR 42000: Variable 'innodb_track_changed_pages' can't be set to the value of '1' +SET @@GLOBAL.innodb_track_changed_pages=FALSE; +SELECT @@GLOBAL.innodb_track_changed_pages; +@@GLOBAL.innodb_track_changed_pages +0 +CREATE TABLE t1(c1 INT,c2 CHAR,c3 INT,c4 CHAR KEY,c5 INT UNIQUE KEY,c6 FIXED(0,0)); +DROP TABLE t1; PURGE CHANGED_PAGE_BITMAPS BEFORE 0; 1st restart SET @@GLOBAL.innodb_track_changed_pages=FALSE; diff --git a/mysql-test/suite/innodb/t/percona_changed_page_bmp_1368530-master.opt b/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug_tracking_off-master.opt similarity index 100% rename from mysql-test/suite/innodb/t/percona_changed_page_bmp_1368530-master.opt rename to mysql-test/suite/innodb/t/percona_changed_page_bmp_debug_tracking_off-master.opt diff --git a/mysql-test/suite/innodb/t/percona_changed_page_bmp_1368530.test b/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug_tracking_off.test similarity index 71% rename from mysql-test/suite/innodb/t/percona_changed_page_bmp_1368530.test rename to mysql-test/suite/innodb/t/percona_changed_page_bmp_debug_tracking_off.test index 551a54118bbc..f16c17fe5755 100644 --- a/mysql-test/suite/innodb/t/percona_changed_page_bmp_1368530.test +++ b/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug_tracking_off.test @@ -6,6 +6,15 @@ --Error ER_WRONG_VALUE_FOR_VAR SET @@GLOBAL.innodb_track_changed_pages=TRUE; + +# PS-4989: changing innodb_track_changed_pages to false modifies it to true +# And later table creations cause assertions +SET @@GLOBAL.innodb_track_changed_pages=FALSE; +SELECT @@GLOBAL.innodb_track_changed_pages; +CREATE TABLE t1(c1 INT,c2 CHAR,c3 INT,c4 CHAR KEY,c5 INT UNIQUE KEY,c6 FIXED(0,0)); +DROP TABLE t1; + + # purge causes crash described in lp:1368530 PURGE CHANGED_PAGE_BITMAPS BEFORE 0; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 010aec1ea0db..e7c9bb39788a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12628,8 +12628,10 @@ innodb_track_changed_pages_validate( return 0; } - if (intbuf == srv_track_changed_pages) + if (intbuf == srv_track_changed_pages) { // == 0 + *reinterpret_cast(save) = srv_track_changed_pages; return 0; + } return 1; } From 8e354e469b04cc29c16841e98a5577b6792111c4 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Mon, 19 Nov 2018 10:44:16 +0200 Subject: [PATCH 085/214] [BLD-1012] Fix ps_tokudb_admin.sh to work with selinux --- scripts/ps_tokudb_admin.sh | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/scripts/ps_tokudb_admin.sh b/scripts/ps_tokudb_admin.sh index 1591ec8600f6..bc4e8e84f254 100644 --- a/scripts/ps_tokudb_admin.sh +++ b/scripts/ps_tokudb_admin.sh @@ -144,23 +144,6 @@ elif [ $ENABLE_TOKUBACKUP = 1 -a $DISABLE_TOKUBACKUP = 1 ]; then exit 1 fi -# Check SELinux status - needs to be disabled/permissive for LD_PRELOAD -if [ -n "$(which sestatus)" ]; then - printf "Checking SELinux status...\n" - STATUS_SELINUX=$(sestatus | grep "SELinux status:" | awk '{print $3}') - if [ $STATUS_SELINUX = "enabled" ]; then - MODE_SELINUX=$(sestatus | grep "Current mode:" | awk '{print $3}') - if [ $MODE_SELINUX = "enforcing" ]; then - printf "ERROR: SELinux is in enforcing mode and needs to be disabled (or put into permissive mode) for TokuDB to work correctly.\n\n" - exit 1 - else - printf "INFO: SELinux is in permissive mode.\n\n" - fi - else - printf "INFO: SELinux is disabled.\n\n" - fi -fi - # Get PID number for checking preloads if [ $ENABLE = 1 -o $ENABLE_TOKUBACKUP = 1 ]; then PID_LIST=$($MYSQL_CLIENT_BIN -e "show variables like 'pid_file';" -u $USER $PASSWORD $SOCKET $HOST $PORT 2>/tmp/ps_tokudb_admin.err) From fd229c0fa1ad5e62a8c3c81d0579de92e524e3bc Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Mon, 19 Nov 2018 14:01:26 +0400 Subject: [PATCH 086/214] Bug #27595603: SETTING SYSTEM VARIABLE CAN CAUSE SERVER EXIT The fix rejects malformed assignments with a syntax error. --- sql/sql_yacc.yy | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 85c0ae4002bd..36a41947d1cb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -13088,7 +13088,15 @@ option_value: MYSQL_YYABORT; Lex->var_list.push_back(var); } - | '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default + | '@' '@' opt_var_ident_type internal_variable_name + { + if ($4.var == trg_new_row_fake_var) + { + my_parse_error(ER(ER_SYNTAX_ERROR)); + MYSQL_YYABORT; + } + } + equal set_expr_or_default { THD *thd= YYTHD; struct sys_var_with_base tmp= $4; @@ -13098,7 +13106,7 @@ option_value: if (find_sys_var_null_base(thd, &tmp)) MYSQL_YYABORT; } - if (set_system_variable(thd, &tmp, $3, $6)) + if (set_system_variable(thd, &tmp, $3, $7)) MYSQL_YYABORT; } | charset old_or_new_charset_name_or_default From 2ec920e4aa5fe547bda21242426b824b1fa63510 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 19 Nov 2018 14:22:57 +0100 Subject: [PATCH 087/214] From 644c7cdc26b68c0774b9546292bc2fffaf01ea0a Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Mon, 19 Nov 2018 18:38:25 +0400 Subject: [PATCH 088/214] Bug #25633994: WRONG OOM CHECK The patch has fixed wrong OOM checks. Change-Id: I19c7c3cc54a0aac8996c101aa5d88278d35914e3 --- sql/sql_yacc.yy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ec73ee89a2ed..510459e4397d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -10188,7 +10188,7 @@ gorder_list: | order_expr { $$= NEW_PTN PT_gorder_list(); - if ($1 == NULL) + if ($$ == NULL) MYSQL_YYABORT; $$->push_back($1); } @@ -10816,7 +10816,7 @@ group_list: | grouping_expr { $$= NEW_PTN PT_order_list(); - if ($1 == NULL) + if ($$ == NULL) MYSQL_YYABORT; $$->push_back($1); } @@ -10896,7 +10896,7 @@ order_list: | order_expr { $$= NEW_PTN PT_order_list(); - if ($1 == NULL) + if ($$ == NULL) MYSQL_YYABORT; $$->push_back($1); } From a507f1ab2433cbf9d510d37ac2f48fc557856320 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Mon, 19 Nov 2018 23:50:10 +0100 Subject: [PATCH 089/214] From 948eba696e5af190f6bac114299394d37b6425f4 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Tue, 20 Nov 2018 10:39:55 +0530 Subject: [PATCH 090/214] Bug #28531922: KEYRING TESTS ARE FAILING FOR VALGRIND RUN ON PB2 5.7 Description :- Keyring aws tests are failing for valgrind runs on PB2 daily-5.7 and weekly-5.7 Fix :- Valgrind suppression are added for resolving the keyring aws valgrind test failures. --- mysql-test/valgrind.supp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index ab5ee05d041b..cfb472935581 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1609,6 +1609,28 @@ ... } +{ + TPL leak 22 + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + fun:CRYPTO_malloc + fun:lh_new + fun:int_thread_get + fun:int_thread_set_item + fun:ERR_get_state + fun:ERR_clear_error + obj:* + obj:* + obj:* + obj:* + obj:* + obj:* + obj:* + fun:_ZL17plugin_initializeP13st_plugin_int + ... +} + # Bug #25964438 LDAP: ASAN AND VALGRIND ISSUES { LDAP_TLS_workaround1 From 9c245bc99d1a18fd09ce20bc233e18f791105f80 Mon Sep 17 00:00:00 2001 From: Anushree Prakash B Date: Tue, 20 Nov 2018 12:44:04 +0530 Subject: [PATCH 091/214] Bug#28536312 - MYSQL SERVER CRASH WHEN ROLLBACK A 'CREATE USER' STATEMENT DESCRIPTION: ============ When a 'create user' statement is rolled back, there is a server crash because of an ASSERTION failure. ANALYSIS: ======== When a rollback happens, the plugin decides whether to abort the transaction and then set an error on the thread. However, this error is ignored and not correctly propagated to the calling functions because of which mysql_create_user finally returns success. Later on, the server crashes in my_ok where it expects that there should not have been any error. FIX: ==== The fix makes sure that the error is correctly captured. --- sql/transaction.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/transaction.cc b/sql/transaction.cc index 791f4b7da9ef..c377980160f4 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -307,7 +307,7 @@ bool trans_commit_implicit(THD *thd) res= MY_TEST(ha_commit_trans(thd, TRUE)); } else if (tc_log) - tc_log->commit(thd, true); + res= tc_log->commit(thd, true); if (res == FALSE) if (thd->rpl_thd_ctx.session_gtids_ctx(). @@ -460,7 +460,7 @@ bool trans_commit_stmt(THD *thd) trans_reset_one_shot_chistics(thd); } else if (tc_log) - tc_log->commit(thd, false); + res= tc_log->commit(thd, false); if (res == FALSE && !thd->in_active_multi_stmt_transaction()) if (thd->rpl_thd_ctx.session_gtids_ctx(). notify_after_transaction_commit(thd)) From da632a99b9b44b4f764f3d67454de2177bc2b167 Mon Sep 17 00:00:00 2001 From: Anushree Prakash B Date: Tue, 20 Nov 2018 19:53:48 +0530 Subject: [PATCH 092/214] Bug#28538971 - ASAN: DIRECT LEAK OF 272 BYTE(S) IN MAIN.MYSQLPUMP_PARTIAL_BKP MTR TEST CASE DESCRIPTION: =========== When mysqlpump encounters an error, it does not free all allocated resources resulting in memory leaks. ANALYSIS: ======== In normal scenario, when a dump task is being processed, it is added to the vector which gets cleaned up at the end of the execution. However, when an error is encountered, we simply return from the processing function without keeping a track of those tasks. This doesn't let cleanup to happen properly and results in memory leak. FIX: ==== Added code to clean up the resources in case of errors. --- client/dump/abstract_crawler.cc | 10 +++++++--- client/dump/object_queue.cc | 12 +++++++++++- mysql-test/t/mysqlpump_partial_bkp.test | 1 - 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/dump/abstract_crawler.cc b/client/dump/abstract_crawler.cc index bec84a7d486c..8016e1c6a9b2 100644 --- a/client/dump/abstract_crawler.cc +++ b/client/dump/abstract_crawler.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,12 +53,16 @@ Mysql::Tools::Base::Abstract_program* Abstract_crawler::get_program() void Abstract_crawler::process_dump_task(I_dump_task* new_dump_task) { + /* + Add the tasks to this list so that even if we error out, + cleanup is done properly. + */ + m_dump_tasks_created.push_back(new_dump_task); + /* in case of error stop all further processing */ if (get_program()->get_error_code()) return; - m_dump_tasks_created.push_back(new_dump_task); - Item_processing_data* main_item_processing_data= this->new_task_created(new_dump_task); diff --git a/client/dump/object_queue.cc b/client/dump/object_queue.cc index 6787c0ce79fc..9ec425a7137e 100644 --- a/client/dump/object_queue.cc +++ b/client/dump/object_queue.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -150,6 +150,16 @@ void Object_queue::read_object(Item_processing_data* item_to_process) void Object_queue::stop_queue() { + /* + In case of error we stop all the running queues. Make sure the + cleanup of the items is done properly. + */ + while (m_items_ready_for_processing.size() > 0) + { + Item_processing_data * item_to_process= m_items_ready_for_processing.front(); + m_items_ready_for_processing.pop(); + this->object_processing_ends(item_to_process); + } m_is_queue_running= false; } diff --git a/mysql-test/t/mysqlpump_partial_bkp.test b/mysql-test/t/mysqlpump_partial_bkp.test index 1568aad14268..ac6820f5d734 100644 --- a/mysql-test/t/mysqlpump_partial_bkp.test +++ b/mysql-test/t/mysqlpump_partial_bkp.test @@ -1,5 +1,4 @@ --source include/not_embedded.inc ---source include/not_valgrind.inc --echo # --echo # Bug#26199978 - WRONG ERROR MESSAGE FOR PARTIAL BACKUPS WITH GTID_MODE = ON From bd6e71c96ccc078290477954de86084a661f8e4a Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 21 Nov 2018 10:22:05 +0100 Subject: [PATCH 093/214] From c359aa4bfb37d902700e47b9ed29e0755ec4a700 Mon Sep 17 00:00:00 2001 From: Rahul Malik Date: Wed, 21 Nov 2018 15:23:29 +0530 Subject: [PATCH 094/214] Bug#19730200: EXCHANGE PARTITION FOR PARTITION WITH DATA DIRECTORY Problem: ======= Table partitions defined with DATA DIRECTORY options cannot be exchanged with identically defined, non-partitioned tables. Fix: ====== Allowed exchange partition with DATA DIRECTORY to be exchanged with identically defined, non-partitioned tables. reviewed by: ========== Bin Aditya --- mysql-test/r/partition_exchange.result | 453 +++++++++++++++++++++++++ mysql-test/t/partition_exchange.test | 235 +++++++++++++ sql/sql_partition.cc | 4 +- storage/innobase/row/row0mysql.cc | 48 ++- 4 files changed, 736 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition_exchange.result b/mysql-test/r/partition_exchange.result index 0de6393b6d5a..a7feb52e39cf 100644 --- a/mysql-test/r/partition_exchange.result +++ b/mysql-test/r/partition_exchange.result @@ -1647,3 +1647,456 @@ a b DROP TABLE t, tp, tsp; SET sql_mode = default; SET GLOBAL innodb_default_row_format=default; +# +# Bug#19730200: EXCHANGE PARTITION FOR PARTITION WITH DATA DIRECTORY +# +CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +PARTITION BY LIST (a) +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/', +PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/'); +INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); +INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (7, "p1"), (8, "p2"); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (a) +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +# List files from t1_dir/test +t1.ibd +# List files from p1_dir/test +t2#P#p1.ibd +# List files from p2_dir/test +t2#P#p2.ibd +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SELECT * FROM t1; +a b +3 p1 +7 p1 +SELECT * FROM t2; +a b +1 t1 +5 t1 +4 p2 +8 p2 +# List files from t1_dir/test +t2#P#p1.ibd +# List files from p1_dir/test +t1.ibd +# List files from p2_dir/test +t2#P#p2.ibd +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/p1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (a) +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +FLUSH TABLES t1, t2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/p1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (a) +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (a) +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +# List files from t1_dir/test +t1.ibd +# List files from p1_dir/test +t2#P#p1.ibd +# List files from p2_dir/test +t2#P#p2.ibd +DROP TABLE t1, t2; +# exchage partition with data dir and range +CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +PARTITION BY range (a) +(PARTITION p1 VALUES less than (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/', +PARTITION p2 VALUES less than (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/'); +INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); +INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p1 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +# List files from t1_dir/test +t1.ibd +# List files from p1_dir/test +t2#P#p1.ibd +# List files from p2_dir/test +t2#P#p2.ibd +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SELECT * FROM t1; +a b +3 p1 +4 p2 +SELECT * FROM t2; +a b +1 t1 +5 t1 +12 p2 +17 p1 +# List files from t1_dir/test +t2#P#p1.ibd +# List files from p1_dir/test +t1.ibd +# List files from p2_dir/test +t2#P#p2.ibd +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/p1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p1 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +FLUSH TABLES t1, t2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/p1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p1 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p1 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/' ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = InnoDB) */ +# List files from t1_dir/test +t1.ibd +# List files from p1_dir/test +t2#P#p1.ibd +# List files from p2_dir/test +t2#P#p2.ibd +DROP table t1,t2; +CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = MyISAM +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = MYISAM +PARTITION BY range (a) +(PARTITION p1 VALUES less than (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/', +PARTITION p2 VALUES less than (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/'); +Warnings: +Warning 1287 The partition engine, used by table 'test.t2', is deprecated and will be removed in a future release. Please use native partitioning instead. +INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); +INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); +Warnings: +Warning 1287 The partition engine, used by table 'test.t2', is deprecated and will be removed in a future release. Please use native partitioning instead. +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +ERROR HY000: Tables have different definitions +SELECT * FROM t1; +a b +1 t1 +5 t1 +SELECT * FROM t2; +a b +3 p1 +4 p2 +17 p1 +12 p2 +# List files from t1_dir +t1.MYD +test +# List files from p1_dir +t2#P#p1.MYD +test +# List files from p2_dir +t2#P#p2.MYD +test +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` varchar(64) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p1 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/' ENGINE = MyISAM, + PARTITION p2 VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = MyISAM) */ +Warnings: +Warning 1287 The partition engine, used by table 'test.t2', is deprecated and will be removed in a future release. Please use native partitioning instead. +DROP TABLE t1, t2; +exchange subpartition +CREATE TABLE t1 (id INT, purchased DATE) +ENGINE = InnoDB +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +CREATE TABLE t2 (id INT, purchased DATE) +PARTITION BY RANGE( YEAR(purchased) ) +SUBPARTITION BY HASH( TO_DAYS(purchased) ) ( +PARTITION p0 VALUES LESS THAN (1990) ( +SUBPARTITION s0 data directory='MYSQL_TMP_DIR/sp0_dir', +SUBPARTITION s1), +PARTITION p1 VALUES LESS THAN (2000) ( +SUBPARTITION s2, +SUBPARTITION s3 data directory='MYSQL_TMP_DIR/sp3_dir' +)); +insert into t2 values(1,'1987-05-12 '),(2,'1987-05-14'); +insert into t2 values(3,'1997-05-10 '),(4,'1997-05-18'); +insert into t1 values(1,'1987-05-10 '),(2,'1987-05-08'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE ( YEAR(purchased)) +SUBPARTITION BY HASH ( TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN (1990) + (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp0_dir/' ENGINE = InnoDB, + SUBPARTITION s1 ENGINE = InnoDB), + PARTITION p1 VALUES LESS THAN (2000) + (SUBPARTITION s2 ENGINE = InnoDB, + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp3_dir/' ENGINE = InnoDB)) */ +# List files from t1_dir/test +t1.ibd +# List files from sp0_dir/test +t2#P#p0#SP#s0.ibd +# List files from sp3_dir/test +t2#P#p1#SP#s3.ibd +ALTER TABLE t2 EXCHANGE PARTITION s0 WITH TABLE t1; +SELECT * FROM t1; +id purchased +1 1987-05-12 +2 1987-05-14 +SELECT * FROM t2; +id purchased +1 1987-05-10 +2 1987-05-08 +3 1997-05-10 +4 1997-05-18 +# List files from t1_dir/test +t2#P#p0#SP#s0.ibd +# List files from sp0_dir/test +t1.ibd +# List files from sp3_dir/test +t2#P#p1#SP#s3.ibd +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/sp0_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE ( YEAR(purchased)) +SUBPARTITION BY HASH ( TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN (1990) + (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/' ENGINE = InnoDB, + SUBPARTITION s1 ENGINE = InnoDB), + PARTITION p1 VALUES LESS THAN (2000) + (SUBPARTITION s2 ENGINE = InnoDB, + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp3_dir/' ENGINE = InnoDB)) */ +ALTER TABLE t2 EXCHANGE PARTITION s0 WITH TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE ( YEAR(purchased)) +SUBPARTITION BY HASH ( TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN (1990) + (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp0_dir/' ENGINE = InnoDB, + SUBPARTITION s1 ENGINE = InnoDB), + PARTITION p1 VALUES LESS THAN (2000) + (SUBPARTITION s2 ENGINE = InnoDB, + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp3_dir/' ENGINE = InnoDB)) */ +# List files from t1_dir/test +t1.ibd +# List files from sp0_dir/test +t2#P#p0#SP#s0.ibd +# List files from sp3_dir/test +t2#P#p1#SP#s3.ibd +delete from t1; +insert into t1 values(3,'1997-05-8 '),(4,'1997-05-16'); +ALTER TABLE t2 EXCHANGE PARTITION s3 WITH TABLE t1; +SELECT * FROM t1; +id purchased +3 1997-05-10 +4 1997-05-18 +SELECT * FROM t2; +id purchased +1 1987-05-12 +2 1987-05-14 +3 1997-05-08 +4 1997-05-16 +# List files from t1_dir/test +t2#P#p1#SP#s3.ibd +# List files from sp0_dir/test +t2#P#p0#SP#s0.ibd +# List files from sp3_dir/test +t1.ibd +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/sp3_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE ( YEAR(purchased)) +SUBPARTITION BY HASH ( TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN (1990) + (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp0_dir/' ENGINE = InnoDB, + SUBPARTITION s1 ENGINE = InnoDB), + PARTITION p1 VALUES LESS THAN (2000) + (SUBPARTITION s2 ENGINE = InnoDB, + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/' ENGINE = InnoDB)) */ +ALTER TABLE t2 EXCHANGE PARTITION s3 WITH TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE ( YEAR(purchased)) +SUBPARTITION BY HASH ( TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN (1990) + (SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp0_dir/' ENGINE = InnoDB, + SUBPARTITION s1 ENGINE = InnoDB), + PARTITION p1 VALUES LESS THAN (2000) + (SUBPARTITION s2 ENGINE = InnoDB, + SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/sp3_dir/' ENGINE = InnoDB)) */ +# List files from t1_dir/test +t1.ibd +# List files from sp0_dir/test +t2#P#p0#SP#s0.ibd +# List files from sp3_dir/test +t2#P#p1#SP#s3.ibd +DROP table t1,t2; diff --git a/mysql-test/t/partition_exchange.test b/mysql-test/t/partition_exchange.test index 78b98127d963..ed5693ce46b7 100644 --- a/mysql-test/t/partition_exchange.test +++ b/mysql-test/t/partition_exchange.test @@ -674,3 +674,238 @@ DROP TABLE t, tp, tsp; SET sql_mode = default; SET GLOBAL innodb_default_row_format=default; +--echo # +--echo # Bug#19730200: EXCHANGE PARTITION FOR PARTITION WITH DATA DIRECTORY +--echo # +--mkdir $MYSQL_TMP_DIR/t1_dir +--mkdir $MYSQL_TMP_DIR/p1_dir +--mkdir $MYSQL_TMP_DIR/p2_dir +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +PARTITION BY LIST (a) +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir/', + PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir/'); +INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); +INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (7, "p1"), (8, "p2"); +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from p1_dir/test +--list_files $MYSQL_TMP_DIR/p1_dir/test +--echo # List files from p2_dir/test +--list_files $MYSQL_TMP_DIR/p2_dir/test +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SELECT * FROM t1; +SELECT * FROM t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from p1_dir/test +--list_files $MYSQL_TMP_DIR/p1_dir/test +--echo # List files from p2_dir/test +--list_files $MYSQL_TMP_DIR/p2_dir/test +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +FLUSH TABLES t1, t2; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from p1_dir/test +--list_files $MYSQL_TMP_DIR/p1_dir/test +--echo # List files from p2_dir/test +--list_files $MYSQL_TMP_DIR/p2_dir/test +DROP TABLE t1, t2; +--echo # exchage partition with data dir and range +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = InnoDB +PARTITION BY range (a) +(PARTITION p1 VALUES less than (10) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir/', + PARTITION p2 VALUES less than (20) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir/'); +INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); +INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from p1_dir/test +--list_files $MYSQL_TMP_DIR/p1_dir/test +--echo # List files from p2_dir/test +--list_files $MYSQL_TMP_DIR/p2_dir/test +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SELECT * FROM t1; +SELECT * FROM t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from p1_dir/test +--list_files $MYSQL_TMP_DIR/p1_dir/test +--echo # List files from p2_dir/test +--list_files $MYSQL_TMP_DIR/p2_dir/test +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +FLUSH TABLES t1, t2; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from p1_dir/test +--list_files $MYSQL_TMP_DIR/p1_dir/test +--echo # List files from p2_dir/test +--list_files $MYSQL_TMP_DIR/p2_dir/test +DROP table t1,t2; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = MyISAM +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) +ENGINE = MYISAM +PARTITION BY range (a) +(PARTITION p1 VALUES less than (10) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir/', + PARTITION p2 VALUES less than (20) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir/'); +INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); +INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); +--error ER_TABLES_DIFFERENT_METADATA +ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; +SELECT * FROM t1; +SELECT * FROM t2; +--echo # List files from t1_dir +--list_files $MYSQL_TMP_DIR/t1_dir +--echo # List files from p1_dir +--list_files $MYSQL_TMP_DIR/p1_dir +--echo # List files from p2_dir +--list_files $MYSQL_TMP_DIR/p2_dir +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; +--rmdir $mysql_tmp_dir/t1_dir/test +--rmdir $mysql_tmp_dir/p1_dir/test +--rmdir $mysql_tmp_dir/p2_dir/test +--rmdir $mysql_tmp_dir/t1_dir +--rmdir $mysql_tmp_dir/p1_dir +--rmdir $mysql_tmp_dir/p2_dir + +--echo exchange subpartition + +--mkdir $MYSQL_TMP_DIR/t1_dir +--mkdir $MYSQL_TMP_DIR/sp0_dir +--mkdir $MYSQL_TMP_DIR/sp3_dir +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t1 (id INT, purchased DATE) +ENGINE = InnoDB +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t2 (id INT, purchased DATE) +PARTITION BY RANGE( YEAR(purchased) ) +SUBPARTITION BY HASH( TO_DAYS(purchased) ) ( +PARTITION p0 VALUES LESS THAN (1990) ( +SUBPARTITION s0 data directory='$MYSQL_TMP_DIR/sp0_dir', +SUBPARTITION s1), +PARTITION p1 VALUES LESS THAN (2000) ( +SUBPARTITION s2, +SUBPARTITION s3 data directory='$MYSQL_TMP_DIR/sp3_dir' +)); +insert into t2 values(1,'1987-05-12 '),(2,'1987-05-14'); +insert into t2 values(3,'1997-05-10 '),(4,'1997-05-18'); +insert into t1 values(1,'1987-05-10 '),(2,'1987-05-08'); +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from sp0_dir/test +--list_files $MYSQL_TMP_DIR/sp0_dir/test +--echo # List files from sp3_dir/test +--list_files $MYSQL_TMP_DIR/sp3_dir/test +ALTER TABLE t2 EXCHANGE PARTITION s0 WITH TABLE t1; +SELECT * FROM t1; +SELECT * FROM t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from sp0_dir/test +--list_files $MYSQL_TMP_DIR/sp0_dir/test +--echo # List files from sp3_dir/test +--list_files $MYSQL_TMP_DIR/sp3_dir/test +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +ALTER TABLE t2 EXCHANGE PARTITION s0 WITH TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from sp0_dir/test +--list_files $MYSQL_TMP_DIR/sp0_dir/test +--echo # List files from sp3_dir/test +--list_files $MYSQL_TMP_DIR/sp3_dir/test +delete from t1; +insert into t1 values(3,'1997-05-8 '),(4,'1997-05-16'); +ALTER TABLE t2 EXCHANGE PARTITION s3 WITH TABLE t1; +SELECT * FROM t1; +SELECT * FROM t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from sp0_dir/test +--list_files $MYSQL_TMP_DIR/sp0_dir/test +--echo # List files from sp3_dir/test +--list_files $MYSQL_TMP_DIR/sp3_dir/test +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +ALTER TABLE t2 EXCHANGE PARTITION s3 WITH TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t1; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +SHOW CREATE TABLE t2; +--echo # List files from t1_dir/test +--list_files $MYSQL_TMP_DIR/t1_dir/test +--echo # List files from sp0_dir/test +--list_files $MYSQL_TMP_DIR/sp0_dir/test +--echo # List files from sp3_dir/test +--list_files $MYSQL_TMP_DIR/sp3_dir/test +DROP table t1,t2; +--rmdir $mysql_tmp_dir/t1_dir/test +--rmdir $mysql_tmp_dir/sp0_dir/test +--rmdir $mysql_tmp_dir/sp3_dir/test +--rmdir $mysql_tmp_dir/t1_dir +--rmdir $mysql_tmp_dir/sp0_dir +--rmdir $mysql_tmp_dir/sp3_dir diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 9fe18bd8123f..24f64dbe6ada 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4913,8 +4913,6 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info, option_diffs[errors++]= "MAX_ROWS"; if (part_elem->part_min_rows != table_create_info->min_rows) option_diffs[errors++]= "MIN_ROWS"; - if (part_elem->data_file_name || table_create_info->data_file_name) - option_diffs[errors++]= "DATA DIRECTORY"; if (part_elem->index_file_name || table_create_info->index_file_name) option_diffs[errors++]= "INDEX DIRECTORY"; diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 7718f9634453..7a63d138d900 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -5241,7 +5241,8 @@ row_rename_table_for_mysql( pars_info_t* info = NULL; int retry; bool aux_fts_rename = false; - + bool is_new_part; + bool is_old_part; ut_a(old_name != NULL); ut_a(new_name != NULL); ut_ad(trx->state == TRX_STATE_ACTIVE); @@ -5280,6 +5281,12 @@ row_rename_table_for_mysql( table = dict_table_open_on_name(old_name, dict_locked, FALSE, DICT_ERR_IGNORE_NONE); + is_old_part = strstr((char*)old_name, "#p#") || + strstr((char*)old_name, "#P"); + + is_new_part = strstr((char*)new_name, "#p#") || + strstr((char*)new_name, "#P"); + if (!table) { err = DB_TABLE_NOT_FOUND; goto funct_exit; @@ -5313,6 +5320,45 @@ row_rename_table_for_mysql( } } + /* To exchange a normal table(t1) with partition table (p1), the + rename logic is something like: 1) t1 -> tmp table 2) p1-> t1 + 3) tmp -> p1. And special handling of dict_table_t::data_dir_path + is necessary if DATA DIRECTORY is specified. + For example if DATA DIRECTORY Is '/tmp', the data directory for + nomral table is '/tmp/t1', while for partition is '/tmp'. So during + above rename step 2) and 3), the postfix table name 't1' should + either be truncated or appended.*/ + if (old_is_tmp && is_new_part && table->data_dir_path != NULL) { + std::string str(table->data_dir_path); + size_t found = str.find_last_of("/\\"); + + ut_ad(found != std::string::npos); + found++; + + table->data_dir_path[found] = '\0'; + + } else if (is_old_part && !is_new_part && + table->data_dir_path != NULL && !new_is_tmp) { + + uint old_size = mem_heap_get_size(table->heap); + + std::string str(table->data_dir_path); + + /* new_name contains database/name but we require name */ + const char *name = strchr(new_name, '/') + 1; + + str.append(name); + + table->data_dir_path = + mem_heap_strdup(table->heap, str.c_str()); + + uint new_size = mem_heap_get_size(table->heap); + + ut_ad(mutex_own(&dict_sys->mutex)); + + dict_sys->size += new_size - old_size; + } + /* Is a foreign key check running on this table? */ for (retry = 0; retry < 100 && table->n_foreign_key_checks_running > 0; ++retry) { From ba47cdf19dabe7532a656dbd6ef03d2c04410a50 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 21 Nov 2018 13:23:31 +0100 Subject: [PATCH 095/214] From 23a798a7a188c0f80fc4c5fbed00ee396e3efbe3 Mon Sep 17 00:00:00 2001 From: Erlend Dahl Date: Tue, 20 Nov 2018 07:08:31 +0100 Subject: [PATCH 096/214] WL#12619 Deprecate (5.7) and remove (8.0) resolve_stack_dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.7 version of the patch, add a deprecation warning. Approved by Terje Røsten Approved by Shipra Jain --- extra/resolve_stack_dump.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extra/resolve_stack_dump.cc b/extra/resolve_stack_dump.cc index 05ca4ea2a98f..8021505969b1 100644 --- a/extra/resolve_stack_dump.cc +++ b/extra/resolve_stack_dump.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -334,6 +334,10 @@ static void do_resolve() int main(int argc, char** argv) { + + fprintf(stderr, "Warning: resolve_stack_dump is deprecated and will be removed in a future " + "version.\n"); + MY_INIT(argv[0]); parse_args(argc, argv); open_files(); From c23897616521a6da120d7d4e2145184bd9a260bf Mon Sep 17 00:00:00 2001 From: Erlend Dahl Date: Tue, 20 Nov 2018 07:09:18 +0100 Subject: [PATCH 097/214] WL#12620 Deprecate (5.7) and remove (8.0) resolveip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.7 version of the patch, add a deprecation warning. Approved by Terje Røsten Approved by Shipra Jain --- extra/resolveip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extra/resolveip.c b/extra/resolveip.c index 89b8a6faa391..77477fbd663c 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -117,6 +117,9 @@ int main(int argc, char **argv) char *ip,**q; int error=0; + fprintf(stderr, "Warning: resolveip is deprecated and will be removed in a future " + "version.\n"); + MY_INIT(argv[0]); if (get_options(&argc,&argv)) From 931db1001a22725db5f83f0be39fe2f79c083490 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Thu, 22 Nov 2018 05:10:38 +0100 Subject: [PATCH 098/214] From 45e7bf71f1392a3372c21a3c3da884e118d21a03 Mon Sep 17 00:00:00 2001 From: Karthik Kamath Date: Thu, 22 Nov 2018 11:17:37 +0530 Subject: [PATCH 099/214] BUG#27703912: EXCESSIVE MEMORY USAGE WITH MANY PREPARE STATEMENT PLACEHOLDERS ANALYSIS: ========= Executing a prepared statement to do a multi row insertion with large number of placeholders consumes excessive memory. With binlog enabled, the execution takes a long time too. To write a statement to binlog, the query string is prepared during the execution. The query string preparation in this scenario involves many string append calls to expand heap allocated memory and memcpy. Hence a delay is observed during the statement execution. FIX: ==== A reasonable size of memory is reserved for the query string. Memory of size "original statement string size + 32 times the number of parameters" is reserved to avoid reallocations during string appends in common use cases. The String class enforces a limit of 4 GigaBytes for strings. This can overflow in 64-bit platforms. A check has been added for 64-bit platforms to handle the overflow. It is the responsibility of the caller to ensure that the memory buffer required to hold the string doesn't exceed 4GB. An error is reported if it exceeds 4GB. A test case was not written for this issue due to enviromental limitations. Note: This patch includes a backport of patch for Bug#27699248. --- client/sql_string.cc | 8 +++++++- sql/sql_prepare.cc | 28 ++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index decd776d5156..ab4535dc2851 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include "sql_string.h" #include +#include using std::min; using std::max; @@ -74,6 +75,11 @@ bool String::realloc(uint32 alloc_length, bool force_on_heap) if (Alloced_length < len) { + // Signal an error if len exceeds uint32 max on 64-bit word platform. +#if defined(__WORDSIZE) && (__WORDSIZE == 64) + if (len > std::numeric_limits::max()) + return TRUE; +#endif char *new_ptr; if (alloced) { diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 5a145bf6cc51..3c18ecac6ff5 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -118,6 +118,7 @@ When one supplies long data for a placeholder: #include "transaction.h" // trans_rollback_implicit #include "sql_audit.h" #include +#include using std::max; using std::min; @@ -1190,6 +1191,7 @@ static bool insert_params_from_vars(Prepared_statement *stmt, user_var_entry *entry; LEX_STRING *varname; List_iterator var_it(varnames); + size_t length= 0; DBUG_ENTER("insert_params_from_vars"); for (Item_param **it= begin; it < end; ++it) @@ -1199,7 +1201,13 @@ static bool insert_params_from_vars(Prepared_statement *stmt, entry= (user_var_entry*)my_hash_search(&stmt->thd->user_vars, (uchar*) varname->str, varname->length); - if (param->set_from_user_var(stmt->thd, entry) || + if (param->set_from_user_var(stmt->thd, entry)) + DBUG_RETURN(1); + + if (entry) + length+= entry->length(); + + if (length > std::numeric_limits::max() || param->convert_str_value(stmt->thd)) DBUG_RETURN(1); } @@ -1228,15 +1236,14 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt, user_var_entry *entry; LEX_STRING *varname; List_iterator var_it(varnames); - String buf; + StringBuffer buf; const String *val; uint32 length= 0; THD *thd= stmt->thd; DBUG_ENTER("insert_params_from_vars_with_log"); - if (query->copy(stmt->query(), stmt->query_length(), default_charset_info)) - DBUG_RETURN(1); + query->reserve(stmt->query_length() + 32 * stmt->param_count); for (Item_param **it= begin; it < end; ++it) { @@ -1258,10 +1265,19 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt, if (param->convert_str_value(thd)) DBUG_RETURN(1); /* out of memory */ - if (query->replace(param->pos_in_query+length, 1, *val)) + size_t num_bytes = param->pos_in_query - length; + if (query->length() + num_bytes + val->length() > + std::numeric_limits::max()) + DBUG_RETURN(1); + + if (query->append(stmt->query() + length, num_bytes) || + query->append(*val)) DBUG_RETURN(1); - length+= val->length()-1; + + length = param->pos_in_query + 1; } + // Take care of tail. + query->append(stmt->query() + length, stmt->query_length() - length); DBUG_RETURN(0); } From 906435bec48e16ffa97919fc4d3bea0cc92fd1ca Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Thu, 22 Nov 2018 17:38:41 +0530 Subject: [PATCH 100/214] From 7a8447278fe16193ce187c76cbc75e2e60d9d80a Mon Sep 17 00:00:00 2001 From: Sachin Agarwal Date: Thu, 22 Nov 2018 18:26:31 +0530 Subject: [PATCH 101/214] Bug #26636815 OS0FILE.CC ASSERTION FAILED 'OFFSET > 0' IN OS_FILE_IO_COMPLETE Problem: Assertion failure due to narrow cast. The value passed as 'offset' argument to the os_file_io_complete() is cast by the calling function prior to invoking from 'os_offset_t' to 'ulint'. 'ulint' is 32-bit in windows. So if we write/read to a table beyond 4 GB. It may hit assert 'offset > 0'. Fix: Changed data-type for 'offset' variable to os_offset_t. RB: 20847 Reviewed by : annamalai.gurusami@oracle.com --- storage/innobase/os/os0file.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index b34dc6708a06..748d5d70eb36 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -827,7 +827,7 @@ os_file_io_complete( byte* buf, byte* scratch, ulint src_len, - ulint offset, + os_offset_t offset, ulint len); /** Does simulated AIO. This function should be called by an i/o-handler @@ -971,8 +971,7 @@ class AIOHandler { return(os_file_io_complete( slot->type, slot->file.m_file, slot->buf, NULL, slot->original_len, - static_cast(slot->offset), - slot->len)); + slot->offset, slot->len)); } private: @@ -1692,7 +1691,7 @@ os_file_io_complete( byte* buf, byte* scratch, ulint src_len, - ulint offset, + os_offset_t offset, ulint len) { /* We never compress/decompress the first page */ @@ -2347,6 +2346,9 @@ LinuxAIOHandler::resubmit(Slot* slot) slot->n_bytes = 0; slot->io_already_done = false; + /* make sure that slot->offset fits in off_t */ + ut_ad(sizeof(off_t) >= sizeof(os_offset_t)); + struct iocb* iocb = &slot->control; if (slot->type.is_read()) { io_prep_pread( @@ -2354,7 +2356,7 @@ LinuxAIOHandler::resubmit(Slot* slot) slot->file.m_file, slot->ptr, slot->len, - static_cast(slot->offset)); + slot->offset); } else { @@ -2365,7 +2367,7 @@ LinuxAIOHandler::resubmit(Slot* slot) slot->file.m_file, slot->ptr, slot->len, - static_cast(slot->offset)); + slot->offset); } iocb->data = slot; @@ -5443,8 +5445,7 @@ os_file_io( *err = os_file_io_complete( type, file, reinterpret_cast(buf), - NULL, original_n, - static_cast(offset), n); + NULL, original_n, offset, n); } else { *err = DB_SUCCESS; From c1373de61e7a65d45c6884bfc902acbbdc4b8e87 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Thu, 22 Nov 2018 13:56:40 +0100 Subject: [PATCH 102/214] From ee04a600a052f6cbebb8d5094c3ab8b75ba47f58 Mon Sep 17 00:00:00 2001 From: Rahul Malik Date: Fri, 23 Nov 2018 16:18:10 +0530 Subject: [PATCH 103/214] Bug#19730200 EXCHANGE PARTITION FOR PARTITION WITH DATA DIRECTORY Follow up fix. fixed the testcase. --- mysql-test/r/partition_exchange.result | 69 +++--------------------- mysql-test/t/partition_exchange.test | 75 ++++++++++++++------------ 2 files changed, 47 insertions(+), 97 deletions(-) diff --git a/mysql-test/r/partition_exchange.result b/mysql-test/r/partition_exchange.result index a7feb52e39cf..3abaf0979d70 100644 --- a/mysql-test/r/partition_exchange.result +++ b/mysql-test/r/partition_exchange.result @@ -1652,12 +1652,12 @@ SET GLOBAL innodb_default_row_format=default; # CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB -DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir'; CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB PARTITION BY LIST (a) -(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/', -PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/'); +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir', +PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir'); INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (7, "p1"), (8, "p2"); SHOW CREATE TABLE t1; @@ -1763,12 +1763,12 @@ DROP TABLE t1, t2; # exchage partition with data dir and range CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB -DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir'; CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB PARTITION BY range (a) -(PARTITION p1 VALUES less than (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/', -PARTITION p2 VALUES less than (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/'); +(PARTITION p1 VALUES less than (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir', +PARTITION p2 VALUES less than (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir'); INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); SHOW CREATE TABLE t1; @@ -1871,65 +1871,10 @@ t2#P#p1.ibd # List files from p2_dir/test t2#P#p2.ibd DROP table t1,t2; -CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) -ENGINE = MyISAM -DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; -CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) -ENGINE = MYISAM -PARTITION BY range (a) -(PARTITION p1 VALUES less than (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/', -PARTITION p2 VALUES less than (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/'); -Warnings: -Warning 1287 The partition engine, used by table 'test.t2', is deprecated and will be removed in a future release. Please use native partitioning instead. -INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); -INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); -Warnings: -Warning 1287 The partition engine, used by table 'test.t2', is deprecated and will be removed in a future release. Please use native partitioning instead. -ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; -ERROR HY000: Tables have different definitions -SELECT * FROM t1; -a b -1 t1 -5 t1 -SELECT * FROM t2; -a b -3 p1 -4 p2 -17 p1 -12 p2 -# List files from t1_dir -t1.MYD -test -# List files from p1_dir -t2#P#p1.MYD -test -# List files from p2_dir -t2#P#p2.MYD -test -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(10) unsigned NOT NULL AUTO_INCREMENT, - `b` varchar(64) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TMP_DIR/t1_dir/' -SHOW CREATE TABLE t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` int(10) unsigned NOT NULL AUTO_INCREMENT, - `b` varchar(64) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE (a) -(PARTITION p1 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQL_TMP_DIR/p1_dir/' ENGINE = MyISAM, - PARTITION p2 VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQL_TMP_DIR/p2_dir/' ENGINE = MyISAM) */ -Warnings: -Warning 1287 The partition engine, used by table 'test.t2', is deprecated and will be removed in a future release. Please use native partitioning instead. -DROP TABLE t1, t2; exchange subpartition CREATE TABLE t1 (id INT, purchased DATE) ENGINE = InnoDB -DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir/'; +DATA DIRECTORY = 'MYSQL_TMP_DIR/t1_dir'; CREATE TABLE t2 (id INT, purchased DATE) PARTITION BY RANGE( YEAR(purchased) ) SUBPARTITION BY HASH( TO_DAYS(purchased) ) ( diff --git a/mysql-test/t/partition_exchange.test b/mysql-test/t/partition_exchange.test index ed5693ce46b7..b7c7bdb89a59 100644 --- a/mysql-test/t/partition_exchange.test +++ b/mysql-test/t/partition_exchange.test @@ -683,13 +683,13 @@ SET GLOBAL innodb_default_row_format=default; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB -DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir'; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB PARTITION BY LIST (a) -(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir/', - PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir/'); +(PARTITION p1 VALUES IN (1,3,5,7,9) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir', + PARTITION p2 VALUES IN (0,2,4,6,8) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir'); INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (7, "p1"), (8, "p2"); --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR @@ -697,19 +697,25 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from p1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p1_dir/test --echo # List files from p2_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p2_dir/test ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; SELECT * FROM t1; SELECT * FROM t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from p1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p1_dir/test --echo # List files from p2_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p2_dir/test --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t1; @@ -726,23 +732,26 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from p1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p1_dir/test --echo # List files from p2_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p2_dir/test DROP TABLE t1, t2; --echo # exchage partition with data dir and range --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB -DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir'; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) ENGINE = InnoDB PARTITION BY range (a) -(PARTITION p1 VALUES less than (10) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir/', - PARTITION p2 VALUES less than (20) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir/'); +(PARTITION p1 VALUES less than (10) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir', + PARTITION p2 VALUES less than (20) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir'); INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR @@ -750,19 +759,25 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from p1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p1_dir/test --echo # List files from p2_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p2_dir/test ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; SELECT * FROM t1; SELECT * FROM t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from p1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p1_dir/test --echo # List files from p2_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p2_dir/test --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t1; @@ -779,46 +794,21 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from p1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p1_dir/test --echo # List files from p2_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/p2_dir/test DROP table t1,t2; ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR -eval CREATE TABLE t1 (a int unsigned auto_increment primary key, b varchar(64)) -ENGINE = MyISAM -DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR -eval CREATE TABLE t2 (a int unsigned auto_increment primary key, b varchar(64)) -ENGINE = MYISAM -PARTITION BY range (a) -(PARTITION p1 VALUES less than (10) DATA DIRECTORY = '$MYSQL_TMP_DIR/p1_dir/', - PARTITION p2 VALUES less than (20) DATA DIRECTORY = '$MYSQL_TMP_DIR/p2_dir/'); -INSERT INTO t1 VALUES (1, "t1"), (5, "t1"); -INSERT INTO t2 VALUES (3, "p1"), (4, "p2"), (17, "p1"), (12, "p2"); ---error ER_TABLES_DIFFERENT_METADATA -ALTER TABLE t2 EXCHANGE PARTITION p1 WITH TABLE t1; -SELECT * FROM t1; -SELECT * FROM t2; ---echo # List files from t1_dir ---list_files $MYSQL_TMP_DIR/t1_dir ---echo # List files from p1_dir ---list_files $MYSQL_TMP_DIR/p1_dir ---echo # List files from p2_dir ---list_files $MYSQL_TMP_DIR/p2_dir ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR -SHOW CREATE TABLE t1; ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR -SHOW CREATE TABLE t2; -DROP TABLE t1, t2; --rmdir $mysql_tmp_dir/t1_dir/test --rmdir $mysql_tmp_dir/p1_dir/test --rmdir $mysql_tmp_dir/p2_dir/test --rmdir $mysql_tmp_dir/t1_dir --rmdir $mysql_tmp_dir/p1_dir --rmdir $mysql_tmp_dir/p2_dir - --echo exchange subpartition --mkdir $MYSQL_TMP_DIR/t1_dir @@ -827,7 +817,7 @@ DROP TABLE t1, t2; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval CREATE TABLE t1 (id INT, purchased DATE) ENGINE = InnoDB -DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir/'; +DATA DIRECTORY = '$MYSQL_TMP_DIR/t1_dir'; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR eval CREATE TABLE t2 (id INT, purchased DATE) PARTITION BY RANGE( YEAR(purchased) ) @@ -847,19 +837,25 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from sp0_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp0_dir/test --echo # List files from sp3_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp3_dir/test ALTER TABLE t2 EXCHANGE PARTITION s0 WITH TABLE t1; SELECT * FROM t1; SELECT * FROM t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from sp0_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp0_dir/test --echo # List files from sp3_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp3_dir/test --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t1; @@ -871,10 +867,13 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from sp0_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp0_dir/test --echo # List files from sp3_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp3_dir/test delete from t1; insert into t1 values(3,'1997-05-8 '),(4,'1997-05-16'); @@ -882,10 +881,13 @@ ALTER TABLE t2 EXCHANGE PARTITION s3 WITH TABLE t1; SELECT * FROM t1; SELECT * FROM t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from sp0_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp0_dir/test --echo # List files from sp3_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp3_dir/test --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t1; @@ -897,10 +899,13 @@ SHOW CREATE TABLE t1; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW CREATE TABLE t2; --echo # List files from t1_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/t1_dir/test --echo # List files from sp0_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp0_dir/test --echo # List files from sp3_dir/test +--replace_result #p# #P# #sp# #SP# --list_files $MYSQL_TMP_DIR/sp3_dir/test DROP table t1,t2; --rmdir $mysql_tmp_dir/t1_dir/test From 0bbfaceaa4242f9772b4eaa648c09342b7f17e0f Mon Sep 17 00:00:00 2001 From: Rahul Agarkar Date: Wed, 21 Nov 2018 15:50:03 +0100 Subject: [PATCH 104/214] Bug#27309336 Backport to 5.7 Problem: Hang observed while attempting to create large number of tables as fast as possible if innodb_flush_method is set to O_DIRECT_NO_FSYNC. No hang or crash is observed when the innodb_flush_method is set to O_DIRECT. The problem seems to be because of out of sync FS meta data as fsync() is never called if the flush method is set to O_DIRECT_NO_FSYNC. Fix: Call fsync in O_DIRECT_NO_FSYNC mode whenever the size of the file changes. This will keep the FS metadata in sync. RB: 20994 Reviewed by: Debarun Banerjee (debarun.banerjee@oracle.com) --- storage/innobase/fil/fil0fil.cc | 46 ++++++++++++++++++++++++------ storage/innobase/include/fil0fil.h | 7 ++++- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index d00a08c4f8cd..b5a5c99b47a1 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -604,6 +604,8 @@ fil_node_create_low( node->size = size; + node->flush_size = size; + node->magic_n = FIL_NODE_MAGIC_N; node->init_size = size; @@ -5921,26 +5923,37 @@ fil_flush( return; } - if (fil_buffering_disabled(space)) { + bool fbd = fil_buffering_disabled(space); + if (fbd) { /* No need to flush. User has explicitly disabled - buffering. */ + buffering. However, flush should be called if the file + size changes to keep OS metadata in sync. */ ut_ad(!space->is_in_unflushed_spaces); ut_ad(fil_space_is_flushed(space)); ut_ad(space->n_pending_flushes == 0); -#ifdef UNIV_DEBUG + /* Flush only if the file size changes */ + bool no_flush = true; for (node = UT_LIST_GET_FIRST(space->chain); node != NULL; node = UT_LIST_GET_NEXT(chain, node)) { +#ifdef UNIV_DEBUG ut_ad(node->modification_counter == node->flush_counter); ut_ad(node->n_pending_flushes == 0); - } #endif /* UNIV_DEBUG */ + if (node->flush_size != node->size) { + /* Found at least one file whose size has changed */ + no_flush = false; + break; + } + } - mutex_exit(&fil_system->mutex); - return; + if (no_flush) { + mutex_exit(&fil_system->mutex); + return; + } } space->n_pending_flushes++; /*!< prevent dropping of the space while @@ -5951,11 +5964,26 @@ fil_flush( int64_t old_mod_counter = node->modification_counter; - if (old_mod_counter <= node->flush_counter) { + if (!node->is_open) { continue; } - ut_a(node->is_open); + /* Skip flushing if the file size has not changed since + last flush was done and the flush mode is O_DIRECT_NO_FSYNC */ + if (fbd && (node->flush_size == node->size)) { + continue; + } + + /* If we are here and the flush mode is O_DIRECT_NO_FSYNC, then + it means that the file size has changed and hence, it shold be + flushed, irrespective of the mod_counter and flush counter values, + which are always same in case of O_DIRECT_NO_FSYNC to avoid flush + on every write operation. + For other flush modes, if the flush_counter is same or ahead of + the mode_counter, skip the flush. */ + if (!fbd && (old_mod_counter <= node->flush_counter)) { + continue; + } switch (space->purpose) { case FIL_TYPE_TEMPORARY: @@ -6008,6 +6036,8 @@ fil_flush( os_file_flush(file); + node->flush_size = node->size; + mutex_enter(&fil_system->mutex); os_event_set(node->sync_event); diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index f21a2fb44bb9..f09dc0f2e6c5 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -259,6 +259,11 @@ struct fil_node_t { the possible last incomplete megabyte may be ignored if space->id == 0 */ ulint size; + + /** Size of the file when last flushed, used to force the flush when file + grows to keep the filesystem metadata synced when using O_DIRECT_NO_FSYNC */ + ulint flush_size; + /** initial size of the file in database pages; FIL_IBD_FILE_INITIAL_SIZE by default */ ulint init_size; From 4f2a1b2fc8f61b6a8298e73ff2dae43b08af871a Mon Sep 17 00:00:00 2001 From: Karthik Kamath Date: Fri, 23 Nov 2018 16:50:54 +0530 Subject: [PATCH 105/214] BUG#28293047: LOCK_GRANT AND LOCK_OPEN CAN DEADLOCK ON A GTID SLAVE ANALYSIS: ========= In a MySQL server started with GTID_MODE=ON, concurrent running of the statements DROP USER and SELECT on I_S.columns table on multiple threads could lead to a deadlock. The INFORMATION_SCHEMA.COLUMNS table provides information about columns in tables. DROP USER acquires LOCK_GRANT in mysql_drop_user() and later acquires LOCK_OPEN on mysql.gtid_executed table. SELECT on I_S tables acquires LOCK_OPEN on the tables it tries to fetch information from, in fill_schema_table_from_frm() and later acquires LOCK_GRANT. Since the lock order is opposite in these two queries, a deadlock occurs. SELECT on I_S table takes LOCK_OPEN before opening the table in open_table_from_share() and it is released only after releasing LOCK_GRANT. LOCK_GRANT is acquired for fetching the necessary column information from the tables. So LOCK_OPEN was being held for a duration longer than necessary. FIX: ==== For SELECT on I_S tables, release LOCK_OPEN immediately after open_table_from_share() returns. Change-Id: I04d4e1bc38d4de74d0b99bad3dba43d9cce96168 --- sql/sql_show.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index aa4ab9225f66..4fa9125f4afa 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4405,8 +4405,10 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables, tbl.s= share; table_list.table= &tbl; table_list.set_view_query((LEX*) share->is_view); + mysql_mutex_unlock(&LOCK_open); res= schema_table->process_table(thd, &table_list, table, res, db_name, table_name); + mysql_mutex_lock(&LOCK_open); closefrm(&tbl, 0); free_root(&tbl.mem_root, MYF(0)); my_free((void *) tbl.alias); From 07a000edf2793e7d5f8888d2430bb12239b32be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=A0valjek?= Date: Fri, 23 Nov 2018 14:59:49 +0100 Subject: [PATCH 106/214] Bug #27588064: DDL+INSTALL/UNINSTALL KEYRING_ENCRYPTED_FILE+KILL SERVER=RECOVERY FAILURE --- include/mysql/plugin.h | 5 +++-- sql/sql_plugin.cc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index d6832035e6d6..135c18a9dca1 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -217,6 +217,7 @@ typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *) #define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ #define PLUGIN_VAR_NODEFAULT 0x4000 /* SET DEFAULT is prohibited */ #define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ +#define PLUGIN_VAR_INVISIBLE 0x10000 /* Variable should not be shown */ struct st_mysql_sys_var; struct st_mysql_value; @@ -270,7 +271,7 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd, (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \ PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \ PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC | \ - PLUGIN_VAR_NODEFAULT) + PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_INVISIBLE) #define MYSQL_PLUGIN_VAR_HEADER \ int flags; \ diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 7bc49863995c..6ed656f26ccd 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -281,7 +281,8 @@ class sys_var_pluginvar: public sys_var st_mysql_sys_var *plugin_var_arg) :sys_var(chain, name_arg, plugin_var_arg->comment, (plugin_var_arg->flags & PLUGIN_VAR_THDLOCAL ? SESSION : GLOBAL) | - (plugin_var_arg->flags & PLUGIN_VAR_READONLY ? READONLY : 0), + (plugin_var_arg->flags & PLUGIN_VAR_READONLY ? READONLY : 0) | + (plugin_var_arg->flags & PLUGIN_VAR_INVISIBLE ? INVISIBLE : 0), 0, -1, NO_ARG, pluginvar_show_type(plugin_var_arg), 0, 0, VARIABLE_NOT_IN_BINLOG, (plugin_var_arg->flags & PLUGIN_VAR_NODEFAULT) ? From dc23407a9d4c2159715efe2245e485c25278acd2 Mon Sep 17 00:00:00 2001 From: Daniel Blanchard Date: Fri, 23 Nov 2018 17:28:35 +0000 Subject: [PATCH 107/214] WL#12445 Improve Windows named pipe access control Limit default permissions granted to Everyone on the named pipe, introduce a new system variable/command line option named_pipe_full_access_group defaulted to 'everyone' to allow users of older clients to continue to access the named pipe. RB: rb#21000 --- mysql-test/r/mysqld--help-win.result | 4 + .../perfschema/include/binlog_common.inc | 9 +- .../suite/perfschema/r/binlog_mix.result | 9 +- .../suite/perfschema/r/binlog_row.result | 9 +- .../suite/perfschema/r/binlog_stmt.result | 18 +- .../perfschema/r/dml_setup_instruments.result | 4 +- .../perfschema/t/dml_setup_instruments.test | 4 +- .../named_pipe_full_access_group_basic.result | 17 ++ .../t/named_pipe_full_access_group_basic.test | 15 ++ mysys/my_windac.c | 18 +- sql-common/client.c | 13 +- sql/CMakeLists.txt | 5 + sql/mysqld.cc | 210 ++++++++++------ sql/mysqld.h | 13 +- sql/named_pipe.cc | 238 ++++++++++++++++++ sql/named_pipe.h | 39 +++ sql/sys_vars.cc | 39 ++- vio/viosocket.c | 21 +- 18 files changed, 578 insertions(+), 107 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result create mode 100644 mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test create mode 100644 sql/named_pipe.cc create mode 100644 sql/named_pipe.h diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 1d56da7aa5e6..8682ac919ff2 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -371,6 +371,9 @@ The following options may be given as the first argument: NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables --named-pipe Enable the named pipe (NT) + --named-pipe-full-access-group=name + Name of Windows group granted full access to the named + pipe --net-buffer-length=# Buffer length for TCP/IP and socket communication --net-read-timeout=# @@ -873,6 +876,7 @@ myisam-sort-buffer-size 8388608 myisam-stats-method nulls_unequal myisam-use-mmap FALSE named-pipe FALSE +named-pipe-full-access-group everyone net-buffer-length 16384 net-read-timeout 30 net-retry-count 10 diff --git a/mysql-test/suite/perfschema/include/binlog_common.inc b/mysql-test/suite/perfschema/include/binlog_common.inc index 1c8651a070c3..56f7b8bf3d5a 100644 --- a/mysql-test/suite/perfschema/include/binlog_common.inc +++ b/mysql-test/suite/perfschema/include/binlog_common.inc @@ -10,7 +10,8 @@ select count(*) > 0 from performance_schema.setup_instruments; # to ensure the expected output in the binlog is predictable. update performance_schema.setup_instruments set enabled='NO' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", + "wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); select count(*) > 0 from performance_schema.events_waits_current; @@ -28,14 +29,16 @@ insert into test.t1 insert into test.t2 select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", + "wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); drop table test.t1; drop table test.t2; update performance_schema.setup_instruments set enabled='YES' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", + "wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); --source include/show_binlog_events.inc diff --git a/mysql-test/suite/perfschema/r/binlog_mix.result b/mysql-test/suite/perfschema/r/binlog_mix.result index 3b2ab2bb4357..be15896b478f 100644 --- a/mysql-test/suite/perfschema/r/binlog_mix.result +++ b/mysql-test/suite/perfschema/r/binlog_mix.result @@ -5,7 +5,8 @@ count(*) > 0 1 update performance_schema.setup_instruments set enabled='NO' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); select count(*) > 0 from performance_schema.events_waits_current; count(*) > 0 1 @@ -18,12 +19,14 @@ select thread_id from performance_schema.events_waits_current; insert into test.t2 select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); drop table test.t1; drop table test.t2; update performance_schema.setup_instruments set enabled='YES' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/perfschema/r/binlog_row.result b/mysql-test/suite/perfschema/r/binlog_row.result index 644e5d58e230..d136a053001c 100644 --- a/mysql-test/suite/perfschema/r/binlog_row.result +++ b/mysql-test/suite/perfschema/r/binlog_row.result @@ -5,7 +5,8 @@ count(*) > 0 1 update performance_schema.setup_instruments set enabled='NO' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); select count(*) > 0 from performance_schema.events_waits_current; count(*) > 0 1 @@ -18,12 +19,14 @@ select thread_id from performance_schema.events_waits_current; insert into test.t2 select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); drop table test.t1; drop table test.t2; update performance_schema.setup_instruments set enabled='YES' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/perfschema/r/binlog_stmt.result b/mysql-test/suite/perfschema/r/binlog_stmt.result index 3fcecfdd1ca0..d0c099edae44 100644 --- a/mysql-test/suite/perfschema/r/binlog_stmt.result +++ b/mysql-test/suite/perfschema/r/binlog_stmt.result @@ -6,7 +6,8 @@ count(*) > 0 1 update performance_schema.setup_instruments set enabled='NO' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. select count(*) > 0 from performance_schema.events_waits_current; @@ -23,14 +24,16 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc insert into test.t2 select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. drop table test.t1; drop table test.t2; update performance_schema.setup_instruments set enabled='YES' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group"); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. show binlog events from ; @@ -38,7 +41,8 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='NO' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock") + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group") master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ @@ -52,12 +56,14 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into test.t2 select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock") + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group") master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='YES' where name like "wait/synch/rwlock/sql/%" - and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock") + and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock", +"wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group") master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index fefc4f46061b..369fa389b254 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -16,7 +16,9 @@ wait/synch/mutex/sql/LOCK_crypt YES YES wait/synch/mutex/sql/LOCK_delayed_create YES YES select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') + and name not in ( +'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', +'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') order by name limit 10; NAME ENABLED TIMED wait/synch/rwlock/sql/LOCK_dboptions YES YES diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test index 5582d5596645..8eea8ebcd24f 100644 --- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -25,7 +25,9 @@ select * from performance_schema.setup_instruments select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') + and name not in ( + 'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', + 'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') order by name limit 10; # COND_handler_count is dependent on the build (Windows only) diff --git a/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result new file mode 100644 index 000000000000..925d26bc0afa --- /dev/null +++ b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result @@ -0,0 +1,17 @@ +select @@global.named_pipe_full_access_group; +@@global.named_pipe_full_access_group +everyone +select @@session.named_pipe_full_access_group; +ERROR HY000: Variable 'named_pipe_full_access_group' is a GLOBAL variable +show global variables like 'named_pipe_full_access_group'; +Variable_name Value +named_pipe_full_access_group everyone +show session variables like 'named_pipe_full_access_group'; +Variable_name Value +named_pipe_full_access_group everyone +select * from information_schema.global_variables where variable_name='named_pipe_full_access_group'; +VARIABLE_NAME VARIABLE_VALUE +NAMED_PIPE_FULL_ACCESS_GROUP everyone +select * from information_schema.session_variables where variable_name='named_pipe_full_access_group'; +VARIABLE_NAME VARIABLE_VALUE +NAMED_PIPE_FULL_ACCESS_GROUP everyone diff --git a/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test new file mode 100644 index 000000000000..5964a21e4766 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test @@ -0,0 +1,15 @@ +--source include/windows.inc +--source include/not_embedded.inc +# +# only global +# +select @@global.named_pipe_full_access_group; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.named_pipe_full_access_group; +show global variables like 'named_pipe_full_access_group'; +show session variables like 'named_pipe_full_access_group'; +--disable_warnings +select * from information_schema.global_variables where variable_name='named_pipe_full_access_group'; +select * from information_schema.session_variables where variable_name='named_pipe_full_access_group'; +--enable_warnings + diff --git a/mysys/my_windac.c b/mysys/my_windac.c index 51fe22e8f59b..50fcbfe49efc 100644 --- a/mysys/my_windac.c +++ b/mysys/my_windac.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -214,6 +214,22 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa) { My_security_attr *attr= (My_security_attr*) (((char*)sa) + ALIGN_SIZE(sizeof(*sa))); + + PACL dacl_from_descriptor= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + // If the DACL in the descriptor is not the same as that in the + // My_security_attr, it will have been created by a call to SetEntriesInAcl + // and thus must be freed by a call to LocalFree. + if (GetSecurityDescriptorDacl(sa->lpSecurityDescriptor, + &dacl_present_in_descriptor, + &dacl_from_descriptor, &dacl_defaulted) && + dacl_present_in_descriptor && !dacl_defaulted && + attr->dacl != dacl_from_descriptor) + { + LocalFree(dacl_from_descriptor); + } + FreeSid(attr->everyone_sid); my_free(attr->dacl); my_free(sa); diff --git a/sql-common/client.c b/sql-common/client.c index 7938403db59f..61f782c1d71c 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -429,12 +429,13 @@ HANDLE create_named_pipe(MYSQL *mysql, uint connect_timeout, char **arg_host, for (i=0 ; i < 100 ; i++) /* Don't retry forever */ { if ((hPipe = CreateFile(pipe_name, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL )) != INVALID_HANDLE_VALUE) + FILE_READ_ATTRIBUTES | FILE_READ_DATA | + FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA, + 0, + NULL, + OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, + NULL )) != INVALID_HANDLE_VALUE) break; if (GetLastError() != ERROR_PIPE_BUSY) { diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 044cc8fac785..59621a968278 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -82,6 +82,11 @@ SET (SQL_SOURCE ${CONF_SOURCES} ${MYSYS_LIBWRAP_SOURCE}) +IF(WIN32) + LIST(APPEND SQL_SOURCE named_pipe.cc) +ENDIF() + + # These files have unused result errors, so we skip Werror CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) IF(HAVE_WERROR_FLAG) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fd39e252c266..82d5ffc1a9d8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -302,6 +302,7 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] = #if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) static PSI_thread_key key_thread_handle_con_namedpipes; static PSI_cond_key key_COND_handler_count; +static PSI_rwlock_key key_rwlock_LOCK_named_pipe_full_access_group; #endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ #if defined(HAVE_SMEM) && !defined(EMBEDDED_LIBRARY) @@ -904,10 +905,13 @@ static NTService Service; ///< Service object for WinNT #endif /* __WIN__ */ #ifdef _WIN32 +#include +#include "named_pipe.h" static char pipe_name[512]; -static SECURITY_ATTRIBUTES saPipeSecurity; -static SECURITY_DESCRIPTOR sdPipeDescriptor; +static SECURITY_ATTRIBUTES *psaPipeSecurity; static HANDLE hPipe = INVALID_HANDLE_VALUE; +mysql_rwlock_t LOCK_named_pipe_full_access_group; +char *named_pipe_full_access_group; #endif #ifndef EMBEDDED_LIBRARY @@ -1612,6 +1616,9 @@ static void clean_up_mutexes() mysql_cond_destroy(&COND_thread_cache); mysql_cond_destroy(&COND_flush_thread_cache); mysql_cond_destroy(&COND_manager); +#ifdef _WIN32 + mysql_rwlock_destroy(&LOCK_named_pipe_full_access_group); +#endif } #endif /*EMBEDDED_LIBRARY*/ @@ -1986,45 +1993,17 @@ static void network_init(void) if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap && opt_enable_named_pipe) { - strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\", - mysqld_unix_port, NullS); - bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity)); - bzero((char*) &sdPipeDescriptor, sizeof(sdPipeDescriptor)); - if (!InitializeSecurityDescriptor(&sdPipeDescriptor, - SECURITY_DESCRIPTOR_REVISION)) - { - sql_perror("Can't start server : Initialize security descriptor"); - unireg_abort(1); - } - if (!SetSecurityDescriptorDacl(&sdPipeDescriptor, TRUE, NULL, FALSE)) + hPipe= create_server_named_pipe(&psaPipeSecurity, + global_system_variables.net_buffer_length, + mysqld_unix_port, + pipe_name, + sizeof(pipe_name)-1, + named_pipe_full_access_group); + if (hPipe == INVALID_HANDLE_VALUE) { - sql_perror("Can't start server : Set security descriptor"); + sql_print_error("Can't start server: failed to create named pipe"); unireg_abort(1); } - saPipeSecurity.nLength = sizeof(SECURITY_ATTRIBUTES); - saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor; - saPipeSecurity.bInheritHandle = FALSE; - if ((hPipe= CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables.net_buffer_length, - (int) global_system_variables.net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &saPipeSecurity)) == INVALID_HANDLE_VALUE) - { - LPVOID lpMsgBuf; - int error=GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL ); - sql_perror((char *)lpMsgBuf); - LocalFree(lpMsgBuf); - unireg_abort(1); - } } #endif @@ -4233,6 +4212,8 @@ static void handle_connections_methods() mysql_mutex_lock(&LOCK_thread_count); mysql_cond_init(key_COND_handler_count, &COND_handler_count, NULL); handler_count=0; + mysql_rwlock_init(key_rwlock_LOCK_named_pipe_full_access_group, + &LOCK_named_pipe_full_access_group); if (hPipe != INVALID_HANDLE_VALUE) { handler_count++; @@ -4600,7 +4581,6 @@ int mysqld_main(int argc, char **argv) if (reopen_fstreams(log_error_file, stdout, stderr)) unireg_abort(1); setbuf(stderr, NULL); - FreeConsole(); // Remove window } #endif @@ -5473,6 +5453,7 @@ pthread_handler_t handle_connections_namedpipes(void *arg) HANDLE hConnectedPipe; OVERLAPPED connectOverlapped= {0}; THD *thd; + TCHAR last_error_msg[256]; my_thread_init(); DBUG_ENTER("handle_connections_namedpipes"); connectOverlapped.hEvent= CreateEvent(NULL, TRUE, FALSE, NULL); @@ -5502,41 +5483,53 @@ pthread_handler_t handle_connections_namedpipes(void *arg) if (!fConnected) { CloseHandle(hPipe); - if ((hPipe= CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX | - FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables. - net_buffer_length, - (int) global_system_variables. - net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &saPipeSecurity)) == - INVALID_HANDLE_VALUE) + mysql_rwlock_rdlock(&LOCK_named_pipe_full_access_group); + hPipe= CreateNamedPipe(pipe_name, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, + (int) global_system_variables. + net_buffer_length, + (int) global_system_variables. + net_buffer_length, + NMPWAIT_USE_DEFAULT_WAIT, + psaPipeSecurity); + mysql_rwlock_unlock(&LOCK_named_pipe_full_access_group); + if (hPipe == INVALID_HANDLE_VALUE) { - sql_perror("Can't create new named pipe!"); - break; // Abort + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("Can't create new named pipe: %s", last_error_msg); + break; // Abort } } hConnectedPipe = hPipe; /* create new pipe for new connection */ - if ((hPipe = CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX | - FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables.net_buffer_length, - (int) global_system_variables.net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &saPipeSecurity)) == - INVALID_HANDLE_VALUE) + mysql_rwlock_rdlock(&LOCK_named_pipe_full_access_group); + hPipe= CreateNamedPipe(pipe_name, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + WRITE_DAC, + PIPE_TYPE_BYTE |PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, + (int) global_system_variables.net_buffer_length, + (int) global_system_variables.net_buffer_length, + NMPWAIT_USE_DEFAULT_WAIT, + psaPipeSecurity); + mysql_rwlock_unlock(&LOCK_named_pipe_full_access_group); + if (hPipe == INVALID_HANDLE_VALUE) { - sql_perror("Can't create new named pipe!"); + DWORD last_error_num = GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("Can't create new named pipe: %s", last_error_msg); hPipe=hConnectedPipe; continue; // We have to try again } @@ -7293,6 +7286,16 @@ mysqld_get_one_option(int optid, max_long_data_size_used= true; WARN_DEPRECATED(NULL, 5, 6, "--max_long_data_size", "'--max_allowed_packet'"); break; + case OPT_NAMED_PIPE_FULL_ACCESS_GROUP: +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + if (!is_valid_named_pipe_full_access_group(argument)) + { + sql_print_error("Invalid value for named_pipe_full_access_group."); + return 1; + } +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ + break; + } return 0; } @@ -8234,7 +8237,10 @@ static PSI_rwlock_info all_server_rwlocks[]= { &key_rwlock_LOCK_sys_init_connect, "LOCK_sys_init_connect", PSI_FLAG_GLOBAL}, { &key_rwlock_LOCK_sys_init_slave, "LOCK_sys_init_slave", PSI_FLAG_GLOBAL}, { &key_rwlock_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL}, - { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0} + { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0}, +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + { &key_rwlock_LOCK_named_pipe_full_access_group, "LOCK_named_pipe_full_access_group", PSI_FLAG_GLOBAL}, +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ }; #ifdef HAVE_MMAP @@ -8400,3 +8406,67 @@ void init_server_psi_keys(void) #endif /* HAVE_PSI_INTERFACE */ +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) +// update_named_pipe_full_access_group returns false on success, true on failure +bool update_named_pipe_full_access_group(const char *new_group_name) +{ + SECURITY_ATTRIBUTES *p_new_sa= NULL; + const char *perror= NULL; + TCHAR last_error_msg[256]; + + // Set up security attributes to provide full access to the owner + // and minimal read/write access to others. + if (my_security_attr_create(&p_new_sa, &perror, NAMED_PIPE_OWNER_PERMISSIONS, + NAMED_PIPE_EVERYONE_PERMISSIONS) != 0) + { + sql_print_error("my_security_attr_create: %s", perror); + return true; + } + if (new_group_name && new_group_name[0] != '\0') + { + if (my_security_attr_add_rights_to_group( + p_new_sa, new_group_name, + NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS)) + { + sql_print_error("my_security_attr_add_rights_to_group failed for group: %s", + new_group_name); + return false; + } + } + + psaPipeSecurity= p_new_sa; + + // Set the DACL for the existing "listener" named pipe instance... + if (hPipe != INVALID_HANDLE_VALUE) + { + PACL pdacl= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + if (!GetSecurityDescriptorDacl(p_new_sa->lpSecurityDescriptor, + &dacl_present_in_descriptor, &pdacl, + &dacl_defaulted) || + !dacl_present_in_descriptor) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("GetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + DWORD res= + SetSecurityInfo(hPipe, SE_KERNEL_OBJECT, + DACL_SECURITY_INFORMATION, NULL, NULL, pdacl, NULL); + if (res != ERROR_SUCCESS) + { + char num_buff[20]; + int10_to_str(res, num_buff, 10); + sql_print_error("SetSecurityInfo failed to update DACL on named pipe: %s", num_buff); + return true; + } + } + return false; +} + +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ diff --git a/sql/mysqld.h b/sql/mysqld.h index ee9f8c64840c..245b7a4e713c 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -360,6 +360,10 @@ extern mysql_cond_t COND_thread_count; extern mysql_cond_t COND_manager; extern int32 thread_running; extern my_atomic_rwlock_t thread_running_lock; +#ifdef _WIN32 +extern mysql_rwlock_t LOCK_named_pipe_full_access_group; +extern char *named_pipe_full_access_group; +#endif extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, *opt_ssl_key; @@ -417,7 +421,8 @@ enum options_mysqld OPT_WANT_CORE, OPT_ENGINE_CONDITION_PUSHDOWN, OPT_LOG_ERROR, - OPT_MAX_LONG_DATA_SIZE + OPT_MAX_LONG_DATA_SIZE, + OPT_NAMED_PIPE_FULL_ACCESS_GROUP }; @@ -528,4 +533,8 @@ inline THD *_current_thd(void) #endif #define current_thd _current_thd() +#ifdef _WIN32 +bool update_named_pipe_full_access_group(const char *new_group_name); +#endif + #endif /* MYSQLD_INCLUDED */ diff --git a/sql/named_pipe.cc b/sql/named_pipe.cc new file mode 100644 index 000000000000..3c21d34f1452 --- /dev/null +++ b/sql/named_pipe.cc @@ -0,0 +1,238 @@ +/* Copyright (c) 2018, Oracle and/or its affiliates. All rights + reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + +#include +#include +#include + +#include "my_config.h" +#include "my_sys.h" +#include "mysqld_error.h" +#include "m_string.h" +#include "log.h" +//#include "sql/mysqld.h" +#include "named_pipe.h" + +bool is_existing_windows_group_name(const char *group_name) +{ + // First, let's get a SID for the given group name... + BYTE soughtSID[SECURITY_MAX_SID_SIZE]= {0}; + DWORD size_sid= SECURITY_MAX_SID_SIZE; + char referencedDomainName[MAX_PATH]; + DWORD size_referencedDomainName= MAX_PATH; + SID_NAME_USE sid_name_use; + + if (!LookupAccountName(NULL, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + return false; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + return false; + } + return true; +} + +bool is_valid_named_pipe_full_access_group(const char *group_name) +{ + if (!group_name || group_name[0] == '\0' || + is_existing_windows_group_name(group_name)) + { + return true; + } + else + { + return false; + } +} + +// return false on success, true on failure. +bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, + const char *group_name, + DWORD group_rights) +{ + TCHAR last_error_msg[256]; + // First, let's get a SID for the given group name... + BYTE soughtSID[SECURITY_MAX_SID_SIZE]= {0}; + DWORD size_sid= SECURITY_MAX_SID_SIZE; + char referencedDomainName[MAX_PATH]; + DWORD size_referencedDomainName= MAX_PATH; + SID_NAME_USE sid_name_use; + + if (!LookupAccountName(NULL, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("my_security_attr_add_rights_to_group, LookupAccountName failed: %s", + last_error_msg); + return true; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + sql_print_error("LookupAccountName failed: unexpected sid_name_use"); + return true; + } + + PACL pNewDACL= NULL; + PACL pOldDACL= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + if (!GetSecurityDescriptorDacl(psa->lpSecurityDescriptor, + &dacl_present_in_descriptor, &pOldDACL, + &dacl_defaulted) || + !dacl_present_in_descriptor) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("GetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + + // Just because GetSecurityDescriptorDacl succeeded doesn't mean we're out of + // the woods: a NULL value for pOldDACL is a bad/unexpected thing, as is + // dacl_defaulted == TRUE + if (pOldDACL == NULL || dacl_defaulted) + { + sql_print_error("Invalid DACL on named pipe: %s", + (pOldDACL == NULL) ? "NULL DACL" : "Defaulted DACL"); + return true; + } + + EXPLICIT_ACCESS ea; + // Initialize an EXPLICIT_ACCESS structure for the new ACE. + + ZeroMemory(&ea, sizeof(EXPLICIT_ACCESS)); + ea.grfAccessPermissions= group_rights; + ea.grfAccessMode= SET_ACCESS; + ea.grfInheritance= NO_INHERITANCE; + ea.Trustee.TrusteeForm= TRUSTEE_IS_SID; + ea.Trustee.ptstrName= (LPSTR)soughtSID; + + // Create a new ACL that merges the new ACE + // into the existing DACL. + DWORD dwRes= SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); + if (ERROR_SUCCESS != dwRes) + { + char num_buff[20]; + int10_to_str(dwRes, num_buff, 10); + sql_print_error("SetEntriesInAcl to add group permissions failed: %s", num_buff); + return true; + } + + // Apply the new DACL to the existing security descriptor... + if (!SetSecurityDescriptorDacl(psa->lpSecurityDescriptor, TRUE, pNewDACL, + FALSE)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("SetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + + return false; +} + +/** + Creates an instance of a named pipe and returns a handle. + + @param sec_attr Security attributes for the pipe. + @param buffer_size Number of bytes to reserve for input and output buffers. + @param name The name of the pipe. + @param name_buf Output argument: null-terminated concatenation of + "\\.\pipe\" and name. + @param buflen The size of name_buff. + + @returns Pipe handle, or INVALID_HANDLE_VALUE in case of error. + + @note The entire pipe name string can be up to 256 characters long. + Pipe names are not case sensitive. + */ +HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr, + DWORD buffer_size, const char *name, + char *name_buf, size_t buflen, + const char *full_access_group_name) +{ + HANDLE ret_handle= INVALID_HANDLE_VALUE; + TCHAR last_error_msg[256]; + + strxnmov(name_buf, buflen - 1, "\\\\.\\pipe\\", name, NullS); + const char *perror= NULL; + // Set up security for the named pipe to provide full access to the owner + // and minimal read/write access to others. + if (my_security_attr_create(ppsec_attr, &perror, NAMED_PIPE_OWNER_PERMISSIONS, + NAMED_PIPE_EVERYONE_PERMISSIONS) != 0) + { + sql_print_error("my_security_attr_create failed: %s", perror); + return ret_handle; + } + + if (full_access_group_name && full_access_group_name[0] != '\0') + { + if (my_security_attr_add_rights_to_group( + *ppsec_attr, full_access_group_name, + NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS)) + { + return ret_handle; + } + } + + ret_handle= CreateNamedPipe( + name_buf, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, + buffer_size, buffer_size, NMPWAIT_USE_DEFAULT_WAIT, *ppsec_attr); + + if (ret_handle == INVALID_HANDLE_VALUE) + { + DWORD last_error_num= GetLastError(); + + if (last_error_num == ERROR_ACCESS_DENIED) + { + sql_print_error("Can't start server : Named Pipe \"%s\" already in use.", name); + } + else + { + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + char num_buff[20]; + int10_to_str(last_error_num, num_buff, 10); + sql_print_error("Can't start server : %s %s", last_error_msg, num_buff); + } + } + + return ret_handle; +} diff --git a/sql/named_pipe.h b/sql/named_pipe.h new file mode 100644 index 000000000000..3d2545b022fd --- /dev/null +++ b/sql/named_pipe.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2018, Oracle and/or its affiliates. All rights + reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + +#ifndef NAMED_PIPE_INCLUDED +#define NAMED_PIPE_INCLUDED + +#include + +const DWORD NAMED_PIPE_OWNER_PERMISSIONS= GENERIC_READ | GENERIC_WRITE; +const DWORD NAMED_PIPE_EVERYONE_PERMISSIONS= + FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_WRITE_ATTRIBUTES | + FILE_WRITE_DATA | SYNCHRONIZE | READ_CONTROL; +const DWORD NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS = + GENERIC_READ | GENERIC_WRITE; + +HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr, + DWORD buffer_size, const char *name, + char *name_buf, size_t buflen, + const char *full_access_group_name = NULL); + +bool is_valid_named_pipe_full_access_group(const char *group_name); +bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, + const char *group_name, + DWORD group_rights); +#define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP "everyone" +#endif /* NAMED_PIPE_INCLUDED */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 6fd728d638de..9a461f4629e0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,6 +46,10 @@ #include "sql_base.h" // close_cached_tables #include "log_event.h" +#ifdef _WIN32 +#include "named_pipe.h" +#endif + #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ @@ -1377,7 +1381,38 @@ static Sys_var_mybool Sys_named_pipe( "named_pipe", "Enable the named pipe (NT)", READ_ONLY GLOBAL_VAR(opt_enable_named_pipe), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -#endif +#ifndef EMBEDDED_LIBRARY +static PolyLock_rwlock PLock_named_pipe_full_access_group( + &LOCK_named_pipe_full_access_group); +static bool check_named_pipe_full_access_group(sys_var *self, THD *thd, + set_var *var) +{ + if (!var->value) return false; // DEFAULT is ok + + if (!is_valid_named_pipe_full_access_group( + var->save_result.string_value.str)) + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), self->name.str, + var->save_result.string_value.str); + return true; + } + return false; +} +static bool fix_named_pipe_full_access_group(sys_var *, THD *, enum_var_type) +{ + return update_named_pipe_full_access_group(named_pipe_full_access_group); +} +static Sys_var_charptr Sys_named_pipe_full_access_group( + "named_pipe_full_access_group", + "Name of Windows group granted full access to the named pipe", + GLOBAL_VAR(named_pipe_full_access_group), + CMD_LINE(REQUIRED_ARG, OPT_NAMED_PIPE_FULL_ACCESS_GROUP), IN_FS_CHARSET, + DEFAULT(DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP), + &PLock_named_pipe_full_access_group, NOT_IN_BINLOG, + ON_CHECK(check_named_pipe_full_access_group), + ON_UPDATE(fix_named_pipe_full_access_group)); +#endif /* EMBEDDED_LIBRARY */ +#endif /* _WIN32 */ static bool diff --git a/vio/viosocket.c b/vio/viosocket.c index 56aa84df5fc8..f5f223280345 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -860,17 +860,20 @@ my_bool vio_is_connected_pipe(Vio *vio) int vio_close_pipe(Vio * vio) { - int r; + int r= FALSE; DBUG_ENTER("vio_close_pipe"); - CancelIo(vio->hPipe); - CloseHandle(vio->pipe_overlapped.hEvent); - DisconnectNamedPipe(vio->hPipe); - r= CloseHandle(vio->hPipe); - if (r) + if (vio->type != VIO_CLOSED) { - DBUG_PRINT("vio_error", ("close() failed, error: %d",GetLastError())); - /* FIXME: error handling (not critical for MySQL) */ + CancelIo(vio->hPipe); + CloseHandle(vio->pipe_overlapped.hEvent); + DisconnectNamedPipe(vio->hPipe); + r= CloseHandle(vio->hPipe); + if (!r) + { + DBUG_PRINT("vio_error", ("close() failed, error: %d",GetLastError())); + /* FIXME: error handling (not critical for MySQL) */ + } } vio->type= VIO_CLOSED; vio->sd= -1; From ba2f4d0b0b3ea9fb655cd747463fa65ea3867ede Mon Sep 17 00:00:00 2001 From: Daniel Blanchard Date: Fri, 23 Nov 2018 18:01:59 +0000 Subject: [PATCH 108/214] WL#12445 Improve Windows named pipe access control Limit default permissions granted to Everyone on the named pipe, introduce a new system variable/command line option named_pipe_full_access_group defaulted to 'everyone' to allow users of older clients to continue to access the named pipe. RB: rb#21002 --- mysql-test/r/mysqld--help-win.result | 4 + .../perfschema/r/dml_setup_instruments.result | 4 +- .../perfschema/t/dml_setup_instruments.test | 5 +- .../named_pipe_full_access_group_basic.result | 17 ++ .../t/named_pipe_full_access_group_basic.test | 15 ++ mysys/my_windac.c | 16 +- sql-common/client.c | 3 +- sql/CMakeLists.txt | 4 + sql/mysqld.cc | 209 +++++++++------ sql/mysqld.h | 13 +- sql/named_pipe.cc | 238 ++++++++++++++++++ sql/named_pipe.h | 39 +++ sql/sys_vars.cc | 36 ++- vio/viopipe.c | 16 +- 14 files changed, 535 insertions(+), 84 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result create mode 100644 mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test create mode 100644 sql/named_pipe.cc create mode 100644 sql/named_pipe.h diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index cc59074b4a23..0057094f28fc 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -487,6 +487,9 @@ The following options may be given as the first argument: NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables --named-pipe Enable the named pipe (NT) + --named-pipe-full-access-group=name + Name of Windows group granted full access to the named + pipe --net-buffer-length=# Buffer length for TCP/IP and socket communication --net-read-timeout=# @@ -1184,6 +1187,7 @@ myisam-sort-buffer-size 8388608 myisam-stats-method nulls_unequal myisam-use-mmap FALSE named-pipe FALSE +named-pipe-full-access-group everyone net-buffer-length 16384 net-read-timeout 30 net-retry-count 10 diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index 310ff60aa5b0..7bc7ca785d66 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -16,7 +16,9 @@ wait/synch/mutex/sql/LOCK_crypt YES YES wait/synch/mutex/sql/LOCK_delayed_create YES YES select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') + and name not in ( +'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', +'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') order by name limit 10; NAME ENABLED TIMED wait/synch/rwlock/sql/Binlog_relay_IO_delegate::lock YES YES diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test index 8a4f11ba51f8..18c260e15553 100644 --- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -22,10 +22,13 @@ select * from performance_schema.setup_instruments order by name limit 10; # CRYPTO_dynlock_value::lock is dependent on the build (SSL) +# LOCK_named_pipe_full_access_group is dependent on the build (Windows) select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') + and name not in ( + 'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', + 'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') order by name limit 10; # COND_handler_count is dependent on the build (Windows only) diff --git a/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result new file mode 100644 index 000000000000..925d26bc0afa --- /dev/null +++ b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result @@ -0,0 +1,17 @@ +select @@global.named_pipe_full_access_group; +@@global.named_pipe_full_access_group +everyone +select @@session.named_pipe_full_access_group; +ERROR HY000: Variable 'named_pipe_full_access_group' is a GLOBAL variable +show global variables like 'named_pipe_full_access_group'; +Variable_name Value +named_pipe_full_access_group everyone +show session variables like 'named_pipe_full_access_group'; +Variable_name Value +named_pipe_full_access_group everyone +select * from information_schema.global_variables where variable_name='named_pipe_full_access_group'; +VARIABLE_NAME VARIABLE_VALUE +NAMED_PIPE_FULL_ACCESS_GROUP everyone +select * from information_schema.session_variables where variable_name='named_pipe_full_access_group'; +VARIABLE_NAME VARIABLE_VALUE +NAMED_PIPE_FULL_ACCESS_GROUP everyone diff --git a/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test new file mode 100644 index 000000000000..5964a21e4766 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test @@ -0,0 +1,15 @@ +--source include/windows.inc +--source include/not_embedded.inc +# +# only global +# +select @@global.named_pipe_full_access_group; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.named_pipe_full_access_group; +show global variables like 'named_pipe_full_access_group'; +show session variables like 'named_pipe_full_access_group'; +--disable_warnings +select * from information_schema.global_variables where variable_name='named_pipe_full_access_group'; +select * from information_schema.session_variables where variable_name='named_pipe_full_access_group'; +--enable_warnings + diff --git a/mysys/my_windac.c b/mysys/my_windac.c index 49ee60a49a84..b2936a8bc1b0 100644 --- a/mysys/my_windac.c +++ b/mysys/my_windac.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -214,6 +214,20 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa) { My_security_attr *attr= (My_security_attr*) (((char*)sa) + ALIGN_SIZE(sizeof(*sa))); + PACL dacl_from_descriptor= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + // If the DACL in the descriptor is not the same as that in the + // My_security_attr, it will have been created by a call to SetEntriesInAcl + // and thus must be freed by a call to LocalFree. + if (GetSecurityDescriptorDacl(sa->lpSecurityDescriptor, + &dacl_present_in_descriptor, + &dacl_from_descriptor, &dacl_defaulted) && + dacl_present_in_descriptor && !dacl_defaulted && + attr->dacl != dacl_from_descriptor) { + LocalFree(dacl_from_descriptor); + } + FreeSid(attr->everyone_sid); my_free(attr->dacl); my_free(sa); diff --git a/sql-common/client.c b/sql-common/client.c index 010911ccbc30..102b1dc9652b 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -317,7 +317,8 @@ static HANDLE create_named_pipe(MYSQL *mysql, DWORD connect_timeout, for (i=0 ; i < 100 ; i++) /* Don't retry forever */ { if ((hPipe = CreateFile(pipe_name, - GENERIC_READ | GENERIC_WRITE, + FILE_READ_ATTRIBUTES | FILE_READ_DATA | + FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA, 0, NULL, OPEN_EXISTING, diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index d49195b2c4fc..2d48bc8e6fde 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -215,6 +215,10 @@ SET(SQL_SOURCE sql_client.cc ) +IF(WIN32) + LIST(APPEND SQL_SOURCE named_pipe.cc) +ENDIF() + IF (WIN32 AND OPENSSL_APPLINK_C) SET_SOURCE_FILES_PROPERTIES( ../sql-common/client_authentication.cc diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ab0a15f7dcbf..403899d99c86 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -330,6 +330,7 @@ arg_cmp_func Arg_comparator::comparator_matrix[5][2] = #if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) static PSI_thread_key key_thread_handle_con_namedpipes; static PSI_cond_key key_COND_handler_count; +static PSI_rwlock_key key_rwlock_LOCK_named_pipe_full_access_group; #endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ #if defined(HAVE_SMEM) && !defined(EMBEDDED_LIBRARY) @@ -1208,9 +1209,14 @@ static NTService Service; ///< Service object for WinNT #ifdef _WIN32 static char pipe_name[512]; +#include +#include "named_pipe.h" static SECURITY_ATTRIBUTES saPipeSecurity; static SECURITY_DESCRIPTOR sdPipeDescriptor; +static SECURITY_ATTRIBUTES *psaPipeSecurity; static HANDLE hPipe = INVALID_HANDLE_VALUE; +mysql_rwlock_t LOCK_named_pipe_full_access_group; +char *named_pipe_full_access_group; #endif #ifndef EMBEDDED_LIBRARY @@ -2038,6 +2044,9 @@ static void clean_up_mutexes() mysql_cond_destroy(&COND_flush_thread_cache); mysql_cond_destroy(&COND_manager); mysql_cond_destroy(&COND_connection_count); +#ifdef _WIN32 + mysql_rwlock_destroy(&LOCK_named_pipe_full_access_group); +#endif } #endif /*EMBEDDED_LIBRARY*/ @@ -2493,45 +2502,17 @@ static void network_init(void) if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap && opt_enable_named_pipe) { - strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\", - mysqld_unix_port, NullS); - memset(&saPipeSecurity, 0, sizeof(saPipeSecurity)); - memset(&sdPipeDescriptor, 0, sizeof(sdPipeDescriptor)); - if (!InitializeSecurityDescriptor(&sdPipeDescriptor, - SECURITY_DESCRIPTOR_REVISION)) + hPipe= create_server_named_pipe(&psaPipeSecurity, + global_system_variables.net_buffer_length, + mysqld_unix_port, + pipe_name, + sizeof(pipe_name)-1, + named_pipe_full_access_group); + if (hPipe == INVALID_HANDLE_VALUE) { - sql_perror("Can't start server : Initialize security descriptor"); + sql_print_error("Can't start server: failed to create named pipe"); unireg_abort(1); } - if (!SetSecurityDescriptorDacl(&sdPipeDescriptor, TRUE, NULL, FALSE)) - { - sql_perror("Can't start server : Set security descriptor"); - unireg_abort(1); - } - saPipeSecurity.nLength = sizeof(SECURITY_ATTRIBUTES); - saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor; - saPipeSecurity.bInheritHandle = FALSE; - if ((hPipe= CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables.net_buffer_length, - (int) global_system_variables.net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &saPipeSecurity)) == INVALID_HANDLE_VALUE) - { - LPVOID lpMsgBuf; - int error=GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL ); - sql_perror((char *)lpMsgBuf); - LocalFree(lpMsgBuf); - unireg_abort(1); - } } #endif @@ -5147,6 +5128,8 @@ static void handle_connections_methods() mysql_mutex_lock(&LOCK_thread_count); mysql_cond_init(key_COND_handler_count, &COND_handler_count, NULL); handler_count=0; + mysql_rwlock_init(key_rwlock_LOCK_named_pipe_full_access_group, + &LOCK_named_pipe_full_access_group); if (hPipe != INVALID_HANDLE_VALUE) { handler_count++; @@ -5586,7 +5569,6 @@ int mysqld_main(int argc, char **argv) if (reopen_fstreams(log_error_file, stdout, stderr)) unireg_abort(1); setbuf(stderr, NULL); - FreeConsole(); // Remove window } #endif @@ -6518,6 +6500,7 @@ pthread_handler_t handle_connections_namedpipes(void *arg) HANDLE hConnectedPipe; OVERLAPPED connectOverlapped= {0}; THD *thd; + TCHAR last_error_msg[256]; my_thread_init(); DBUG_ENTER("handle_connections_namedpipes"); connectOverlapped.hEvent= CreateEvent(NULL, TRUE, FALSE, NULL); @@ -6547,43 +6530,53 @@ pthread_handler_t handle_connections_namedpipes(void *arg) if (!fConnected) { CloseHandle(hPipe); - if ((hPipe= CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX | - FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables. - net_buffer_length, - (int) global_system_variables. - net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &saPipeSecurity)) == - INVALID_HANDLE_VALUE) + mysql_rwlock_rdlock(&LOCK_named_pipe_full_access_group); + hPipe= CreateNamedPipe(pipe_name, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, + (int) global_system_variables.net_buffer_length, + (int) global_system_variables.net_buffer_length, + NMPWAIT_USE_DEFAULT_WAIT, + psaPipeSecurity); + mysql_rwlock_unlock(&LOCK_named_pipe_full_access_group); + if (hPipe == INVALID_HANDLE_VALUE) { - sql_perror("Can't create new named pipe!"); - break; // Abort + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("Can't create new named pipe: %s", last_error_msg); + break; // Abort } } hConnectedPipe = hPipe; /* create new pipe for new connection */ - if ((hPipe = CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX | - FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables.net_buffer_length, - (int) global_system_variables.net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &saPipeSecurity)) == - INVALID_HANDLE_VALUE) - { - sql_perror("Can't create new named pipe!"); + mysql_rwlock_rdlock(&LOCK_named_pipe_full_access_group); + hPipe= CreateNamedPipe(pipe_name, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + WRITE_DAC, + PIPE_TYPE_BYTE |PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, + (int) global_system_variables.net_buffer_length, + (int) global_system_variables.net_buffer_length, + NMPWAIT_USE_DEFAULT_WAIT, + psaPipeSecurity); + mysql_rwlock_unlock(&LOCK_named_pipe_full_access_group); + if (hPipe == INVALID_HANDLE_VALUE) + { + DWORD last_error_num = GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("Can't create new named pipe: %s", last_error_msg); hPipe=hConnectedPipe; - continue; // We have to try again + continue; // We have to try again } if (!(thd = new THD)) @@ -8824,6 +8817,15 @@ mysqld_get_one_option(int optid, case OPT_SHOW_OLD_TEMPORALS: WARN_DEPRECATED_NO_REPLACEMENT(NULL, "show_old_temporals"); break; + case OPT_NAMED_PIPE_FULL_ACCESS_GROUP: +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + if (!is_valid_named_pipe_full_access_group(argument)) + { + sql_print_error("Invalid value for named_pipe_full_access_group."); + return 1; + } +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ + break; } return 0; } @@ -9852,7 +9854,10 @@ static PSI_rwlock_info all_server_rwlocks[]= { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0}, { &key_rwlock_global_sid_lock, "gtid_commit_rollback", PSI_FLAG_GLOBAL}, { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL}, - { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL} + { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL}, +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + { &key_rwlock_LOCK_named_pipe_full_access_group, "LOCK_named_pipe_full_access_group", PSI_FLAG_GLOBAL}, +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ }; #ifdef HAVE_MMAP @@ -10302,3 +10307,67 @@ void init_server_psi_keys(void) #endif /* HAVE_PSI_INTERFACE */ +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) +// update_named_pipe_full_access_group returns false on success, true on failure +bool update_named_pipe_full_access_group(const char *new_group_name) +{ + SECURITY_ATTRIBUTES *p_new_sa= NULL; + const char *perror= NULL; + TCHAR last_error_msg[256]; + + // Set up security attributes to provide full access to the owner + // and minimal read/write access to others. + if (my_security_attr_create(&p_new_sa, &perror, NAMED_PIPE_OWNER_PERMISSIONS, + NAMED_PIPE_EVERYONE_PERMISSIONS) != 0) + { + sql_print_error("my_security_attr_create: %s", perror); + return true; + } + if (new_group_name && new_group_name[0] != '\0') + { + if (my_security_attr_add_rights_to_group( + p_new_sa, new_group_name, + NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS)) + { + sql_print_error("my_security_attr_add_rights_to_group failed for group: %s", + new_group_name); + return false; + } + } + + psaPipeSecurity= p_new_sa; + + // Set the DACL for the existing "listener" named pipe instance... + if (hPipe != INVALID_HANDLE_VALUE) + { + PACL pdacl= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + if (!GetSecurityDescriptorDacl(p_new_sa->lpSecurityDescriptor, + &dacl_present_in_descriptor, &pdacl, + &dacl_defaulted) || + !dacl_present_in_descriptor) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("GetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + DWORD res = + SetSecurityInfo(hPipe, SE_KERNEL_OBJECT, + DACL_SECURITY_INFORMATION, NULL, NULL, pdacl, NULL); + if (res != ERROR_SUCCESS) + { + char num_buff[20]; + int10_to_str(res, num_buff, 10); + sql_print_error("SetSecurityInfo failed to update DACL on named pipe: %s", num_buff); + return true; + } + } + return false; +} + +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ diff --git a/sql/mysqld.h b/sql/mysqld.h index c430cacc7aa0..aab3e83b86c8 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -603,6 +603,10 @@ extern int32 thread_running; extern my_atomic_rwlock_t thread_running_lock; extern my_atomic_rwlock_t slave_open_temp_tables_lock; extern my_atomic_rwlock_t opt_binlog_max_flush_queue_time_lock; +#ifdef _WIN32 +extern mysql_rwlock_t LOCK_named_pipe_full_access_group; +extern char *named_pipe_full_access_group; +#endif extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, *opt_ssl_key, *opt_ssl_crl, *opt_ssl_crlpath; @@ -676,7 +680,8 @@ enum options_mysqld OPT_HOST_CACHE_SIZE, OPT_TABLE_DEFINITION_CACHE, OPT_AVOID_TEMPORAL_UPGRADE, - OPT_SHOW_OLD_TEMPORALS + OPT_SHOW_OLD_TEMPORALS, + OPT_NAMED_PIPE_FULL_ACCESS_GROUP }; @@ -780,4 +785,8 @@ inline THD *_current_thd(void) extern const char *MY_BIND_ALL_ADDRESSES; +#ifdef _WIN32 +bool update_named_pipe_full_access_group(const char *new_group_name); +#endif + #endif /* MYSQLD_INCLUDED */ diff --git a/sql/named_pipe.cc b/sql/named_pipe.cc new file mode 100644 index 000000000000..1eefeb6ea1cb --- /dev/null +++ b/sql/named_pipe.cc @@ -0,0 +1,238 @@ +/* Copyright (c) 2018, Oracle and/or its affiliates. All rights + reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include +#include + +#include "my_config.h" +#include "my_sys.h" +#include "mysqld_error.h" +#include "m_string.h" +#include "log.h" +//#include "sql/mysqld.h" +#include "named_pipe.h" + +bool is_existing_windows_group_name(const char *group_name) +{ + // First, let's get a SID for the given group name... + BYTE soughtSID[SECURITY_MAX_SID_SIZE]= {0}; + DWORD size_sid= SECURITY_MAX_SID_SIZE; + char referencedDomainName[MAX_PATH]; + DWORD size_referencedDomainName= MAX_PATH; + SID_NAME_USE sid_name_use; + + if (!LookupAccountName(NULL, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + return false; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + return false; + } + return true; +} + +bool is_valid_named_pipe_full_access_group(const char *group_name) +{ + if (!group_name || group_name[0] == '\0' || + is_existing_windows_group_name(group_name)) + { + return true; + } + else + { + return false; + } +} + +// return false on success, true on failure. +bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, + const char *group_name, + DWORD group_rights) +{ + TCHAR last_error_msg[256]; + // First, let's get a SID for the given group name... + BYTE soughtSID[SECURITY_MAX_SID_SIZE]= {0}; + DWORD size_sid= SECURITY_MAX_SID_SIZE; + char referencedDomainName[MAX_PATH]; + DWORD size_referencedDomainName= MAX_PATH; + SID_NAME_USE sid_name_use; + + if (!LookupAccountName(NULL, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("my_security_attr_add_rights_to_group, LookupAccountName failed: %s", + last_error_msg); + return true; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + sql_print_error("LookupAccountName failed: unexpected sid_name_use"); + return true; + } + + PACL pNewDACL= NULL; + PACL pOldDACL= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + if (!GetSecurityDescriptorDacl(psa->lpSecurityDescriptor, + &dacl_present_in_descriptor, &pOldDACL, + &dacl_defaulted) || + !dacl_present_in_descriptor) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("GetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + + // Just because GetSecurityDescriptorDacl succeeded doesn't mean we're out of + // the woods: a NULL value for pOldDACL is a bad/unexpected thing, as is + // dacl_defaulted == TRUE + if (pOldDACL == NULL || dacl_defaulted) + { + sql_print_error("Invalid DACL on named pipe: %s", + (pOldDACL == NULL) ? "NULL DACL" : "Defaulted DACL"); + return true; + } + + EXPLICIT_ACCESS ea; + // Initialize an EXPLICIT_ACCESS structure for the new ACE. + + ZeroMemory(&ea, sizeof(EXPLICIT_ACCESS)); + ea.grfAccessPermissions= group_rights; + ea.grfAccessMode= SET_ACCESS; + ea.grfInheritance= NO_INHERITANCE; + ea.Trustee.TrusteeForm= TRUSTEE_IS_SID; + ea.Trustee.ptstrName= (LPSTR)soughtSID; + + // Create a new ACL that merges the new ACE + // into the existing DACL. + DWORD dwRes= SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); + if (ERROR_SUCCESS != dwRes) + { + char num_buff[20]; + int10_to_str(dwRes, num_buff, 10); + sql_print_error("SetEntriesInAcl to add group permissions failed: %s", num_buff); + return true; + } + + // Apply the new DACL to the existing security descriptor... + if (!SetSecurityDescriptorDacl(psa->lpSecurityDescriptor, TRUE, pNewDACL, + FALSE)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("SetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + + return false; +} + +/** + Creates an instance of a named pipe and returns a handle. + + @param sec_attr Security attributes for the pipe. + @param buffer_size Number of bytes to reserve for input and output buffers. + @param name The name of the pipe. + @param name_buf Output argument: null-terminated concatenation of + "\\.\pipe\" and name. + @param buflen The size of name_buff. + + @returns Pipe handle, or INVALID_HANDLE_VALUE in case of error. + + @note The entire pipe name string can be up to 256 characters long. + Pipe names are not case sensitive. + */ +HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr, + DWORD buffer_size, const char *name, + char *name_buf, size_t buflen, + const char *full_access_group_name) +{ + HANDLE ret_handle= INVALID_HANDLE_VALUE; + TCHAR last_error_msg[256]; + + strxnmov(name_buf, buflen - 1, "\\\\.\\pipe\\", name, NullS); + const char *perror= NULL; + // Set up security for the named pipe to provide full access to the owner + // and minimal read/write access to others. + if (my_security_attr_create(ppsec_attr, &perror, NAMED_PIPE_OWNER_PERMISSIONS, + NAMED_PIPE_EVERYONE_PERMISSIONS) != 0) + { + sql_print_error("my_security_attr_create failed: %s", perror); + return ret_handle; + } + + if (full_access_group_name && full_access_group_name[0] != '\0') + { + if (my_security_attr_add_rights_to_group( + *ppsec_attr, full_access_group_name, + NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS)) + { + return ret_handle; + } + } + + ret_handle= CreateNamedPipe( + name_buf, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, + buffer_size, buffer_size, NMPWAIT_USE_DEFAULT_WAIT, *ppsec_attr); + + if (ret_handle == INVALID_HANDLE_VALUE) + { + DWORD last_error_num= GetLastError(); + + if (last_error_num == ERROR_ACCESS_DENIED) + { + sql_print_error("Can't start server : Named Pipe \"%s\" already in use.", name); + } + else + { + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + char num_buff[20]; + int10_to_str(last_error_num, num_buff, 10); + sql_print_error("Can't start server : %s %s", last_error_msg, num_buff); + } + } + + return ret_handle; +} diff --git a/sql/named_pipe.h b/sql/named_pipe.h new file mode 100644 index 000000000000..5ba826a244b2 --- /dev/null +++ b/sql/named_pipe.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2018, Oracle and/or its affiliates. All rights + reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef NAMED_PIPE_INCLUDED +#define NAMED_PIPE_INCLUDED + +#include + +const DWORD NAMED_PIPE_OWNER_PERMISSIONS= GENERIC_READ | GENERIC_WRITE; +const DWORD NAMED_PIPE_EVERYONE_PERMISSIONS= + FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_WRITE_ATTRIBUTES | + FILE_WRITE_DATA | SYNCHRONIZE | READ_CONTROL; +const DWORD NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS= + GENERIC_READ | GENERIC_WRITE; + +HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr, + DWORD buffer_size, const char *name, + char *name_buf, size_t buflen, + const char *full_access_group_name = NULL); + +bool is_valid_named_pipe_full_access_group(const char *group_name); +bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, + const char *group_name, + DWORD group_rights); +#define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP "everyone" +#endif /* NAMED_PIPE_INCLUDED */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 88cf3b2e3e61..848d9877f8cf 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -61,6 +61,9 @@ #include "my_aes.h" // my_aes_opmode_names #include "log_event.h" +#ifdef _WIN32 +#include "named_pipe.h" +#endif #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ @@ -1963,6 +1966,37 @@ static Sys_var_mybool Sys_named_pipe( "named_pipe", "Enable the named pipe (NT)", READ_ONLY GLOBAL_VAR(opt_enable_named_pipe), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); +#ifndef EMBEDDED_LIBRARY +static PolyLock_rwlock PLock_named_pipe_full_access_group( + &LOCK_named_pipe_full_access_group); +static bool check_named_pipe_full_access_group(sys_var *self, THD *thd, + set_var *var) +{ + if (!var->value) return false; // DEFAULT is ok + + if (!is_valid_named_pipe_full_access_group( + var->save_result.string_value.str)) + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), self->name.str, + var->save_result.string_value.str); + return true; + } + return false; +} +static bool fix_named_pipe_full_access_group(sys_var *, THD *, enum_var_type) +{ + return update_named_pipe_full_access_group(named_pipe_full_access_group); +} +static Sys_var_charptr Sys_named_pipe_full_access_group( + "named_pipe_full_access_group", + "Name of Windows group granted full access to the named pipe", + GLOBAL_VAR(named_pipe_full_access_group), + CMD_LINE(REQUIRED_ARG, OPT_NAMED_PIPE_FULL_ACCESS_GROUP), IN_FS_CHARSET, + DEFAULT(DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP), + &PLock_named_pipe_full_access_group, NOT_IN_BINLOG, + ON_CHECK(check_named_pipe_full_access_group), + ON_UPDATE(fix_named_pipe_full_access_group)); +#endif /* EMBEDDED_LIBRARY */ #endif diff --git a/vio/viopipe.c b/vio/viopipe.c index ad94814023b6..079020b6194d 100644 --- a/vio/viopipe.c +++ b/vio/viopipe.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,14 +103,16 @@ my_bool vio_is_connected_pipe(Vio *vio) int vio_shutdown_pipe(Vio *vio) { - BOOL ret; + BOOL ret= FALSE; DBUG_ENTER("vio_shutdown_pipe"); - CancelIo(vio->hPipe); - CloseHandle(vio->overlapped.hEvent); - DisconnectNamedPipe(vio->hPipe); - ret= CloseHandle(vio->hPipe); - + if (vio->inactive == FALSE) + { + CancelIo(vio->hPipe); + CloseHandle(vio->overlapped.hEvent); + DisconnectNamedPipe(vio->hPipe); + ret= CloseHandle(vio->hPipe); + } vio->inactive= TRUE; vio->hPipe= NULL; vio->mysql_socket= MYSQL_INVALID_SOCKET; From 9fe1b6222932764ce0872a23e7877d4b6cec63ba Mon Sep 17 00:00:00 2001 From: Daniel Blanchard Date: Fri, 23 Nov 2018 18:09:39 +0000 Subject: [PATCH 109/214] WL#12445 Improve Windows named pipe access control Limit default permissions granted to Everyone on the named pipe, introduce a new system variable/command line option named_pipe_full_access_group defaulted to 'everyone' to allow users of older clients to continue to access the named pipe. RB: rb#21003 --- mysql-test/r/mysqld--help-win.result | 4 + .../perfschema/r/dml_setup_instruments.result | 4 +- .../perfschema/t/dml_setup_instruments.test | 4 +- .../suite/perfschema/t/show_sanity.test | 1 + .../named_pipe_full_access_group_basic.result | 17 ++ .../t/named_pipe_full_access_group_basic.test | 14 + mysys/my_windac.c | 17 +- sql-common/client.c | 12 +- sql/conn_handler/named_pipe_connection.cc | 161 +++++++--- sql/conn_handler/named_pipe_connection.h | 17 +- sql/mysqld.cc | 38 ++- sql/mysqld.h | 11 +- sql/named_pipe.cc | 280 +++++++++++++----- sql/named_pipe.h | 53 ++-- sql/sys_vars.cc | 37 ++- unittest/gunit/win_tests-t.cc | 14 +- vio/viopipe.c | 15 +- 17 files changed, 528 insertions(+), 171 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result create mode 100644 mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index f9ce47560aed..40dc608d9716 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -613,6 +613,9 @@ The following options may be given as the first argument: authenticated accounts to be mapped to proxy users when the server option check_proxy_users is enabled. --named-pipe Enable the named pipe (NT) + --named-pipe-full-access-group=name + Name of Windows group granted full access to the named + pipe --net-buffer-length=# Buffer length for TCP/IP and socket communication --net-read-timeout=# @@ -1446,6 +1449,7 @@ myisam-stats-method nulls_unequal myisam-use-mmap FALSE mysql-native-password-proxy-users FALSE named-pipe FALSE +named-pipe-full-access-group everyone net-buffer-length 16384 net-read-timeout 30 net-retry-count 10 diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index b1088a136286..3339b5a1a2c8 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -16,7 +16,9 @@ wait/synch/mutex/sql/LOCK_audit_mask YES YES wait/synch/mutex/sql/LOCK_compress_gtid_table YES YES select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') + and name not in ( +'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', +'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') order by name limit 10; NAME ENABLED TIMED wait/synch/rwlock/sql/Binlog_relay_IO_delegate::lock YES YES diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test index 3acf9c24e189..0a87600caba5 100644 --- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -25,7 +25,9 @@ select * from performance_schema.setup_instruments select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') + and name not in ( + 'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', + 'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') order by name limit 10; # COND_handler_count is dependent on the build (Windows only) diff --git a/mysql-test/suite/perfschema/t/show_sanity.test b/mysql-test/suite/perfschema/t/show_sanity.test index 98073adacfe0..a21260228e7f 100644 --- a/mysql-test/suite/perfschema/t/show_sanity.test +++ b/mysql-test/suite/perfschema/t/show_sanity.test @@ -582,6 +582,7 @@ insert into test.sanity values ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MYISAM_USE_MMAP"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MYSQL_NATIVE_PASSWORD_PROXY_USERS"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "NAMED_PIPE"), + ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "NAMED_PIPE_FULL_ACCESS_GROUP"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "NDBINFO_DATABASE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "NDBINFO_OFFLINE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "NDBINFO_TABLE_PREFIX"), diff --git a/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result new file mode 100644 index 000000000000..23a30a61aa28 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result @@ -0,0 +1,17 @@ +select @@global.named_pipe_full_access_group; +@@global.named_pipe_full_access_group +everyone +select @@session.named_pipe_full_access_group; +ERROR HY000: Variable 'named_pipe_full_access_group' is a GLOBAL variable +show global variables like 'named_pipe_full_access_group'; +Variable_name Value +named_pipe_full_access_group everyone +show session variables like 'named_pipe_full_access_group'; +Variable_name Value +named_pipe_full_access_group everyone +select * from performance_schema.global_variables where variable_name='named_pipe_full_access_group'; +VARIABLE_NAME VARIABLE_VALUE +named_pipe_full_access_group everyone +select * from performance_schema.session_variables where variable_name='named_pipe_full_access_group'; +VARIABLE_NAME VARIABLE_VALUE +named_pipe_full_access_group everyone diff --git a/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test new file mode 100644 index 000000000000..a1347cafe9a6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test @@ -0,0 +1,14 @@ +--source include/windows.inc +# +# only global +# +select @@global.named_pipe_full_access_group; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.named_pipe_full_access_group; +show global variables like 'named_pipe_full_access_group'; +show session variables like 'named_pipe_full_access_group'; +--disable_warnings +select * from performance_schema.global_variables where variable_name='named_pipe_full_access_group'; +select * from performance_schema.session_variables where variable_name='named_pipe_full_access_group'; +--enable_warnings + diff --git a/mysys/my_windac.c b/mysys/my_windac.c index affc37b6b5e7..781d3f131ae6 100644 --- a/mysys/my_windac.c +++ b/mysys/my_windac.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -217,6 +217,21 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa) { My_security_attr *attr= (My_security_attr*) (((char*)sa) + ALIGN_SIZE(sizeof(*sa))); + + PACL dacl_from_descriptor= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + // If the DACL in the descriptor is not the same as that in the + // My_security_attr, it will have been created by a call to SetEntriesInAcl + // and thus must be freed by a call to LocalFree. + if (GetSecurityDescriptorDacl(sa->lpSecurityDescriptor, + &dacl_present_in_descriptor, + &dacl_from_descriptor, &dacl_defaulted) && + dacl_present_in_descriptor && !dacl_defaulted && + attr->dacl != dacl_from_descriptor) { + LocalFree(dacl_from_descriptor); + } + FreeSid(attr->everyone_sid); my_free(attr->dacl); my_free(sa); diff --git a/sql-common/client.c b/sql-common/client.c index 67e980e4e113..ad34f480fbda 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -372,12 +372,12 @@ static HANDLE create_named_pipe(MYSQL *mysql, DWORD connect_timeout, for (i=0 ; i < 100 ; i++) /* Don't retry forever */ { if ((hPipe = CreateFile(pipe_name, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL )) != INVALID_HANDLE_VALUE) + FILE_READ_ATTRIBUTES | FILE_READ_DATA | + FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA, + 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED | SECURITY_SQOS_PRESENT | + SECURITY_IDENTIFICATION, + NULL)) != INVALID_HANDLE_VALUE) break; if (GetLastError() != ERROR_PIPE_BUSY) { diff --git a/sql/conn_handler/named_pipe_connection.cc b/sql/conn_handler/named_pipe_connection.cc index 6900a51f6fdd..c2cc48353d3f 100644 --- a/sql/conn_handler/named_pipe_connection.cc +++ b/sql/conn_handler/named_pipe_connection.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,7 @@ #include "named_pipe_connection.h" +#include // Windows access control API #include "violite.h" // Vio #include "channel_info.h" // Channel_info #include "connection_handler_manager.h" // Connection_handler_manager @@ -88,10 +89,10 @@ bool Named_pipe_listener::setup_listener() return true; } - m_pipe_handle= create_server_named_pipe(&m_sa_pipe_security, &m_sd_pipe_descriptor, - global_system_variables.net_buffer_length, - m_pipe_name.c_str(),m_pipe_path_name, - sizeof(m_pipe_path_name)); + m_pipe_handle= create_server_named_pipe( + &mp_sa_pipe_security, global_system_variables.net_buffer_length, + m_pipe_name.c_str(), m_pipe_path_name, sizeof(m_pipe_path_name), + named_pipe_full_access_group); if (m_pipe_handle == INVALID_HANDLE_VALUE) return true; @@ -101,6 +102,8 @@ bool Named_pipe_listener::setup_listener() Channel_info* Named_pipe_listener::listen_for_connection_event() { + TCHAR last_error_msg[256]; + /* wait for named pipe connection */ BOOL fConnected= ConnectNamedPipe(m_pipe_handle, &m_connect_overlapped); if (!fConnected && (GetLastError() == ERROR_IO_PENDING)) @@ -116,46 +119,58 @@ Channel_info* Named_pipe_listener::listen_for_connection_event() if (abort_loop) return NULL; if (!fConnected) - fConnected = GetLastError() == ERROR_PIPE_CONNECTED; + fConnected= GetLastError() == ERROR_PIPE_CONNECTED; if (!fConnected) { CloseHandle(m_pipe_handle); - if ((m_pipe_handle= - CreateNamedPipe(m_pipe_path_name, - PIPE_ACCESS_DUPLEX | - FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables. - net_buffer_length, - (int) global_system_variables. - net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &m_sa_pipe_security)) == INVALID_HANDLE_VALUE) + mysql_rwlock_rdlock(&LOCK_named_pipe_full_access_group); + m_pipe_handle= CreateNamedPipe( + m_pipe_path_name, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, + (int)global_system_variables.net_buffer_length, + (int)global_system_variables.net_buffer_length, + NMPWAIT_USE_DEFAULT_WAIT, mp_sa_pipe_security); + mysql_rwlock_unlock(&LOCK_named_pipe_full_access_group); + if (m_pipe_handle == INVALID_HANDLE_VALUE) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("Can't create new named pipe: %s", last_error_msg); + return NULL; + } + else { - sql_print_error("Can't create new named pipe!: %s", strerror(errno)); + /* A new pipe has been successfully created, it's not connected yet so + return NULL to spin around and wait for connection on it. + */ return NULL; } } - HANDLE hConnectedPipe = m_pipe_handle; + HANDLE hConnectedPipe= m_pipe_handle; /* create new pipe for new connection */ - if ((m_pipe_handle = - CreateNamedPipe(m_pipe_path_name, - PIPE_ACCESS_DUPLEX | - FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | - PIPE_READMODE_BYTE | - PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - (int) global_system_variables.net_buffer_length, - (int) global_system_variables.net_buffer_length, - NMPWAIT_USE_DEFAULT_WAIT, - &m_sa_pipe_security)) == INVALID_HANDLE_VALUE) + mysql_rwlock_rdlock(&LOCK_named_pipe_full_access_group); + m_pipe_handle= CreateNamedPipe( + m_pipe_path_name, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, + (int)global_system_variables.net_buffer_length, + (int)global_system_variables.net_buffer_length, NMPWAIT_USE_DEFAULT_WAIT, + mp_sa_pipe_security); + mysql_rwlock_unlock(&LOCK_named_pipe_full_access_group); + if (m_pipe_handle == INVALID_HANDLE_VALUE) { - sql_print_error("Can't create new named pipe!: %s", strerror(errno)); - m_pipe_handle=hConnectedPipe; + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("Can't create new named pipe: %s", last_error_msg); + m_pipe_handle= hConnectedPipe; return NULL; // We have to try again } @@ -170,6 +185,66 @@ Channel_info* Named_pipe_listener::listen_for_connection_event() return channel_info; } +bool Named_pipe_listener::update_named_pipe_full_access_group( + const char *new_group_name) +{ + SECURITY_ATTRIBUTES *p_new_sa= nullptr; + const char *perror= nullptr; + TCHAR last_error_msg[256]; + + // Set up security attributes to provide full access to the owner + // and minimal read/write access to others. + if (my_security_attr_create(&p_new_sa, &perror, NAMED_PIPE_OWNER_PERMISSIONS, + NAMED_PIPE_EVERYONE_PERMISSIONS) != 0) + { + sql_print_error("my_security_attr_create: %s", perror); + return true; + } + if (new_group_name && new_group_name[0] != '\0') + { + if (my_security_attr_add_rights_to_group( + p_new_sa, new_group_name, + NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS)) + { + sql_print_error("my_security_attr_add_rights_to_group failed for group: %s", + new_group_name); + return false; + } + } + + mp_sa_pipe_security= p_new_sa; + + // Set the DACL for the existing "listener" named pipe instance... + if (m_pipe_handle != INVALID_HANDLE_VALUE) { + PACL pdacl= NULL; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + if (!GetSecurityDescriptorDacl(p_new_sa->lpSecurityDescriptor, + &dacl_present_in_descriptor, &pdacl, + &dacl_defaulted) || + !dacl_present_in_descriptor) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("GetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + DWORD res = + SetSecurityInfo(m_pipe_handle, SE_KERNEL_OBJECT, + DACL_SECURITY_INFORMATION, NULL, NULL, pdacl, NULL); + if (res != ERROR_SUCCESS) + { + char num_buff[20]; + int10_to_str(res, num_buff, 10); + sql_print_error("SetSecurityInfo failed to update DACL on named pipe: %s", num_buff); + return true; + } + } + return false; +} void Named_pipe_listener::close_listener() { @@ -180,20 +255,18 @@ void Named_pipe_listener::close_listener() /* Create connection to the handle named pipe handler to break the loop */ HANDLE temp; - if ((temp = CreateFile(m_pipe_path_name, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - 0, - NULL )) != INVALID_HANDLE_VALUE) + if ((temp= CreateFile(m_pipe_path_name, NAMED_PIPE_EVERYONE_PERMISSIONS, 0, + NULL, OPEN_EXISTING, 0, NULL)) != + INVALID_HANDLE_VALUE) { WaitNamedPipe(m_pipe_path_name, 1000); - DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT; + DWORD dwMode= PIPE_READMODE_BYTE | PIPE_WAIT; SetNamedPipeHandleState(temp, &dwMode, NULL, NULL); CancelIo(temp); DisconnectNamedPipe(temp); CloseHandle(temp); } CloseHandle(m_connect_overlapped.hEvent); + my_security_attr_free(mp_sa_pipe_security); + mp_sa_pipe_security= nullptr; } diff --git a/sql/conn_handler/named_pipe_connection.h b/sql/conn_handler/named_pipe_connection.h index eb944f6082b8..ec355e2193e6 100644 --- a/sql/conn_handler/named_pipe_connection.h +++ b/sql/conn_handler/named_pipe_connection.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,8 +34,7 @@ class THD; class Named_pipe_listener { std::string m_pipe_name; - SECURITY_ATTRIBUTES m_sa_pipe_security; - SECURITY_DESCRIPTOR m_sd_pipe_descriptor; + SECURITY_ATTRIBUTES *mp_sa_pipe_security; HANDLE m_pipe_handle; char m_pipe_path_name[512]; HANDLE h_connected_pipe; @@ -49,7 +48,8 @@ class Named_pipe_listener */ Named_pipe_listener(const std::string *pipe_name) : m_pipe_name(*pipe_name), - m_pipe_handle(INVALID_HANDLE_VALUE) + m_pipe_handle(INVALID_HANDLE_VALUE), + mp_sa_pipe_security(nullptr) { } @@ -70,6 +70,15 @@ class Named_pipe_listener */ Channel_info* listen_for_connection_event(); + /** + Set the Windows group name whose users have full access to new instances of + the named pipe + + @retval false access set successfully. + true failed to change access. + */ + bool update_named_pipe_full_access_group(const char *new_group_name); + /** Close the listener */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 2eb5a43a9f17..9f0dcc03cfb6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -256,6 +256,7 @@ static PSI_thread_key key_thread_handle_con_sockets; static PSI_mutex_key key_LOCK_handler_count; static PSI_cond_key key_COND_handler_count; static PSI_thread_key key_thread_handle_shutdown; +static PSI_rwlock_key key_rwlock_LOCK_named_pipe_full_access_group; #else static PSI_mutex_key key_LOCK_socket_listener_active; static PSI_cond_key key_COND_socket_listener_active; @@ -751,8 +752,11 @@ int show_rsa_public_key(THD *thd, SHOW_VAR *var, char *buff); Connection_acceptor *mysqld_socket_acceptor= NULL; #ifdef _WIN32 +static Named_pipe_listener *named_pipe_listener= NULL; Connection_acceptor *named_pipe_acceptor= NULL; Connection_acceptor *shared_mem_acceptor= NULL; +mysql_rwlock_t LOCK_named_pipe_full_access_group; +char *named_pipe_full_access_group; #endif Checkable_rwlock *global_sid_lock= NULL; @@ -1442,6 +1446,7 @@ static void clean_up_mutexes() #ifdef _WIN32 mysql_cond_destroy(&COND_handler_count); mysql_mutex_destroy(&LOCK_handler_count); + mysql_rwlock_destroy(&LOCK_named_pipe_full_access_group); #endif #ifndef _WIN32 mysql_cond_destroy(&COND_socket_listener_active); @@ -1664,8 +1669,7 @@ static bool network_init(void) { std::string pipe_name= mysqld_unix_port ? mysqld_unix_port : ""; - Named_pipe_listener *named_pipe_listener= - new (std::nothrow) Named_pipe_listener(&pipe_name); + named_pipe_listener= new (std::nothrow) Named_pipe_listener(&pipe_name); if (named_pipe_listener == NULL) return true; @@ -3246,6 +3250,8 @@ static int init_thread_environment() mysql_mutex_init(key_LOCK_handler_count, &LOCK_handler_count, MY_MUTEX_INIT_FAST); mysql_cond_init(key_COND_handler_count, &COND_handler_count); + mysql_rwlock_init(key_rwlock_LOCK_named_pipe_full_access_group, + &LOCK_named_pipe_full_access_group); #else mysql_mutex_init(key_LOCK_socket_listener_active, &LOCK_socket_listener_active, MY_MUTEX_INIT_FAST); @@ -7730,6 +7736,15 @@ mysqld_get_one_option(int optid, global_system_variables.transaction_isolation= global_system_variables.tx_isolation; break; + case OPT_NAMED_PIPE_FULL_ACCESS_GROUP: +#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) + if (!is_valid_named_pipe_full_access_group(argument)) + { + sql_print_error("Invalid value for named_pipe_full_access_group."); + return 1; + } +#endif /* _WIN32 && !EMBEDDED_LIBRARY */ + break; } return 0; } @@ -8845,7 +8860,10 @@ static PSI_rwlock_info all_server_rwlocks[]= { &key_rwlock_channel_lock, "channel_lock", 0}, { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL}, { &key_rwlock_Server_state_delegate_lock, "Server_state_delegate::lock", PSI_FLAG_GLOBAL}, - { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL} + { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL}, +#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) + { &key_rwlock_LOCK_named_pipe_full_access_group, "LOCK_named_pipe_full_access_group", PSI_FLAG_GLOBAL}, +#endif /* _WIN32 && !EMBEDDED_LIBRARY */ }; PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; @@ -9596,3 +9614,17 @@ void init_server_psi_keys(void) #endif /* HAVE_PSI_INTERFACE */ +#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) +// update_named_pipe_full_access_group returns false on success, true on failure +bool update_named_pipe_full_access_group(const char *new_group_name) +{ + if (named_pipe_acceptor) { + return named_pipe_listener->update_named_pipe_full_access_group( + new_group_name); + } + return true; +} + +#endif /* _WIN32 && !EMBEDDED_LIBRARY */ + + diff --git a/sql/mysqld.h b/sql/mysqld.h index d7f70057e21a..3dea6ae4db08 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -157,6 +157,10 @@ extern uint slave_rows_last_search_algorithm_used; #endif extern ulong mts_parallel_option; extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; +#ifdef _WIN32 +extern mysql_rwlock_t LOCK_named_pipe_full_access_group; +extern char *named_pipe_full_access_group; +#endif extern my_bool opt_secure_auth; extern char* opt_secure_file_priv; extern char* opt_secure_backup_file_priv; @@ -925,7 +929,8 @@ enum options_mysqld OPT_KEYRING_MIGRATION_HOST, OPT_KEYRING_MIGRATION_PASSWORD, OPT_KEYRING_MIGRATION_SOCKET, - OPT_KEYRING_MIGRATION_PORT + OPT_KEYRING_MIGRATION_PORT, + OPT_NAMED_PIPE_FULL_ACCESS_GROUP }; @@ -999,4 +1004,8 @@ static inline THD *_current_thd(void) #define ER(X) ER_THD(current_thd,X) +#ifdef _WIN32 +bool update_named_pipe_full_access_group(const char *new_group_name); +#endif + #endif /* MYSQLD_INCLUDED */ diff --git a/sql/named_pipe.cc b/sql/named_pipe.cc index b8c82391da9b..c0528cf88d18 100644 --- a/sql/named_pipe.cc +++ b/sql/named_pipe.cc @@ -1,98 +1,234 @@ -/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include +#include #include "my_config.h" +#include "my_sys.h" +#include "mysqld_error.h" +#include "m_string.h" #include "log.h" #include "named_pipe.h" +bool is_existing_windows_group_name(const char *group_name) +{ + // First, let's get a SID for the given group name... + BYTE soughtSID[SECURITY_MAX_SID_SIZE]= { 0 }; + DWORD size_sid= SECURITY_MAX_SID_SIZE; + char referencedDomainName[MAX_PATH]; + DWORD size_referencedDomainName= MAX_PATH; + SID_NAME_USE sid_name_use; + + if (!LookupAccountName(nullptr, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + return false; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + return false; + } + return true; +} + +bool is_valid_named_pipe_full_access_group(const char *group_name) +{ + if (!group_name || group_name[0] == '\0' || + is_existing_windows_group_name(group_name)) + { + return true; + } + else + { + return false; + } +} + +// return false on success, true on failure. +bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, + const char *group_name, + DWORD group_rights) +{ + TCHAR last_error_msg[256]; + // First, let's get a SID for the given group name... + BYTE soughtSID[SECURITY_MAX_SID_SIZE]= { 0 }; + DWORD size_sid= SECURITY_MAX_SID_SIZE; + char referencedDomainName[MAX_PATH]; + DWORD size_referencedDomainName= MAX_PATH; + SID_NAME_USE sid_name_use; + + if (!LookupAccountName(nullptr, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("my_security_attr_add_rights_to_group, LookupAccountName failed: %s", + last_error_msg); + return true; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + sql_print_error("LookupAccountName failed: unexpected sid_name_use"); + return true; + } + + PACL pNewDACL= nullptr; + PACL pOldDACL= nullptr; + BOOL dacl_present_in_descriptor= FALSE; + BOOL dacl_defaulted= FALSE; + if (!GetSecurityDescriptorDacl(psa->lpSecurityDescriptor, + &dacl_present_in_descriptor, &pOldDACL, + &dacl_defaulted) || + !dacl_present_in_descriptor) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("GetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + + // Just because GetSecurityDescriptorDacl succeeded doesn't mean we're out of + // the woods: a NULL value for pOldDACL is a bad/unexpected thing, as is + // dacl_defaulted == TRUE + if (pOldDACL == nullptr || dacl_defaulted) + { + sql_print_error("Invalid DACL on named pipe: %s", + (pOldDACL == nullptr) ? "NULL DACL" : "Defaulted DACL"); + return true; + } + + EXPLICIT_ACCESS ea; + // Initialize an EXPLICIT_ACCESS structure for the new ACE. + + ZeroMemory(&ea, sizeof(EXPLICIT_ACCESS)); + ea.grfAccessPermissions= group_rights; + ea.grfAccessMode= SET_ACCESS; + ea.grfInheritance= NO_INHERITANCE; + ea.Trustee.TrusteeForm= TRUSTEE_IS_SID; + ea.Trustee.ptstrName= (LPSTR)soughtSID; + + // Create a new ACL that merges the new ACE + // into the existing DACL. + DWORD dwRes= SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); + if (ERROR_SUCCESS != dwRes) + { + char num_buff[20]; + int10_to_str(dwRes, num_buff, 10); + sql_print_error("SetEntriesInAcl to add group permissions failed: %s", num_buff); + return true; + } + + // Apply the new DACL to the existing security descriptor... + if (!SetSecurityDescriptorDacl(psa->lpSecurityDescriptor, TRUE, pNewDACL, + FALSE)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("SetSecurityDescriptorDacl failed: %s", last_error_msg); + return true; + } + + return false; +} + /** - Creates an instance of a named pipe and returns a handle. - - @param sec_attr Security attributes for the pipe. - @param sec_descr Security descriptor for the pipe. - @param buffer_size Number of bytes to reserve for input and output buffers. - @param name The name of the pipe. - @param name_buff Output argument: null-terminated concatenation of - "\\.\pipe\" and name. - @param buflen The size of name_buff. - - @returns Pipe handle, or INVALID_HANDLE_VALUE in case of error. - - @note The entire pipe name string can be up to 256 characters long. - Pipe names are not case sensitive. - */ -HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES *sec_attr, - SECURITY_DESCRIPTOR *sec_descr, - DWORD buffer_size, - const char *name, - char *name_buf, - size_t buflen) +Creates an instance of a named pipe and returns a handle. + +@param sec_attr Security attributes for the pipe. +@param buffer_size Number of bytes to reserve for input and output buffers. +@param name The name of the pipe. +@param name_buf Output argument: null-terminated concatenation of +"\\.\pipe\" and name. +@param buflen The size of name_buff. + +@returns Pipe handle, or INVALID_HANDLE_VALUE in case of error. + +@note The entire pipe name string can be up to 256 characters long. +Pipe names are not case sensitive. +*/ +HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr, + DWORD buffer_size, const char *name, + char *name_buf, size_t buflen, + const char *full_access_group_name) { HANDLE ret_handle= INVALID_HANDLE_VALUE; + TCHAR last_error_msg[256]; - strxnmov(name_buf, buflen - 1, - "\\\\.\\pipe\\", name, NullS); - memset(sec_attr, 0, sizeof(SECURITY_ATTRIBUTES)); - memset(sec_descr, 0, sizeof(SECURITY_DESCRIPTOR)); - if (!InitializeSecurityDescriptor(sec_descr, SECURITY_DESCRIPTOR_REVISION)) + strxnmov(name_buf, buflen - 1, "\\\\.\\pipe\\", name, NullS); + const char *perror= nullptr; + // Set up security for the named pipe to provide full access to the owner + // and minimal read/write access to others. + if (my_security_attr_create(ppsec_attr, &perror, NAMED_PIPE_OWNER_PERMISSIONS, + NAMED_PIPE_EVERYONE_PERMISSIONS) != 0) { - sql_print_error("Can't start server : Initialize security descriptor: %s", - strerror(errno)); - return INVALID_HANDLE_VALUE; + sql_print_error("my_security_attr_create failed: %s", perror); + return ret_handle; } - if (!SetSecurityDescriptorDacl(sec_descr, TRUE, NULL, FALSE)) + + if (full_access_group_name && full_access_group_name[0] != '\0') { - sql_print_error("Can't start server : Set security descriptor: %s", - strerror(errno)); - return INVALID_HANDLE_VALUE; + if (my_security_attr_add_rights_to_group( + *ppsec_attr, full_access_group_name, + NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS)) + { + return ret_handle; + } } - sec_attr->nLength= sizeof(SECURITY_ATTRIBUTES); - sec_attr->lpSecurityDescriptor= sec_descr; - sec_attr->bInheritHandle= FALSE; - ret_handle= CreateNamedPipe(name_buf, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | - FILE_FLAG_FIRST_PIPE_INSTANCE, - PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, - buffer_size, - buffer_size, - NMPWAIT_USE_DEFAULT_WAIT, - sec_attr); - + + ret_handle= CreateNamedPipe( + name_buf, + PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | + FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC, + PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, + buffer_size, buffer_size, NMPWAIT_USE_DEFAULT_WAIT, *ppsec_attr); + if (ret_handle == INVALID_HANDLE_VALUE) { - int error= GetLastError(); + DWORD last_error_num= GetLastError(); - if (error == ERROR_ACCESS_DENIED) + if (last_error_num == ERROR_ACCESS_DENIED) { - sql_print_error("Can't start server : Named Pipe \"%s\" already in use.", - name); + sql_print_error("Can't start server : Named Pipe \"%s\" already in use.", name); } else { - LPVOID msg_buff= NULL; - - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &msg_buff, 0, NULL ); - - if (msg_buff != NULL) - { - sql_print_error("%s: %s", (char*)msg_buff, strerror(errno)); - LocalFree(msg_buff); - } + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + char num_buff[20]; + int10_to_str(last_error_num, num_buff, 10); + sql_print_error("Can't start server : %s %s", last_error_msg, num_buff); } } diff --git a/sql/named_pipe.h b/sql/named_pipe.h index d0a9325cf98b..eeb9d36712bb 100644 --- a/sql/named_pipe.h +++ b/sql/named_pipe.h @@ -1,30 +1,39 @@ -/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef NAMED_PIPE_INCLUDED #define NAMED_PIPE_INCLUDED -C_MODE_START - -HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES *sec_attr, - SECURITY_DESCRIPTOR *sec_descr, - DWORD buffer_size, - const char *name, - char *name_buf, - size_t buflen); - -C_MODE_END - +#include + +const DWORD NAMED_PIPE_OWNER_PERMISSIONS= GENERIC_READ | GENERIC_WRITE; +const DWORD NAMED_PIPE_EVERYONE_PERMISSIONS= +FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_WRITE_ATTRIBUTES | +FILE_WRITE_DATA | SYNCHRONIZE | READ_CONTROL; +const DWORD NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS = +GENERIC_READ | GENERIC_WRITE; + +HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr, + DWORD buffer_size, const char *name, + char *name_buf, size_t buflen, + const char *full_access_group_name= NULL); + +bool is_valid_named_pipe_full_access_group(const char *group_name); +bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, + const char *group_name, + DWORD group_rights); +#define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP "everyone" #endif /* NAMED_PIPE_INCLUDED */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 81a390b90884..5e5b55cc39f3 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -61,6 +61,9 @@ #include "transaction.h" // trans_commit_stmt #include "rpl_write_set_handler.h" // transaction_write_set_hashing_algorithms #include "rpl_group_replication.h" // is_group_replication_running +#ifdef _WIN32 +#include "named_pipe.h" +#endif #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" @@ -2540,7 +2543,39 @@ static Sys_var_mybool Sys_named_pipe( "named_pipe", "Enable the named pipe (NT)", READ_ONLY GLOBAL_VAR(opt_enable_named_pipe), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -#endif +#ifndef EMBEDDED_LIBRARY + +static PolyLock_rwlock PLock_named_pipe_full_access_group( + &LOCK_named_pipe_full_access_group); +static bool check_named_pipe_full_access_group(sys_var *self, THD *thd, + set_var *var) +{ + if (!var->value) return false; // DEFAULT is ok + + if (!is_valid_named_pipe_full_access_group( + var->save_result.string_value.str)) + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), self->name.str, + var->save_result.string_value.str); + return true; + } + return false; +} +static bool fix_named_pipe_full_access_group(sys_var *, THD *, enum_var_type) { + return update_named_pipe_full_access_group(named_pipe_full_access_group); +} +static Sys_var_charptr Sys_named_pipe_full_access_group( + "named_pipe_full_access_group", + "Name of Windows group granted full access to the named pipe", + GLOBAL_VAR(named_pipe_full_access_group), + CMD_LINE(REQUIRED_ARG, OPT_NAMED_PIPE_FULL_ACCESS_GROUP), IN_FS_CHARSET, + DEFAULT(DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP), + &PLock_named_pipe_full_access_group, NOT_IN_BINLOG, + ON_CHECK(check_named_pipe_full_access_group), + ON_UPDATE(fix_named_pipe_full_access_group)); + +#endif /* EMBEDDED_LIBRARY */ +#endif /* _WIN32 */ static bool diff --git a/unittest/gunit/win_tests-t.cc b/unittest/gunit/win_tests-t.cc index 799ef15ac58a..1f61210a1dc4 100644 --- a/unittest/gunit/win_tests-t.cc +++ b/unittest/gunit/win_tests-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,8 +62,7 @@ class NamedPipeTest : public ::testing::Test } } - SECURITY_ATTRIBUTES m_sec_attr; - SECURITY_DESCRIPTOR m_sec_descr; + SECURITY_ATTRIBUTES *mp_sec_attr; char m_pipe_name[256]; HANDLE m_pipe_handle; std::string m_name; @@ -75,8 +74,7 @@ TEST_F(NamedPipeTest, CreatePipe) { char exp_pipe_name[256]; - m_pipe_handle= create_server_named_pipe(&m_sec_attr, - &m_sec_descr, + m_pipe_handle= create_server_named_pipe(&mp_sec_attr, 1024, m_name.c_str(), m_pipe_name, @@ -93,16 +91,14 @@ TEST_F(NamedPipeTest, CreatePipe) // Verify that we fail if we try to create the same named pipe twice. TEST_F(NamedPipeTest, CreatePipeTwice) { - m_pipe_handle= create_server_named_pipe(&m_sec_attr, - &m_sec_descr, + m_pipe_handle= create_server_named_pipe(&mp_sec_attr, 1024, m_name.c_str(), m_pipe_name, sizeof(m_pipe_name)); EXPECT_NE(INVALID_HANDLE_VALUE, m_pipe_handle); - HANDLE handle= create_server_named_pipe(&m_sec_attr, - &m_sec_descr, + HANDLE handle= create_server_named_pipe(&mp_sec_attr, 1024, m_name.c_str(), m_pipe_name, diff --git a/vio/viopipe.c b/vio/viopipe.c index c2145ccb0dc1..de6d2fbb5f6b 100644 --- a/vio/viopipe.c +++ b/vio/viopipe.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -101,13 +101,16 @@ my_bool vio_is_connected_pipe(Vio *vio) int vio_shutdown_pipe(Vio *vio) { - BOOL ret; + BOOL ret= FALSE; DBUG_ENTER("vio_shutdown_pipe"); - CancelIo(vio->hPipe); - CloseHandle(vio->overlapped.hEvent); - DisconnectNamedPipe(vio->hPipe); - ret= CloseHandle(vio->hPipe); + if (vio->inactive == FALSE) + { + CancelIo(vio->hPipe); + CloseHandle(vio->overlapped.hEvent); + DisconnectNamedPipe(vio->hPipe); + ret= CloseHandle(vio->hPipe); + } vio->inactive= TRUE; vio->hPipe= NULL; From 57d4f09fa21289d8213f8d4edfa66f167e7488bf Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Sat, 24 Nov 2018 09:33:58 +0100 Subject: [PATCH 110/214] From cd1db94daef4948ac9a74978eff163e76fc6a838 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Sat, 24 Nov 2018 10:25:17 +0100 Subject: [PATCH 111/214] From da45cbbf8ace4d6ee8024ac0345bb73845d45fda Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Sat, 24 Nov 2018 15:34:13 +0100 Subject: [PATCH 112/214] From d520e6da6e99cf5675829ccee2fa7b2ca0dbbecf Mon Sep 17 00:00:00 2001 From: Surabhi Bhat Date: Tue, 27 Nov 2018 16:42:01 +0530 Subject: [PATCH 113/214] - Updated copyright year in user visible text --- README | 2 +- include/welcome_copyright_notice.h | 4 ++-- mysql-test/r/mysql_config_editor.result | 2 +- packaging/WiX/custom_ui.wxs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README b/README index 6cfca1fffc78..97eb5bbaadc3 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. MySQL is brought to you by Oracle. -Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. License information can be found in the COPYING file. diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index 2b304d57f91f..5b21fd7e7bef 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2018" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2019" /* This define specifies copyright notice which is displayed by every MySQL diff --git a/mysql-test/r/mysql_config_editor.result b/mysql-test/r/mysql_config_editor.result index 7d2687ca4315..dfe2e1fabb63 100644 --- a/mysql-test/r/mysql_config_editor.result +++ b/mysql-test/r/mysql_config_editor.result @@ -100,7 +100,7 @@ user = test_user4 ############################################## # Tests for mysql_config_editor's help command ############################################## -Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs index a0dba4b6d3bc..25265d7d3ecb 100644 --- a/packaging/WiX/custom_ui.wxs +++ b/packaging/WiX/custom_ui.wxs @@ -30,7 +30,7 @@ - + From ecaa5a872160f0a7ba577cfb3f6baa052d8fbc0d Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Thu, 1 Nov 2018 09:14:06 +0100 Subject: [PATCH 114/214] PS-4988: Fix uninitialized btr stat mutex --- mysql-test/r/percona_sync_debug.result | 1 + mysql-test/t/percona_bug_ps4988-master.opt | 1 + mysql-test/t/percona_sync_debug.test | 5 +++++ storage/innobase/srv/srv0start.cc | 3 +++ 4 files changed, 10 insertions(+) create mode 100644 mysql-test/r/percona_sync_debug.result create mode 100644 mysql-test/t/percona_bug_ps4988-master.opt create mode 100644 mysql-test/t/percona_sync_debug.test diff --git a/mysql-test/r/percona_sync_debug.result b/mysql-test/r/percona_sync_debug.result new file mode 100644 index 000000000000..c7a0f67756c0 --- /dev/null +++ b/mysql-test/r/percona_sync_debug.result @@ -0,0 +1 @@ +show status like ''; diff --git a/mysql-test/t/percona_bug_ps4988-master.opt b/mysql-test/t/percona_bug_ps4988-master.opt new file mode 100644 index 000000000000..727547a7adaf --- /dev/null +++ b/mysql-test/t/percona_bug_ps4988-master.opt @@ -0,0 +1 @@ +--innodb-sync-debug=1 diff --git a/mysql-test/t/percona_sync_debug.test b/mysql-test/t/percona_sync_debug.test new file mode 100644 index 000000000000..6f6a5da887c7 --- /dev/null +++ b/mysql-test/t/percona_sync_debug.test @@ -0,0 +1,5 @@ +# PS-4988: Uninitialized btr stat mutex caused assertion failure +--source include/have_debug.inc +-- disable_result_log +show status like ''; +-- enable_result_log diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 65f00a253862..f18b6f250027 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -70,6 +70,7 @@ Created 2/16/1996 Heikki Tuuri #include "trx0sys.h" #include "btr0btr.h" #include "btr0cur.h" +#include "btr0scrub.h" #include "rem0rec.h" #include "ibuf0ibuf.h" #include "srv0start.h" @@ -3029,6 +3030,7 @@ innobase_start_or_create_for_mysql(void) fts_optimize_init(); fil_system_enter(); + btr_scrub_init(); fil_crypt_threads_init(); fil_system_exit(); @@ -3133,6 +3135,7 @@ innobase_shutdown_for_mysql(void) dict_stats_thread_deinit(); /* Shutdown key rotation threads */ fil_crypt_threads_cleanup(); + btr_scrub_cleanup(); } /* This must be disabled before closing the buffer pool From d5a600ef6bf3f363417739d4163088505bac5274 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Fri, 9 Nov 2018 20:04:38 +0200 Subject: [PATCH 115/214] Release notes for PS 5.7.23-24 Also includes the release notes for the hotfix release 5.7.23-25 --- doc/source/conf.py | 2 +- .../management/data_at_rest_encryption.rst | 633 ++++++++++++++---- doc/source/myrocks/variables.rst | 20 +- doc/source/ps-variables.rst | 65 ++ .../Percona-Server-5.7.23-24.rst | 51 ++ .../Percona-Server-5.7.23-25.rst | 30 + .../release-notes/release-notes_index.rst | 2 + doc/source/upstream-bug-fixes.rst | 132 ++-- 8 files changed, 744 insertions(+), 191 deletions(-) create mode 100644 doc/source/release-notes/Percona-Server-5.7.23-24.rst create mode 100644 doc/source/release-notes/Percona-Server-5.7.23-25.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index 0f22c95e15dc..e2944818d685 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -54,7 +54,7 @@ # The short X.Y version. version = '5.7' # The full version, including alpha/beta/rc tags. -release = '5.7.23-23' +release = '5.7.23-25' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/management/data_at_rest_encryption.rst b/doc/source/management/data_at_rest_encryption.rst index 6e00de222311..afd07f171ce9 100644 --- a/doc/source/management/data_at_rest_encryption.rst +++ b/doc/source/management/data_at_rest_encryption.rst @@ -7,58 +7,205 @@ Data at Rest Encryption .. contents:: :local: -.. _innodb_general_tablespace_encryption: - -InnoDB general tablespace encryption -==================================== - -In |Percona Server| :rn:`5.7.20-18` existing tablespace encryption support -has been extended to handle general tablespaces. A general tablespace is either -fully encrypted, covering all the tables inside, either not encrypted at all. -It is not possible to have only some of the tables in the general tablespace -encrypted. -This feature extends the `CREATE TABLESPACE -`_ -statement to accept the ``ENCRYPTION='Y/N'`` option. +.. _data-at-rest-encryption.prerequisite: Prerequisites -------------- +================================================================================ -This feature requires a keyring plugin, for example `keyring_file +Data at rest encryption requires that a keyring plugin, such as `keyring_file `_ or -:ref:`keyring_vault_plugin` to be loaded before it can be used. +:ref:`keyring_vault_plugin` be installed and already loaded. To load the +``keyring`` plugin when starting the server, use the ``--early-plugin-load`` +option: + +.. code-block:: bash + + $ mysqld --early-plugin-load="keyring_file=keyring_file.so" + +Altermatively, you can add this option to your configuration file: + +.. code-block:: guess + + [mysqld] + early-plugin-load=keyring_file.so .. warning:: - Only one keyring plugin should be enabled at a time. Enabling multiple - keyring plugins is unsupported and may result in data loss. + Only one keyring plugin should be enabled at a time. Enabling multiple + keyring plugins is not supported and may result in data loss. + +.. seealso:: + + |MySQL| Documentation: + - `Installing a Keyring Plugin `_ + - `The --early-plugin-load Option `_ + +.. _data-at-rest-encryption.keyring.changing-default: + +Changing the Default Keyring Encryption +================================================================================ + +When encryption is enabled and the server is configured to use the KEYRING +encryption, new tables use the default encryption key. + +You many change this default encryption via the +:variable:`innodb_default_encryption_key_id` variable. + +.. seealso:: + + Configuring the way how tables are encrypted + :variable:`innodb_encrypt_tables` + +System Variables +-------------------------------------------------------------------------------- + +.. variable:: innodb_default_encryption_key_id + + :version 5.7.23-24: Implemented + :cli: ``--innodb-default-encryption-key-id`` + :dyn: Yes + :scope: Session + :vartype: Numeric + :default: 0 + +The ID of the default encryption key. By default, this variable contains **0** +to encrypt new tables with the latest version of the key ``percona_innodb-0``. + +To change the default value use the following syntax: + +.. code-block:: guess + + mysql> SET innodb_default_encryption_key_id = NEW_ID + +Here, **NEW_ID** is an unsigned 32-bit integer. + +.. _data-at-rest-encryption.innodb-system-tablespace: + +InnoDB System Tablespace Encryption +================================================================================ + +The InnoDB system tablespace is encrypted by using master key encryption. The +server must be started with the ``--bootstrap`` option. + +If the variable :variable:`innodb_sys_tablespace_encrypt` is set to ON and the +server has been started in the bootstrap mode, you may create an encrypted table +as follows: + +.. code-block:: guess + + mysql> CREATE TABLE ... TABLESPACE=innodb_system ENCRYPTION='Y' + +.. note:: + + You cannot encrypt existing tables in the System tablespace. + +It is not possible to convert the system tablespace from encrypted to +unencrypted or vice versa. A new instance should be created and user tables must +be transferred to the desired instance. + +You can encrypt the already encrypted InnoDB system tablespace (key rotation) +with a new master key by running the following ``ALTER INSTANCE`` statement: + +.. code-block:: guess + + mysql> ALTER INSTANCE ROTATE INNODB MASTER KEY + +.. rubric:: Doublewrite Buffers +The two types of doublewrite buffers used in |Percona Server| are encrypted +differently. + +When the InnoDB system tablespace is encrypted, the ``doublewrite buffer`` pages +are encrypted as well. The key which was used to encrypt the InnoDB system +tablespace is also used to encrypt the doublewrite buffer. + +|Percona Server| encrypts the ``parallel doublewrite buffer`` with the respective +tablespace keys. Only encrypted tablespace pages are written as encrypted in the +parallel doublewrite buffer. Unencrypted tablespace pages will be written as +unencrypted. + +.. important:: + + A server instance bootstrapped with the encrypted InnoDB system tablespace + cannot be downgraded. It is not possible to parse encrypted InnoDB system + tablespace pages in a version of |Percona Server| lower than the version + where the InnoDB system tablespace has been encrypted. + + +System variables +-------------------------------------------------------------------------------- + +.. variable:: innodb_sys_tablespace_encrypt + + :version 5.7.23-24: Implemented + :cli: ``--innodb-sys-tablespace-encrypt`` + :dyn: No + :scope: Global + :vartype: Boolean + :default: ``OFF`` + +Enables the encryption of the InnoDB System tablespace. It is essential that the +server is started with the ``--bootstrap`` option. + +.. seealso:: + + |MySQL| Documentation: ``--bootstrap`` option + https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_bootstrap + +.. variable:: innodb_parallel_dblwr_encrypt + + :version 5.7.23-24: Implemented + :cli: ``--innodb-sys-tablespace-encrypt`` + :dyn: Yes + :scope: Global + :vartype: Boolean + :default: ``OFF`` + +Enables the encryption of the parallel doublewrite buffer. For encryption, uses +the key of the tablespace where the parallel doublewrite buffer is used. + + +.. _innodb_general_tablespace_encryption: + +InnoDB General Tablespace Encryption +================================================================================ + +In |Percona Server| :rn:`5.7.20-18` existing tablespace encryption support has +been extended to handle general tablespaces. A general tablespace is either +fully encrypted, covering all the tables inside, or not encrypted at all. +It is not possible to have encrypted only some of the tables in a general +tablespace. + +This feature extends the `CREATE TABLESPACE +`_ +statement to accept the ``ENCRYPTION='Y/N'`` option. + Usage ------ +-------------------------------------------------------------------------------- General tablespace encryption is enabled by the following syntax extension: .. code-block:: mysql - mysql> CREATE TABLESPACE tablespace_name ... ENCRYPTION='Y' + mysql> CREATE TABLESPACE tablespace_name ... ENCRYPTION='Y' Attempts to create or to move tables, including partitioned ones, to a general tablespace with an incompatible encryption setting are diagnosed and aborted. -As you cannot move tables between encrypted and unencrypted tablespaces, -you will need to create another table, add it to a specific tablespace and run +As you cannot move tables between encrypted and unencrypted tablespaces, you +will need to create another table, add it to a specific tablespace and run ``INSERT INTO SELECT`` from the table you want to move from, and then you will get encrypted or decrypted table with your desired content. Example -------- +-------------------------------------------------------------------------------- To create an encrypted tablespace run: .. code-block:: mysql - mysql> CREATE TABLESPACE foo ADD DATAFILE 'foo.ibd' ENCRYPTION='Y'; + mysql> CREATE TABLESPACE foo ADD DATAFILE 'foo.ibd' ENCRYPTION='Y'; To add an encrypted table to that table space run: @@ -75,8 +222,8 @@ Trying to add unencrypted table to this table space will result in an error: .. note:: - |Percona XtraBackup| currently doesn't support backup of encrypted general - tablespaces. + |Percona XtraBackup| currently doesn't support backup of encrypted general + tablespaces. Checking -------- @@ -103,46 +250,16 @@ number 13 set if tablespace is encrypted. This bit can be ckecked with System Variables ---------------- -.. variable:: innodb_sys_tablespace_encrypt - - :version 5.7.23-23: Implemented - :cli: ``--innodb-sys-tablespace-encrypt`` - :dyn: Yes - :scope: Global - :vartype: Boolean - :default: ``Off`` - -When this variable is enabled, all data in the InnoDB system tablespace are -encrypted. - -This feature is considered **ALPHA** quality. - -.. variable:: innodb_parallel_dblwr_encrypt - - :version 5.7.23-23: Implemented - :cli: ``--innodb_parallel_dblwr_encrypt`` - :dyn: Yes - :scope: Global - :vartype: Boolean - :default: ``Off`` - -When this variable is enabled, all data in the parallel double write buffer are -encrypted. - -This feature is considered **ALPHA** quality. - .. variable:: innodb_temp_tablespace_encrypt - :version 5.7.21-21: Implemented - :cli: ``--innodb-temp-tablespace-encrypt`` - :dyn: Yes - :scope: Global - :vartype: Boolean - :default: ``Off`` + :version 5.7.21-21: Implemented + :cli: ``--innodb-temp-tablespace-encrypt`` + :dyn: Yes + :scope: Global + :vartype: Boolean + :default: ``Off`` -This feature is considered **BETA** quality. - -When this option is turned on, the server starts to encrypt temporary tablespace +When this option is turned on, server starts to encrypt temporary tablespace and temporary |InnoDB| file-per-table tablespaces. The option does not force encryption of temporary tables which are currently opened, and it doesn't rebuild system temporary tablespace to encrypt data which are already written. @@ -154,34 +271,163 @@ Turning this option off at runtime makes server to create all subsequent temporary file-per-table tablespaces unencrypted, but does not turn off encryption of system temporary tablespace. -.. note:: To use this option, the keyring plugin must be loaded, otherwise - server will give an error message and refuse to create new temporary tables. +This feature is considered **BETA** quality. + +.. note:: To use this option, keyring plugin must be loaded, otherwise server + will give error message and refuse to create new temporary tables. .. variable:: innodb_encrypt_tables - :version 5.7.21-21: Implemented - :cli: ``--innodb-encrypt-tables`` - :dyn: Yes - :scope: Global - :vartype: Text - :default: ``OFF`` + :version 5.7.21-21: Implemented + :cli: ``--innodb-encrypt-tables`` + :dyn: Yes + :scope: Global + :vartype: Text + :default: ``OFF`` -This feature is considered **BETA** quality. +The implementation of the behavior controlled by this variable is considered +**BETA** quality. -This variable has 3 possible values. ``ON`` makes |InnoDB| tables encrypted by -default. ``FORCE`` disables creation of unencrypted tables. ``OFF`` restores -the like-before behavior. +This variable was ported from MariaDB and then extended to support key rotation. This +variable has the following possible values: -.. note:: ``innodb_encrypt_tables=ON`` still allows to create unencrypted - table with ``ENCRYPTED=NO`` statement, and also allows to create unencrypted - general tablespace. +.. rubric:: ON -.. note:: ``ALTER TABLE`` statement used without explicit ``ENCRYPTION=XXX`` - does not change current table encryption mode even if - :variable:`innodb_encrypt_tables` is set to ``ON`` or ``FORCE``. +New tables are created encrypted. You can create an unencrypted table by using +the ``ENCRYPTION=NO`` clause to the ``CREATE TABLE`` or ``ALTER TABLE`` +statement. + +.. rubric:: OFF + +By default, newly created tables are not encrypted. Add the ``ENCRYPTION=NO`` +clause in the ``CREATE TABLE`` or ``ALTER TABLE`` statement to create an +encrypted table. + +.. rubric:: FORCE + +New tables are created encrypted with the master key. Passing ``ENCRYPTION=NO`` +to ``CREATE TABLE`` or ``ALTER TABLE`` will result in an error and the table +will not be created or altered. + +If you alter a table which was created without encryption, note that it will not +be encrypted unless you use the ``ENCRYPTION`` clause explicitly. + +.. rubric:: KEYRING_ON + +:Availability: This value is **Alpha** quality + +New tables are created encrypted with the keyring as the default encryption. You +may specify a numeric key identifier and use a specific ``percona-innodb-`` key +from the keyring instead of the default key: + +.. code-block:: guess + + mysql> CREATE TABLE ... ENCRYPTION=’KEYRING’ ENCRYPTION_KEY_ID=NEW_ID + +**NEW_ID** is an unsigned 32-bit integer that refers to the numerical part of +the ``percona_innodb-`` key. When you assign a numerical identifer in the +``ENCRYPTION_KEY_ID`` clause, the server uses the latest version of the +corresponding key. For example, the clause ``ENCRYPTION_KEY_ID=2`` refers to the +latest version of the ``percona_innodb-2`` key from the keyring. + +In case the ``percona-innodb-`` key with the requested ID does not exist in the +keyring, |Percona Server| will create it with version 1. If a new +``percona-innodb-`` key cannot be created with the requested ID, the whole +``CREATE TABLE`` statement fails + +.. rubric:: FORCE_KEYRING + +:Availability: This value is **Alpha** quality + +New tables are created encrypted and keyring encryption is enforced. + +.. rubric:: ONLINE_TO_KEYRING + +:Availability: This value is **Alpha** quality + +All tables created or altered without the ``ENCRYPTION=NO`` clause +are encrypted with the latest version of the default encryption key. If a table +being altered is already encrypted with the master key, the table is recreated +encrypted with the latest version of the default encryption key. + +.. rubric:: ONLINE_TO_KEYRING_FORCE + +:Availability: This value is **Alpha** quality + +It is only possible to apply the keyring encryption when creating or altering +tables. + +.. note:: + + The ``ALTER TABLE`` statement changes the current encryption mode only if you + use the ``ENCRYPTION`` clause. + +.. seealso:: + + |MariaDB| Documentation: ``innodb_encrypt_tables`` Option + https://mariadb.com/kb/en/library/xtradbinnodb-server-system-variables/#innodb_encrypt_tables + +.. variable:: innodb_online_encryption_threads + + :version 5.7.23-24: Implemented + :cli: ``--innodb-online-encryption-threads`` + :dyn: Yes + :scope: Global + :vartype: Numeric + :default: 1 + +This variable works in combination with the :variable:`innodb_encrypt_tables` +variable set to ``ONLINE_TO_KEYRING``. This variable configures the number of +threads for background encryption. For the online encryption to work, this +variable must contain a value greater than **zero**. + +.. variable:: innodb_online_encryption_rotate_key_age + + :version 5.7.23-24: Implemented + :cli: ``--innodb-online-encryption-rotate-key-age`` + :dyn: Yes + :scope: Global + :vartype: Numeric + :default: 1 + +By using this variable, you can re-encrypt the table encrypted using +KEYRING. The value of this variable determines how frequently the encrypted +tables should be encrypted again. If it is set to **1**, the encrypted table is +re-encrypted on each key rotation. If it is set to **2**, the table is encrypted +on every other key rotation. + +.. _data-at-rest-encryption.undo-tablespace: + +InnoDB Undo Tablespace Encryption +================================================================================ + +:Availability: This feature is **Alpha** quality + +The encryption of InnoDB Undo tablespaces is only available when using +separate undo tablespaces. Otherwise, the InnoDB undo log is part of +the InnoDB system tablespace. + +.. seealso:: + + More information about how the encryption of the system tablespace + :ref:`data-at-rest-encryption.innodb-system-tablespace` + +System variables +-------------------------------------------------------------------------------- + +.. variable:: innodb_undo_log_encrypt + + :version 5.7.23-24: Implemented + :cli: ``--innodb-undo-log-encrypt`` + :dyn: Yes + :scope: Global + :vartype: Boolean + :default: ``Off`` + +Enables the encryption of InnoDB Undo tablespaces Binary log encryption -===================== +================================================================================ A new option, implemented since |Percona Server| :rn:`5.7.20-19`, is encryption of binary and relay logs, triggered by the @@ -202,7 +448,9 @@ keyring plugins. Dumping of encrypted binary logs involves decryption, and can be done using ``mysqlbinlog`` with ``--read-from-remote-server`` option. -.. note:: Taking into account that ``--read-from-remote-server`` option is only +.. note:: + + Taking into account that ``--read-from-remote-server`` option is only relevant to binary logs, encrypted relay logs can not be dumped/decrypted in this way. @@ -211,27 +459,99 @@ System Variables .. variable:: encrypt_binlog - :version 5.7.20-19: Implemented - :cli: ``--encrypt-binlog`` - :dyn: No - :scope: Global - :vartype: Boolean - :default: ``OFF`` + :version 5.7.20-19: Implemented + :cli: ``--encrypt-binlog`` + :dyn: No + :scope: Global + :vartype: Boolean + :default: ``OFF`` The variable turns on binary and relay logs encryption. +.. _ps.data-at-rest-encryption.redo-log: + +Redo Log Encryption +================================================================================ + +:Availability: This feature is **Alpha** quality + +InnoDB redo log encryption is enabled by setting the variable +:variable:`innodb_redo_log_encrypt`. This variable has three values: +``MASTER_KEY``, ``KEYRING_KEY`` and ``OFF`` (set by default). + +``MASTER_KEY`` uses the InnoDB master key to encrypt with unique keys for each +log file in the redo log header. + +``KEYRING_KEY`` uses the ``percona_redo`` versioned key from the keyring. When +:variable:`innodb_redo_log_encrypt` is set to ``KEYRING_KEY``, each new redo log +file is encrypted with the latest ``percona_redo`` key from the keyring. + +System variables +-------------------------------------------------------------------------------- + +.. variable:: innodb_redo_log_encrypt + + :version 5.7.23-24: Implemented + :cli: ``--innodb-redo-log-encrypt`` + :dyn: Yes + :scope: Global + :vartype: Text + :default: ``OFF`` + +Enables the encryption of the redo log. + +.. .. variable:: innodb_key_rotation_interval +.. +.. :version 5.7.23-24: Implemented +.. :cli: ``--innodb-key-rotation_interval`` +.. :dyn: Yes +.. :scope: Global +.. :vartype: Text +.. :default: ``0`` +.. +.. This variable stores the time (in seconds) that should pass between key +.. rotations. It is only used if :variable:`innodb_redo_log_encrypt` is set to +.. ``KEYRING_KEY``. +.. + +.. _data-at-rest-encryption.variable.innodb-scrub-log: + +.. variable:: innodb_scrub_log + + :version 5.7.23-24: Implemented + :cli: ``--innodb-scrub-log`` + :dyn: Yes + :scope: Global + :vartype: Boolean + :default: ``OFF`` + +Specifies if data scrubbing should be automatically applied to the redo log. + + +.. variable:: innodb_scrub_log_speed + + :version 5.7.23-24: Implemented + :cli: ``--innodb-scrub-log-speed`` + :dyn: Yes + :scope: Global + :vartype: Text + :default: + +Specifies the velocity of data scrubbing (writing dummy redo log records) in bytes per second. + + Temporary file encryption ========================= -A new feature, implemented since |Percona Server| :rn:`5.7.22-22`, is +A new feature, implemented since |Percona Server| :rn:`5.7.22-22`, is the encryption of temporary files, triggered by the :variable:`encrypt-tmp-files` option. -This feature is considered **BETA** quality. - Temporary files are currently used in |Percona Server| for the following purposes: +This feature is considered **ALPHA** quality. + * filesort (for example, ``SELECT`` statements with ``SQL_BIG_RESULT`` hints), * binary log transactional caches, @@ -246,15 +566,34 @@ System Variables .. variable:: encrypt-tmp-files - :version 5.7.22-22: Implemented - :cli: ``--encrypt-tmp-files`` - :dyn: No - :scope: Global - :vartype: Boolean - :default: ``OFF`` + :version 5.7.22-22: Implemented + :cli: ``--encrypt-tmp-files`` + :dyn: No + :scope: Global + :vartype: Boolean + :default: ``OFF`` The option turns on encryption of temporary files created by |Percona Server|. +.. _data-at-rest-encryption.key-rotation: + +Key Rotation +================================================================================ + +The keyring management is enabled for each tablespace separately when you set +the encryption in the ``ENCRYPTION`` clause, to `KEYRING` in the supported SQL +statement: + +- CREATE TABLE .. ENCRYPTION='KEYRING` +- ALTER TABLE ... ENCRYPTION='KEYRING' +- CREATE TABLESPACE tablespace_name … ENCRYPTION=’KEYRING’ + +.. note:: + + Running ``ALTER TABLE .. ENCRYPTION=’Y’`` on the tablespace created with + ``ENCRYPTION=’KEYRING’`` converts the table back to the existing MySQL + scheme. + .. _keyring_vault_plugin: Keyring Vault plugin @@ -268,24 +607,24 @@ Installation ------------ The safest way to load the plugin is to do it on the server startup by -using `--early-plugin-load variable +using `--early-plugin-load option `_ option: .. code-block:: bash - --early-plugin-load="keyring_vault=keyring_vault.so" \ - --loose-keyring_vault_config="/home/mysql/keyring_vault.conf" + $ mysqld --early-plugin-load="keyring_vault=keyring_vault.so" \ + --loose-keyring_vault_config="/home/mysql/keyring_vault.conf" It should be loaded this way to be able to facilitate recovery for encrypted tables. .. warning:: - If server should be started with several plugins loaded early, - ``--early-plugin-load`` should contain their list separated by semicolons. Also - it's a good practice to put this list in double quotes so that semicolons - do not create problems when executed in a script. + If server should be started with several plugins loaded early, + ``--early-plugin-load`` should contain their list separated by + semicolons. Also it's a good practice to put this list in double quotes so + that semicolons do not create problems when executed in a script. Apart from installing plugin you also need to set the :variable:`keyring_vault_config` variable. This variable should point to the @@ -300,7 +639,7 @@ To enable the functions you'll need to install the ``keyring_udf`` plugin: .. code-block:: mysql - mysql> INSTALL PLUGIN keyring_udf SONAME 'keyring_udf.so'; + mysql> INSTALL PLUGIN keyring_udf SONAME 'keyring_udf.so'; Usage ----- @@ -363,33 +702,81 @@ System Variables .. variable:: keyring_vault_config - :version 5.7.20-18: Implemented - :cli: ``--keyring-vault-config`` - :dyn: Yes - :scope: Global - :vartype: Text - :default: + :version 5.7.20-18: Implemented + :cli: ``--keyring-vault-config`` + :dyn: Yes + :scope: Global + :vartype: Text + :default: This variable is used to define the location of the :ref:`keyring_vault_plugin` configuration file. .. variable:: keyring_vault_timeout - :version 5.7.21-20: Implemented - :cli: ``--keyring-vault-timeout`` - :dyn: Yes - :scope: Global - :vartype: Numeric - :default: ``15`` + :version 5.7.21-20: Implemented + :cli: ``--keyring-vault-timeout`` + :dyn: Yes + :scope: Global + :vartype: Numeric + :default: ``15`` This variable allows to set the duration in seconds for the Vault server connection timeout. Default value is ``15``. Allowed range is from ``1`` second to ``86400`` seconds (24 hours). The timeout can be also completely disabled to wait infinite amount of time by setting this variable to ``0``. -Other reading -------------- +.. _data-at-rest-encryption.data-scrubbing: + +Data Scrubbing +================================================================================ + +While data encryption ensures that the existing data are not stored in plain +form, the data scrubbing literally removes the data once the user decides they +should be deleted. Compare this behavior with how the ``DELETE`` statement works +which only marks the affected data as *deleted* - the space claimed by this data +is overwritten with new data later. + +Once enabled, data scrubbing works automatically on each tablespace +separately. To enable data scrubbing, you need to set the following variables: + +- :variable:`innodb-background-scrub-data-uncompressed` +- :variable:`innodb-background-scrub-data-compressed` + +Uncompressed tables can also be scrubbed immediately, independently of key +rotation or background threads. This can be enabled by setting the variable +:variable:`innodb-immediate-scrub-data-uncompressed`. This option is not supported for +compressed tables. + +Note that data scrubbing is made effective by setting the +:variable:`innodb_online_encryption_threads` variable to a value greater than +**zero**. + +System Variables +-------------------------------------------------------------------------------- + +.. variable:: innodb_background_scrub_data_compressed + + :version 5.7.23-24: Implemented + :cli: ``--innodb-background-scrub-data-compressed`` + :dyn: Yes + :scope: Global + :vartype: Boolean + :default: ``OFF`` + +.. variable:: innodb_background_scrub_data_uncompressed + + :version 5.7.23-24: Implemented + :cli: ``--innodb-background-scrub-data-uncompressed`` + :dyn: Yes + :scope: Global + :vartype: Boolean + :default: ``OFF`` + + +.. seealso:: -* `Vault Documentation `_ -* `General-Purpose Keyring Key-Management Functions - `_ + Vault Documentation + https://www.vaultproject.io/docs/index.html + |MySQL| Documentation: General-Purpose Keyring Key-Management Functions + https://dev.mysql.com/doc/refman/5.7/en/keyring-udfs-general-purpose.html diff --git a/doc/source/myrocks/variables.rst b/doc/source/myrocks/variables.rst index b590b9cd7a08..252fc1836d10 100644 --- a/doc/source/myrocks/variables.rst +++ b/doc/source/myrocks/variables.rst @@ -66,7 +66,7 @@ Also, all variables can exist in one or both of the following scopes: - Global * - :variable:`rocksdb_block_cache_size` - Yes - - No + - Yes - Global * - :variable:`rocksdb_block_restart_interval` - Yes @@ -372,6 +372,10 @@ Also, all variables can exist in one or both of the following scopes: - Yes - No - Global + * - :variable:`rocksdb_no_create_column_family` + - Yes + - No + - Global * - :variable:`rocksdb_override_cf_options` - Yes - No @@ -1806,6 +1810,20 @@ Specifies whether to disable the block cache for column families. Variable is disabled by default, meaning that using the block cache is allowed. +.. variable:: rocksdb_no_create_column_family + + :version 5.7.23-24: Implemented + :cli: ``--rocksdb-no-create-column-family`` + :dyn: No + :scope: Global + :vartype: Boolean + :default: ``OFF`` + +Specifies whether column families can created implicitly via an index comment. +If this variable is set to ``ON``, then column families must already exist or +must be present within the :variable:`rocksdb_override_cf_options` for a user to +assign and index to a column family. + .. variable:: rocksdb_override_cf_options :version 5.7.19-17: Implemented diff --git a/doc/source/ps-variables.rst b/doc/source/ps-variables.rst index fde361e32fe8..563e7d5f9a28 100644 --- a/doc/source/ps-variables.rst +++ b/doc/source/ps-variables.rst @@ -87,6 +87,16 @@ System Variables - Yes - Both - Yes + * - :variable:`encrypt_binlog` + - Yes + - Yes + - Global + - No + * - :variable:`encrypt-tmp-files` + - Yes + - Yes + - Global + - No * - :variable:`enforce_storage_engine` - Yes - Yes @@ -127,6 +137,16 @@ System Variables - No - Global - No + * - :variable:`innodb_background_scrub_data_compressed` + - Yes + - Yes + - Global + - Yes + * - :variable:`innodb_background_scrub_data_uncompressed` + - Yes + - Yes + - Global + - Yes * - :variable:`innodb_cleaner_lsn_age_factor` - Yes - Yes @@ -137,6 +157,11 @@ System Variables - Yes - Global - Yes + * - :variable:`innodb_default_encryption_key_id` + - Yes + - Yes + - Session + - Yes * - :variable:`innodb_empty_free_list_algorithm` - Yes - Yes @@ -167,11 +192,41 @@ System Variables - Yes - Global - Yes + * - :variable:`innodb_online_encryption_rotate_key_age` + - Yes + - Yes + - Global + - Yes + * - :variable:`innodb_online_encryption_threads` + - Yes + - Yes + - Global + - Yes + * - :variable:`innodb_parallel_dblwr_encrypt` + - Yes + - Yes + - Global + - Yes * - :variable:`innodb_print_lock_wait_timeout_info` - Yes - Yes - Global - Yes + * - :variable:`innodb_redo_log_encrypt` + - Yes + - Yes + - Global + - Yes + * - :variable:`innodb_scrub_log` + - Yes + - Yes + - Global + - Yes + * - :variable:`innodb_scrub_log_speed` + - Yes + - Yes + - Global + - Yes * - :variable:`innodb_show_locks_held` - Yes - Yes @@ -182,6 +237,11 @@ System Variables - Yes - Global - Yes + * - :variable:`innodb_sys_tablespace_encrypt` + - Yes + - Yes + - Global + - No * - :variable:`innodb_temp_tablespace_encrypt` - Yes - Yes @@ -192,6 +252,11 @@ System Variables - Yes - Global - No + * - :variable:`innodb_undo_log_encrypt` + - Yes + - Yes + - Global + - Yes * - :variable:`innodb_use_global_flush_log_at_trx_commit` - Yes - Yes diff --git a/doc/source/release-notes/Percona-Server-5.7.23-24.rst b/doc/source/release-notes/Percona-Server-5.7.23-24.rst new file mode 100644 index 000000000000..59b003b30628 --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.7.23-24.rst @@ -0,0 +1,51 @@ +.. rn:: 5.7.23-24 + +================================================================================ +Percona Server 5.7.23-24 +================================================================================ + +Percona announces the release of `Percona Server for MySQL +`_ 5.7.23-24 on November 9, +2018 (downloads are available `here +`_ and from the `Percona +Software Repositories +`_). +This release merges changes of `MySQL 5.7.23 +`_, including +all the bug fixes in it. Percona Server for MySQL 5.7.23-24 is now the current +GA release in the 5.7 series. All of Percona’s software is open-source and free. + +This release introduces InnoDB encryption improvements and merges upstream +MyRocks changes. Also, the usage of column families in MyRocks has been +improved. The InnoDB encryption improvements are in **Alpha** quality and are +not recommended to be used in production. + +New Features +================================================================================ + +- :psbug:`4905`: Upstream MyRocks changes have been merged up to `prod201810` tag +- :psbug:`4976`: :ref:`InnoDB Undo Log Encryption ` has been implemented +- :psbug:`4946`: Add the ``rocksdb_no_create_column_family`` option to prevent the implicit creation of column families in MyRocks +- :psbug:`4556`: InnoDB :ref:`ps.data-at-rest-encryption.redo-log` has been implemented +- :psbug:`3839`: :ref:`InnoDB Data Scrubbing ` has been implemented +- :psbug:`3834`: :ref:`InnoDB Log Scrubbing ` has been implemented +- :psbug:`3829`: :ref:`InnoDB Key Rotation ` + +Bugs Fixed +================================================================================ + +- :psbug:`4723`: ``PURGE CHANGED_PAGE_BITMAPS`` did not work when ``innodb_data_home_dir`` was used +- :psbug:`4937`: ``rocksdb_update_cf_options`` was ignored when specified in ``my.cnf`` or on command line +- :psbug:`1107`: The binlog could be corrupted when tmpdir got full +- :psbug:`4834`: The encrypted system tablespace could have an empty uuid +- :psbug:`3906`: The server instance could crash when running the ``ALTER`` statement + +.. rubric:: Other bugs fixed + +- :psbug:`4106`: "Assertion ``log.getting_synced`` failed in ``rocksdb::DBImpl::MarkLogsSynced(uint64_t, bool, const rocksdb::Status&)``" +- :psbug:`4930`: "main.percona_log_slow_innodb: Result content mismatch" +- :psbug:`4811`: "5.7 Merge and fixup for old DB-937 introduces possible regression" +- :psbug:`4705`: "crash on snapshot size check in RocksDB" + +Find the release notes for Percona Server for MySQL 5.7.23-24 in our `online documentation `_. Report +bugs in the `Jira bug tracker `_. diff --git a/doc/source/release-notes/Percona-Server-5.7.23-25.rst b/doc/source/release-notes/Percona-Server-5.7.23-25.rst new file mode 100644 index 000000000000..3ae029cfa7cb --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.7.23-25.rst @@ -0,0 +1,30 @@ +.. rn:: 5.7.23-25 + +================================================================================ +Percona Server 5.7.23-25 +================================================================================ + +Percona announces the release of `Percona Server for MySQL +`_ 5.7.23-25 on November 21, +2018 (downloads are available `here +`_ and from the `Percona +Software Repositories +`_). +This release merges changes of `MySQL 5.7.23 +`_, including +all the bug fixes in it. Percona Server for MySQL 5.7.23-25 is now the current +GA release in the 5.7 series. All of Percona’s software is open-source and free. + +This release fixes a critical bug in a RocksDB submodule. + +Bugs Fixed +================================================================================ + +- :psbug:`5049`: A severe memory leak regression in the RocksDB Block Cache + +Find the release notes for Percona Server for MySQL 5.7.23-24 in our `online +documentation +`_. +Report bugs in the `Jira bug tracker `_. + +.. |release| replace:: 5.7.23-25 diff --git a/doc/source/release-notes/release-notes_index.rst b/doc/source/release-notes/release-notes_index.rst index ee59e46ef6b5..0581e2c93793 100644 --- a/doc/source/release-notes/release-notes_index.rst +++ b/doc/source/release-notes/release-notes_index.rst @@ -6,6 +6,8 @@ :maxdepth: 1 :glob: + Percona-Server-5.7.23-25 + Percona-Server-5.7.23-24 Percona-Server-5.7.23-23 Percona-Server-5.7.22-22 Percona-Server-5.7.21-21 diff --git a/doc/source/upstream-bug-fixes.rst b/doc/source/upstream-bug-fixes.rst index 5ae23815f3c4..4ff7a5dfefdd 100644 --- a/doc/source/upstream-bug-fixes.rst +++ b/doc/source/upstream-bug-fixes.rst @@ -1,25 +1,25 @@ .. _upstream_bug_fixes: -============================================================ -List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 -============================================================ +============================================================== +List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +============================================================== +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`91541` - Flush status statement adds twice to global values | |:JIRA bug: :psbug:`4570` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.23-23 | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`91423` - Can\'t run mysql on Ubuntu systems with long recovery time | |:JIRA bug: :psbug:`4546` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.23-23 | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`91091` - A simple SELECT on a table with CHARSET=euckr COLLATE=euckr_bin ... | |:JIRA bug: :psbug:`4513` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.23-23 | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ @@ -31,25 +31,25 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`90238` - Comparison of uninitailized memory in log_in_use | |:JIRA bug: :psbug:`3925` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Closed | |:Fix Released: 5.7.21-21 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89916` - hp_test1/hp_test2 are not built unless WITH_EMBEDDED_SERVER is defined | |:JIRA bug: :psbug:`3845` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Won't fix | |:Fix Released: 5.7.21-21 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89822` - InnoDB retries open on EINTR error only if innodb_use_native_aio is ... | |:JIRA bug: :psbug:`3843` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.21-21 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89646` - Clang warnings in 5.7.21 | |:JIRA bug: :psbug:`3814` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Won't fix | |:Fix Released: 5.7.21-21 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -61,7 +61,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89422` - Dangerous enum-ulong casts in sql_formatter_options | |:JIRA bug: :psbug:`3780` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.21-20 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -73,7 +73,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89420` - Enforcing C++03 mode in non debug builds | |:JIRA bug: :psbug:`3780` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.21-20 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -85,13 +85,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`88057` - Intermediary slave does not log master changes with... | |:JIRA bug: :psbug:`1119` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.20-19 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`87065` - Release lock on table statistics after query plan created | |:JIRA bug: :psbug:`2503` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.20-18 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -109,13 +109,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`86164` - Fulltext search can not find word which contains punctuation marks | |:JIRA bug: :psbug:`2501` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.21-20 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`86016` - Make MTR show core dump stacktraces from unit tests too | |:JIRA bug: :psbug:`2499` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.18-16 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -151,13 +151,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85158` - heartbeats/fakerotate cause a forced sync_master_info | |:JIRA bug: :psbug:`1812` | -|:Upstream State: Open (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.20-19 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85141` - Write/fsync amplification w/ duplicate GTIDs | |:JIRA bug: :psbug:`1786` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.18-14 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -175,7 +175,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84420` - stopwords and ngram indexes | |:JIRA bug: :psbug:`1802` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.20-18 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -187,7 +187,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84366` - InnoDB index dives do not detect concurrent tree changes, return bogus... | |:JIRA bug: :psbug:`1089` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.17-11 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -235,7 +235,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82935` - Cipher ECDHE-RSA-AES128-GCM-SHA256 listed in man/Ssl_cipher_list, not... | |:JIRA bug: :psbug:`1737` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.15-9 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -259,7 +259,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82026` - Stack buffer overflow with --ssl-cipher= | |:JIRA bug: :psbug:`2155` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Closed | |:Fix Released: 5.7.14-7 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -271,13 +271,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81814` - InnoDB adaptive hash index uses a bad partitioning algorithm for the ... | |:JIRA bug: :psbug:`2498` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.18-14 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81810` - Inconsistent sort order for blob/text between InnoDB and filesort | |:JIRA bug: :psbug:`1799` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Closed | |:Fix Released: 5.7.18-14 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -301,7 +301,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81467` - innodb_fts.sync_block test unstable due to slow query log nondeterminism | |:JIRA bug: :psbug:`2232` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.17-12 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -325,7 +325,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80496` - buf_dblwr_init_or_load_pages now returns an error code, but caller not... | |:JIRA bug: :psbug:`3384` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.11-4 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -337,13 +337,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80053` - Assertion in binlog coordinator on slave with 2 2pc handler log_slave ... | |:JIRA bug: :psbug:`3361` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-2 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79894` - Page cleaner worker threads are not instrumented for performance schema | |:JIRA bug: :psbug:`3356` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-2 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -355,7 +355,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79610` - Failed DROP DATABASE due FK constraint on master breaks slave | |:JIRA bug: :psbug:`1683` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.14-7 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -373,7 +373,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`78894` - buf_pool_resize can lock less in checking whether AHI is on or off | |:JIRA bug: :psbug:`3340` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -385,13 +385,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`77591` - ALTER TABLE does not allow to change NULL/NOT NULL if foreign key exists | |:JIRA bug: :psbug:`1635` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`77399` - Deadlocks missed by INFORMATION_SCHEMA.INNODB_METRICS lock_deadlocks ... | |:JIRA bug: :psbug:`1635` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -403,7 +403,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`76142` - InnoDB tablespace import fails when importing table w/ different data ... | |:JIRA bug: :psbug:`1697` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.13-6 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -415,7 +415,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75504` - btr_search_guess_on_hash makes found block young twice? | |:JIRA bug: :psbug:`2454` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -427,31 +427,31 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75311` - Error for SSL cipher is unhelpful | |:JIRA bug: :psbug:`1779` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.17-12 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75189` - engines suite tests depending on InnoDB implementation details | |:JIRA bug: :psbug:`2103` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`74637` - make dirty page flushing more adaptive | |:JIRA bug: :ref:`Multi-threaded asynchronous LRU flusher ` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-3 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`73418` - Add --manual-lldb option to mysql-test-run.pl | |:JIRA bug: :psbug:`2448` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72615` - MTR --mysqld=--default-storage-engine=foo incompatible w/ dynamically... | |:JIRA bug: :psbug:`2071` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -463,25 +463,25 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72466` - More memory overhead per page in the InnoDB buffer pool | |:JIRA bug: :psbug:`1689` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.12-5 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72123` - Spurious lock_wait_timeout_thread wakeup in lock_wait_suspend_thread() | |:JIRA bug: :psbug:`2504` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.18-16 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72108` - Hard to read history file | |:JIRA bug: :psbug:`2066` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71761` - ANALYZE TABLE should remove its table from background stat processing... | |:JIRA bug: :psbug:`1749` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.15-9 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -493,37 +493,37 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed ... | |:JIRA bug: :psbug:`1461` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71270` - Failures to end bulk insert for partitioned tables handled incorrectly | |:JIRA bug: :psbug:`700` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71217` - Threadpool - add thd_wait_begin/thd_wait_end to the network IO functions | |:JIRA bug: :psbug:`1343` | -|:Upstream State: Open (checked on 2018-09-04) | +|:Upstream State: Open (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71183` - os_file_fsync() should handle fsync() returning EINTR | |:JIRA bug: :psbug:`1461` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71091` - CSV engine does not properly process "", in quotes | |:JIRA bug: :psbug:`153` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`70500` - Page cleaner should perform LRU flushing regardless of server activity | |:JIRA bug: :psbug:`1428` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -535,13 +535,13 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69991` - MySQL client is broken without readline | |:JIRA bug: :psbug:`1467` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69639` - mysql failed to build with dtrace Sun D 1.11 | |:JIRA bug: :psbug:`1392` | -|:Upstream State: Unsupported (checked on 2018-09-04) | +|:Upstream State: Unsupported (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -553,19 +553,19 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69232` - buf_dblwr->mutex can be splited into two | |:JIRA bug: :ref:`parallel_doublewrite_buffer` | -|:Upstream State: No Feedback (checked on 2018-09-04) | +|:Upstream State: No Feedback (checked on 2018-11-21) | |:Fix Released: 5.7.11-4 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69170` - buf_flush_LRU is lazy | |:JIRA bug: :psbug:`2430` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69146` - Needless log flush order mutex acquisition in buf_pool_get_oldest_mod... | |:JIRA bug: :psbug:`2418` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -577,7 +577,7 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`68481` - InnoDB LRU flushing for MySQL 5.6 needs work | |:JIRA bug: :psbug:`2432` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ @@ -589,67 +589,67 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`67808` - in innodb engine, double write and multi-buffer pool instance reduce ... | |:JIRA bug: :ref:`parallel_doublewrite_buffer` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.11-4 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`63130` - CMake-based check for the presence of a system readline library is not... | |:JIRA bug: :psbug:`1467` | -|:Upstream State: Can't Repeat (checked on 2018-09-04) | +|:Upstream State: Can't Repeat (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`57583` - fast index create not used during "alter table foo engine=innodb" | |:JIRA bug: :psbug:`2113` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`53645` - SHOW GRANTS not displaying all the applicable grants | |:JIRA bug: :psbug:`191` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`53588` - Blackhole : Specified key was too long; max key length is 1000 bytes | |:JIRA bug: :psbug:`1126` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.20-19 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`49120` - mysqldump should have flag to delay creating indexes for innodb plugin... | |:JIRA bug: :psbug:`2619` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`42415` - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... | |:JIRA bug: :psbug:`44` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`39833` - CREATE INDEX does full table copy on TEMPORARY table | |:JIRA bug: N/A | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`35125` - Allow the ability to set the server_id for a connection for logging to... | |:Launchpad BP: `Blueprint `_ | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`25007` - memory tables with dynamic rows format | |:JIRA bug: :psbug:`2407` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`20001` - Support for temp-tables in INFORMATION_SCHEMA | |:JIRA bug: :ref:`temp_tables` | -|:Upstream State: Verified (checked on 2018-09-04) | +|:Upstream State: Verified (checked on 2018-11-21) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ From f9fe1cbe334ebb398cfdba7cdada0e511d0e90b2 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Mon, 3 Dec 2018 19:26:16 +0200 Subject: [PATCH 116/214] Release notes for 5.7.24-26 --- doc/source/conf.py | 2 +- .../Percona-Server-5.7.24-26.rst | 61 ++++ .../release-notes/release-notes_index.rst | 1 + doc/source/upstream-bug-fixes.rst | 342 +++++++++--------- 4 files changed, 237 insertions(+), 169 deletions(-) create mode 100644 doc/source/release-notes/Percona-Server-5.7.24-26.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index e2944818d685..bb50f8444c37 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -54,7 +54,7 @@ # The short X.Y version. version = '5.7' # The full version, including alpha/beta/rc tags. -release = '5.7.23-25' +release = '5.7.24-26' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/release-notes/Percona-Server-5.7.24-26.rst b/doc/source/release-notes/Percona-Server-5.7.24-26.rst new file mode 100644 index 000000000000..d2fde1981a58 --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.7.24-26.rst @@ -0,0 +1,61 @@ +.. rn:: 5.7.23-26 + +================================================================================ +Percona Server |release| +================================================================================ + +Percona announces the release of `Percona Server for MySQL +`_ |release| on December 4, +2018 (downloads are available `here +`_ and from the `Percona +Software Repositories +`_). +This release merges changes of `MySQL 5.7.24 +`_, including +all the bug fixes in it. Percona Server for MySQL |release| is now the current +GA release in the 5.7 series. All of Percona’s software is open-source and free. + +Improvements +================================================================================ + +- :psbug:`4790`: Improve user statistics accuracy + +Bugs Fixed +================================================================================ + +- Slave replication could break if upstream bug #74145 (FLUSH LOGS improperly + disables the logging if the log file cannot be accessed) occurred in + master. Bug fixed :psbug:`1017` (Upstream :mysqlbug:`83232`). +- Setting the :variable:`tokudb_last_lock_timeout` variable via the command line + could cause the server to stop working when the actual timeout took place. Bug + fixed :psbug:`4943`. +- Dropping TokuDB table with non-alphanumeric characters could lead to a + crash. Bug fixed :psbug:`4979`. +- When using MyRocks storage engine, the server could crash after running + ``ALTER TABLE DROP INDEX`` on a slave. Bug fixed :psbug:`4744`. +- The audit log could be corrupted when the ``audit_log_rotations`` variable was + changed at runtime. Bug fixed :psbug:`4950`. + +.. rubric:: Other Bugs Fixed + +- :psbug:`4781`: sql_yacc.yy uses SQLCOM_SELECT instead of SQLCOM_SHOW_XXXX_STATS +- :psbug:`4881`: Add LLVM/clang 7 to Travis-CI +- :psbug:`4825`: Backport MTR fixes from 8.0 +- :psbug:`4998`: Valgrind: compilation fails with: writing to ‘struct buf_buddy_free_t’ with no trivial copy-assignment +- :psbug:`4980`: Valgrind: Syscall param write(buf) points to uninitialised byte(s): Event_encrypter::encrypt_and_write() +- :psbug:`4982`: Valgrind: Syscall param io_submit(PWRITE) points to uninitialised byte(s): buf_dblwr_write_block_to_datafile() +- :psbug:`4983`: Valgrind: Syscall param io_submit(PWRITE) points to uninitialised byte(s): buf_flush_write_block_low() +- :psbug:`4951`: Many libc-related Valgrind errors on CentOS7 +- :psbug:`5012`: Valgrind: misused UNIV_MEM_ALLOC after ut_zalloc_nokey +- :psbug:`4908`: UBSan and valgrind errors with encrypted temporary files +- :psbug:`4532`: Replace obsolete HAVE_purify with HAVE_VALGRIND in ha_rocksdb.cc +- :psbug:`4955`: Backport mysqld fixes for valgrind warnings from 8.0 +- :psbug:`4529`: MTR: index_merge_rocksdb2 inadvertently tests InnoDB instead of MyRocks +- :psbug:`5056`: handle_fatal_signal (sig=11) in ha_tokudb::write_row +- :psbug:`5084`: innodb_buffer_pool_size is an uninitialized variable +- :psbug:`4836`: Missing PFS signed variable aggregation +- :psbug:`5033`: rocksdb.show_engine: Result content mismatch +- :psbug:`5034`: rocksdb.rocksdb: Result content mismatch +- :psbug:`5035`: rocksdb.show_table_status: 1051: Unknown table 'db_new' + +.. |release| replace:: 5.7.24-26 diff --git a/doc/source/release-notes/release-notes_index.rst b/doc/source/release-notes/release-notes_index.rst index 0581e2c93793..f58d01b0baf7 100644 --- a/doc/source/release-notes/release-notes_index.rst +++ b/doc/source/release-notes/release-notes_index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 :glob: + Percona-Server-5.7.24-26 Percona-Server-5.7.23-25 Percona-Server-5.7.23-24 Percona-Server-5.7.23-23 diff --git a/doc/source/upstream-bug-fixes.rst b/doc/source/upstream-bug-fixes.rst index 4ff7a5dfefdd..73e5a4cc91b9 100644 --- a/doc/source/upstream-bug-fixes.rst +++ b/doc/source/upstream-bug-fixes.rst @@ -1,655 +1,661 @@ .. _upstream_bug_fixes: -============================================================== -List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 -============================================================== +============================================================ +List of upstream |MySQL| bugs fixed in |Percona Server| 5.7 +============================================================ +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`91541` - Flush status statement adds twice to global values | |:JIRA bug: :psbug:`4570` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.23-23 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.23-23` | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`91423` - Can\'t run mysql on Ubuntu systems with long recovery time | |:JIRA bug: :psbug:`4546` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.23-23 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.23-23` | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`91091` - A simple SELECT on a table with CHARSET=euckr COLLATE=euckr_bin ... | |:JIRA bug: :psbug:`4513` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.23-23 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.23-23` | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`90264` - Some file operations in mf_iocache2.c are not instrumented | |:JIRA bug: :psbug:`3937` | |:Upstream State: Closed | -|:Fix Released: 5.7.21-21 | +|:Fix Released: :rn:`5.7.21-21` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`90238` - Comparison of uninitailized memory in log_in_use | |:JIRA bug: :psbug:`3925` | |:Upstream State: Closed | -|:Fix Released: 5.7.21-21 | +|:Fix Released: :rn:`5.7.21-21` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89916` - hp_test1/hp_test2 are not built unless WITH_EMBEDDED_SERVER is defined | |:JIRA bug: :psbug:`3845` | |:Upstream State: Won't fix | -|:Fix Released: 5.7.21-21 | +|:Fix Released: :rn:`5.7.21-21` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89822` - InnoDB retries open on EINTR error only if innodb_use_native_aio is ... | |:JIRA bug: :psbug:`3843` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.21-21 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.21-21` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89646` - Clang warnings in 5.7.21 | |:JIRA bug: :psbug:`3814` | |:Upstream State: Won't fix | -|:Fix Released: 5.7.21-21 | +|:Fix Released: :rn:`5.7.21-21` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89598` - plugin_mecab.cc:54:19: warning: unused variable 'bundle_mecab' | |:JIRA bug: :psbug:`3804` | |:Upstream State: Closed | -|:Fix Released: 5.7.21-20 | +|:Fix Released: :rn:`5.7.21-20` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89422` - Dangerous enum-ulong casts in sql_formatter_options | |:JIRA bug: :psbug:`3780` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.21-20 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.21-20` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89421` - Missing mutex_unlock in Slave_reporting_capability::va_report | |:JIRA bug: :psbug:`3780` | |:Upstream State: Closed | -|:Fix Released: 5.7.21-20 | +|:Fix Released: :rn:`5.7.21-20` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89420` - Enforcing C++03 mode in non debug builds | |:JIRA bug: :psbug:`3780` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.21-20 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.21-20` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`89205` - gap locks on READ COMMITTED cause by page split | |:JIRA bug: :psbug:`1130` | |:Upstream State: Closed | -|:Fix Released: 5.7.22-22 | +|:Fix Released: :rn:`5.7.22-22` | |:Upstream Fix: 5.7.20 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`88057` - Intermediary slave does not log master changes with... | |:JIRA bug: :psbug:`1119` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.20-19 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.20-19` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`87065` - Release lock on table statistics after query plan created | |:JIRA bug: :psbug:`2503` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.20-18 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.20-18` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`86260` - Assert on KILL'ing a stored routine invocation | |:JIRA bug: :psbug:`1091` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-16 | +|:Fix Released: :rn:`5.7.18-16` | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`86209` - audit plugin + MB collation connection + PREPARE stmt parse error crash...| |:JIRA bug: :psbug:`1089` | |:Upstream State: N/A | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`86164` - Fulltext search can not find word which contains punctuation marks | |:JIRA bug: :psbug:`2501` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.21-20 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.21-20` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`86016` - Make MTR show core dump stacktraces from unit tests too | |:JIRA bug: :psbug:`2499` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.18-16 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.18-16` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85838` - rpl_diff.inc in 5.7 does not compare data from different servers | |:JIRA bug: :psbug:`2257` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85835` - server crash n-gram full text searching | |:JIRA bug: :psbug:`237` | |:Upstream State: N/A | -|:Fix Released: 5.7.18-15 | +|:Fix Released: :rn:`5.7.18-15` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85678` - field-t deletes Fake_TABLE objects through base TABLE pointer w/o ... | |:JIRA bug: :psbug:`2253` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: 5.7.19 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85671` - segfault-t failing under recent AddressSanitizer | |:JIRA bug: :psbug:`2252` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85258` - DROP TEMPORARY TABLE creates a transaction in binary log on read only... | |:JIRA bug: :psbug:`1785` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85158` - heartbeats/fakerotate cause a forced sync_master_info | |:JIRA bug: :psbug:`1812` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.20-19 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.20-19` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`85141` - Write/fsync amplification w/ duplicate GTIDs | |:JIRA bug: :psbug:`1786` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.18-14 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84736` - 5.7 range optimizer crash | |:JIRA bug: :psbug:`1055` | |:Upstream State: N/A | -|:Fix Released: 5.7.17-12 | +|:Fix Released: :rn:`5.7.17-12` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84437` - super-read-only does not allow FLUSH LOGS on 5.7 | |:JIRA bug: :psbug:`1772` | |:Upstream State: Closed | -|:Fix Released: 5.7.17-12 | +|:Fix Released: :rn:`5.7.17-12` | |:Upstream Fix: 5.7.18 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84420` - stopwords and ngram indexes | |:JIRA bug: :psbug:`1802` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.20-18 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.20-18` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84415` - slave don't report Seconds_Behind_Master when running ... | |:JIRA bug: :psbug:`1770` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: 5.7.22 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84366` - InnoDB index dives do not detect concurrent tree changes, return bogus... | |:JIRA bug: :psbug:`1089` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.17-11 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.17-11` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`84350` - Error 1290 executing flush logs in read-only slave | |:JIRA bug: :psbug:`1044` | |:Upstream State: Closed | -|:Fix Released: 5.7.17-12 | +|:Fix Released: :rn:`5.7.17-12` | |:Upstream Fix: 5.7.18 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`83814` - Add support for OpenSSL 1.1 | |:JIRA bug: :psbug:`1105` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-16 | +|:Fix Released: :rn:`5.7.18-16` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`83648` - Assertion failure in thread x in file fts0que.cc line 3659 | |:JIRA bug: :psbug:`1023` | |:Upstream State: N/A | -|:Fix Released: 5.7.17-12 | +|:Fix Released: :rn:`5.7.17-12` | +|:Upstream Fix: N/A | ++-------------------------------------------------------------------------------------------------------------+ +|:Upstream Bug: :mysqlbug:`83232` - replication breaks after bug #74145 happens in master | +|:JIRA bug: :psbug:`1017` | +|:Upstream State: Closed | +|:Fix Released: :rn:`5.7.24-26` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`83124` - Bug 81657 fix merge to 5.6 broken | |:JIRA bug: :psbug:`1750` | |:Upstream State: Closed | -|:Fix Released: 5.7.15-9 | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: 5.7.17 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`83073` - GCC 5 and 6 miscompile mach_parse_compressed | |:JIRA bug: :psbug:`1745` | |:Upstream State: Closed | -|:Fix Released: 5.7.15-9 | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: 5.7.17 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`83003` - Using temporary tables on slaves increases GTID sequence number | |:JIRA bug: :psbug:`964` | |:Upstream State: Closed | -|:Fix Released: 5.7.17-11 | +|:Fix Released: :rn:`5.7.17-11` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82980` - Multi-threaded slave leaks worker threads in case of thread create ... | |:JIRA bug: :psbug:`2193` | |:Upstream State: Closed | -|:Fix Released: 5.7.15-9 | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: 5.7.20 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82935` - Cipher ECDHE-RSA-AES128-GCM-SHA256 listed in man/Ssl_cipher_list, not... | |:JIRA bug: :psbug:`1737` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.15-9 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82886` - Server may crash due to a glibc bug in handling short-lived detached ... | |:JIRA bug: :psbug:`1006` | |:Upstream State: Closed | -|:Fix Released: 5.7.15-9 | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: 5.7.16 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82307` - Memory leaks in unit tests | |:JIRA bug: :psbug:`2157` | |:Upstream State: Closed | -|:Fix Released: 5.7.14-7 | +|:Fix Released: :rn:`5.7.14-7` | |:Upstream Fix: 5.7.18 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82283` - main.mysqlbinlog_debug fails with a LeakSanitizer error | |:JIRA bug: :psbug:`2156` | |:Upstream State: Closed | -|:Fix Released: 5.7.14-7 | +|:Fix Released: :rn:`5.7.14-7` | |:Upstream Fix: 5.7.19 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82026` - Stack buffer overflow with --ssl-cipher= | |:JIRA bug: :psbug:`2155` | |:Upstream State: Closed | -|:Fix Released: 5.7.14-7 | +|:Fix Released: :rn:`5.7.14-7` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`82019` - Is client library supposed to retry EINTR indefinitely or not | |:JIRA bug: :psbug:`1720` | |:Upstream State: Closed | -|:Fix Released: 5.7.14-7 | +|:Fix Released: :rn:`5.7.14-7` | |:Upstream Fix: 5.7.15 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81814` - InnoDB adaptive hash index uses a bad partitioning algorithm for the ... | |:JIRA bug: :psbug:`2498` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.18-14 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81810` - Inconsistent sort order for blob/text between InnoDB and filesort | |:JIRA bug: :psbug:`1799` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-14 | +|:Fix Released: :rn:`5.7.18-14` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81714` - mysqldump get_view_structure does not free MYSQL_RES in one error path | |:JIRA bug: :psbug:`2152` | |:Upstream State: Closed | -|:Fix Released: 5.7.13-6 | +|:Fix Released: :rn:`5.7.13-6` | |:Upstream Fix: 5.7.20 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81675` - mysqlbinlog does not free the existing connection before opening new ... | |:JIRA bug: :psbug:`1718` | |:Upstream State: Closed | -|:Fix Released: 5.7.12-6 | +|:Fix Released: :rn:`5.7.12-6` | |:Upstream Fix: 5.7.15 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81657` - DBUG_PRINT in THD::decide_logging_format prints incorrectly, access ... | |:JIRA bug: :psbug:`2150` | |:Upstream State: Closed | -|:Fix Released: 5.7.12-6 | +|:Fix Released: :rn:`5.7.12-6` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`81467` - innodb_fts.sync_block test unstable due to slow query log nondeterminism | |:JIRA bug: :psbug:`2232` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.17-12 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.17-12` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80962` - Replication does not work when @@GLOBAL.SERVER_UUID is missing on the... | |:JIRA bug: :psbug:`1684` | |:Upstream State: Closed | -|:Fix Released: 5.7.12-5 | +|:Fix Released: :rn:`5.7.12-5` | |:Upstream Fix: 5.7.13 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80607` - main.log_tables-big unstable on loaded hosts | |:JIRA bug: :psbug:`2141` | |:Upstream State: Closed | -|:Fix Released: 5.7.11-4 | +|:Fix Released: :rn:`5.7.11-4` | |:Upstream Fix: 5.7.18 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80606` - my_write, my_pwrite no longer safe to call from THD-less server utility...| |:JIRA bug: :psbug:`970` | |:Upstream State: N/A | -|:Fix Released: 5.7.11-4 | +|:Fix Released: :rn:`5.7.11-4` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80496` - buf_dblwr_init_or_load_pages now returns an error code, but caller not... | |:JIRA bug: :psbug:`3384` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.11-4 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.11-4` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80288` - missing innodb_numa_interleave | |:JIRA bug: :psbug:`974` | |:Upstream State: Closed | -|:Fix Released: 5.7.12-5 | +|:Fix Released: :rn:`5.7.12-5` | |:Upstream Fix: 5.7.16 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`80053` - Assertion in binlog coordinator on slave with 2 2pc handler log_slave ... | |:JIRA bug: :psbug:`3361` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-2 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-2` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79894` - Page cleaner worker threads are not instrumented for performance schema | |:JIRA bug: :psbug:`3356` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-2 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-2` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79703` - Spin rounds per wait will be negative in InnoDB status if spin waits >... | |:JIRA bug: :psbug:`1684` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-2 | +|:Fix Released: :rn:`5.7.10-2` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79610` - Failed DROP DATABASE due FK constraint on master breaks slave | |:JIRA bug: :psbug:`1683` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.14-7 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.14-7` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79569` - Some --big-test tests were forgotten to update in 5.7.10 | |:JIRA bug: :psbug:`3339` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-2 | +|:Fix Released: :rn:`5.7.10-2` | |:Upstream Fix: 5.7.11 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`79117` - "change_user" command should be aware of preceding "error" command | |:JIRA bug: :psbug:`659` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: 5.7.12 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`78894` - buf_pool_resize can lock less in checking whether AHI is on or off | |:JIRA bug: :psbug:`3340` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`77684` - DROP TABLE IF EXISTS may brake replication if slave has replication ... | |:JIRA bug: :psbug:`1639` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: 5.7.12 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`77591` - ALTER TABLE does not allow to change NULL/NOT NULL if foreign key exists | |:JIRA bug: :psbug:`1635` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`77399` - Deadlocks missed by INFORMATION_SCHEMA.INNODB_METRICS lock_deadlocks ... | |:JIRA bug: :psbug:`1635` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`76418` - Server crashes when querying partitioning table MySQL_5.7.14 | |:JIRA bug: :psbug:`1050` | |:Upstream State: N/A | -|:Fix Released: 5.7.18-15 | +|:Fix Released: :rn:`5.7.18-15` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`76142` - InnoDB tablespace import fails when importing table w/ different data ... | |:JIRA bug: :psbug:`1697` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.13-6 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.13-6` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75534` - Solve buffer pool mutex contention by splitting it | |:JIRA bug: :ref:`innodb_split_buf_pool_mutex` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75504` - btr_search_guess_on_hash makes found block young twice? | |:JIRA bug: :psbug:`2454` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75480` - Selecting wrong pos with SHOW BINLOG EVENTS causes a potentially ... | |:JIRA bug: :psbug:`1600` | |:Upstream State: N/A | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75311` - Error for SSL cipher is unhelpful | |:JIRA bug: :psbug:`1779` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.17-12 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.17-12` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`75189` - engines suite tests depending on InnoDB implementation details | |:JIRA bug: :psbug:`2103` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`74637` - make dirty page flushing more adaptive | |:JIRA bug: :ref:`Multi-threaded asynchronous LRU flusher ` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-3 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-3` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`73418` - Add --manual-lldb option to mysql-test-run.pl | |:JIRA bug: :psbug:`2448` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72615` - MTR --mysqld=--default-storage-engine=foo incompatible w/ dynamically... | |:JIRA bug: :psbug:`2071` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72475` - Binlog events with binlog_format=MIXED are unconditionally logged in ... | |:JIRA bug: :psbug:`151` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72466` - More memory overhead per page in the InnoDB buffer pool | |:JIRA bug: :psbug:`1689` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.12-5 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.12-5` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72123` - Spurious lock_wait_timeout_thread wakeup in lock_wait_suspend_thread() | |:JIRA bug: :psbug:`2504` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.18-16 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.18-16` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`72108` - Hard to read history file | |:JIRA bug: :psbug:`2066` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71761` - ANALYZE TABLE should remove its table from background stat processing... | |:JIRA bug: :psbug:`1749` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.15-9 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71759` - memory leak with string thread variable that set memalloc flag | |:JIRA bug: :psbug:`1004` | |:Upstream State: Closed | -|:Fix Released: 5.7.15-9 | +|:Fix Released: :rn:`5.7.15-9` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed ... | |:JIRA bug: :psbug:`1461` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71270` - Failures to end bulk insert for partitioned tables handled incorrectly | |:JIRA bug: :psbug:`700` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71217` - Threadpool - add thd_wait_begin/thd_wait_end to the network IO functions | |:JIRA bug: :psbug:`1343` | -|:Upstream State: Open (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Open (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71183` - os_file_fsync() should handle fsync() returning EINTR | |:JIRA bug: :psbug:`1461` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`71091` - CSV engine does not properly process "", in quotes | |:JIRA bug: :psbug:`153` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`70500` - Page cleaner should perform LRU flushing regardless of server activity | |:JIRA bug: :psbug:`1428` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`70490` - Suppression is too strict on some systems | |:JIRA bug: :psbug:`2038` | |:Upstream State: Closed | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: 5.7.20 | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69991` - MySQL client is broken without readline | |:JIRA bug: :psbug:`1467` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69639` - mysql failed to build with dtrace Sun D 1.11 | |:JIRA bug: :psbug:`1392` | -|:Upstream State: Unsupported (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Unsupported (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69258` - does buf_LRU_buf_pool_running_out need to lock buffer pool mutexes | |:JIRA bug: :psbug:`1414` | |:Upstream State: Not a bug | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69232` - buf_dblwr->mutex can be splited into two | |:JIRA bug: :ref:`parallel_doublewrite_buffer` | -|:Upstream State: No Feedback (checked on 2018-11-21) | -|:Fix Released: 5.7.11-4 | +|:Upstream State: No Feedback (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.11-4` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69170` - buf_flush_LRU is lazy | |:JIRA bug: :psbug:`2430` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`69146` - Needless log flush order mutex acquisition in buf_pool_get_oldest_mod... | |:JIRA bug: :psbug:`2418` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`68714` - Remove literal statement digest values from perfschema tests | |:JIRA bug: :psbug:`1340` | |:Upstream State: Not a bug | -|:Fix Released: 5.7.10-1 | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`68481` - InnoDB LRU flushing for MySQL 5.6 needs work | |:JIRA bug: :psbug:`2432` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`68052` - SSL Certificate Subject ALT Names with IPs not respected with --ssl-ver...| |:JIRA bug: :psbug:`1076` | |:Upstream State: Closed | -|:Fix Released: 5.7.18-16 | +|:Fix Released: :rn:`5.7.18-16` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`67808` - in innodb engine, double write and multi-buffer pool instance reduce ... | |:JIRA bug: :ref:`parallel_doublewrite_buffer` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.11-4 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.11-4` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`63130` - CMake-based check for the presence of a system readline library is not... | |:JIRA bug: :psbug:`1467` | -|:Upstream State: Can't Repeat (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Can't Repeat (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`57583` - fast index create not used during "alter table foo engine=innodb" | |:JIRA bug: :psbug:`2113` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`53645` - SHOW GRANTS not displaying all the applicable grants | |:JIRA bug: :psbug:`191` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`53588` - Blackhole : Specified key was too long; max key length is 1000 bytes | |:JIRA bug: :psbug:`1126` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.20-19 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.20-19` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`49120` - mysqldump should have flag to delay creating indexes for innodb plugin... | |:JIRA bug: :psbug:`2619` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`42415` - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... | |:JIRA bug: :psbug:`44` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`39833` - CREATE INDEX does full table copy on TEMPORARY table | |:JIRA bug: N/A | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`35125` - Allow the ability to set the server_id for a connection for logging to... | |:Launchpad BP: `Blueprint `_ | -|:Upstream State: Verified (checked on 2018-11-21) | +|:Upstream State: Verified (checked on 2018-12-03) | |:Fix Released: 5.7.10-1 | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`25007` - memory tables with dynamic rows format | |:JIRA bug: :psbug:`2407` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream Bug: :mysqlbug:`20001` - Support for temp-tables in INFORMATION_SCHEMA | |:JIRA bug: :ref:`temp_tables` | -|:Upstream State: Verified (checked on 2018-11-21) | -|:Fix Released: 5.7.10-1 | +|:Upstream State: Verified (checked on 2018-12-03) | +|:Fix Released: :rn:`5.7.10-1` | |:Upstream Fix: N/A | +-------------------------------------------------------------------------------------------------------------+ From 7e78778f890ad8bcc3681e3aab5260ab52414ead Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 4 Dec 2018 19:22:52 +0200 Subject: [PATCH 117/214] Release notes: update with CVEs --- doc/source/release-notes/Percona-Server-5.7.24-26.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/source/release-notes/Percona-Server-5.7.24-26.rst b/doc/source/release-notes/Percona-Server-5.7.24-26.rst index d2fde1981a58..1a1c6db57ef2 100644 --- a/doc/source/release-notes/Percona-Server-5.7.24-26.rst +++ b/doc/source/release-notes/Percona-Server-5.7.24-26.rst @@ -15,6 +15,13 @@ This release merges changes of `MySQL 5.7.24 all the bug fixes in it. Percona Server for MySQL |release| is now the current GA release in the 5.7 series. All of Percona’s software is open-source and free. +This release includes fixes to the following upstream CVEs (Common +Vulnerabilities and Exposures): *CVE-2016-9843*, *CVE-2018-3155*, *CVE-2018-3143*, +*CVE-2018-3156*, *CVE-2018-3251*, *CVE-2018-3133*, *CVE-2018-3144*, *CVE-2018-3185*, +*CVE-2018-3247*, *CVE-2018-3187*, *CVE-2018-3174*, *CVE-2018-3171*. For more +information, see `Oracle Critical Patch Update Advisory - October 2018 +`. + Improvements ================================================================================ From c4af5f9b71471c18b37beebdcc42e899b222d4ab Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Wed, 5 Dec 2018 15:16:36 +0100 Subject: [PATCH 118/214] PS-5100: percona_bug1289599 fails if USER is not defined 1. Define USER as "unknown" (ignore OS variable if defined). 2. Allow to use this MTR test as "root". --- mysql-test/t/percona_bug1289599.test | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mysql-test/t/percona_bug1289599.test b/mysql-test/t/percona_bug1289599.test index 03319dd5548c..7bea1e2eb894 100644 --- a/mysql-test/t/percona_bug1289599.test +++ b/mysql-test/t/percona_bug1289599.test @@ -4,10 +4,7 @@ --source include/have_socket_auth_plugin.inc -if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USER'`) -{ - --skip Unix user present in mysql.user -} +--let USER=unknown update mysql.user set plugin='auth_socket'; flush privileges; From 00c8e91cb78aa76fc1dcfb04157f18754c76141a Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Mon, 10 Dec 2018 12:18:07 +0100 Subject: [PATCH 119/214] PS-5118: Travis CI: Failed jobs should be red Add "else false" to detect failed Travis jobs. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3cef153e8e5a..ea9ddde53908 100644 --- a/.travis.yml +++ b/.travis.yml @@ -287,7 +287,7 @@ script: - CMAKE_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME)); echo --- CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds. Initialization time $INIT_TIME seconds.; make -j2; - if [[ "$?" == "0" ]]; then echo $TRAVIS_COMMIT > $CCACHE_DIR/last_commit.txt; fi; + if [[ "$?" == "0" ]]; then echo $TRAVIS_COMMIT > $CCACHE_DIR/last_commit.txt; else false; fi; - ccache --show-stats; BUILD_TIME=$(($SECONDS - $INIT_TIME - $UPDATE_TIME - $CMAKE_TIME)); From f75c39289516f08fbd18cfdf311521e0dad9a75a Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Mon, 10 Dec 2018 16:37:22 +0200 Subject: [PATCH 120/214] Fixed PS-4907 (Inconsistent ResultSet is obtained for different Execution Plans) https://jira.percona.com/browse/PS-4907 Backported optimizer fixes made silently as part of the WL#9158 "Join Order Hints" (https://dev.mysql.com/worklog/task/?id=9158) implementation in 8.0 branch (commit mysql/mysql-server@d2d91c3). *** Optimize_table_order::advance_sj_state(): added a change to prevent that inner tables of different semijoin nests are interleaved for MatScan. *** Re-recorded the following MTR test cases: * 'main.subquery_sj_all_bka_nixbnl' * 'main.subquery_sj_mat' * 'main.subquery_sj_mat_bka' * 'main.subquery_sj_mat_bka_nixbnl' * 'main.subquery_sj_mat_bkaunique' because of the changed execution plan. --- .../r/subquery_sj_all_bka_nixbnl.result | 7 +++--- mysql-test/r/subquery_sj_mat.result | 7 +++--- mysql-test/r/subquery_sj_mat_bka.result | 7 +++--- .../r/subquery_sj_mat_bka_nixbnl.result | 9 ++++--- mysql-test/r/subquery_sj_mat_bkaunique.result | 7 +++--- sql/sql_planner.cc | 24 ++++++++++++++----- 6 files changed, 38 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/subquery_sj_all_bka_nixbnl.result b/mysql-test/r/subquery_sj_all_bka_nixbnl.result index 4ccdb14bcd43..eebe3c21d118 100644 --- a/mysql-test/r/subquery_sj_all_bka_nixbnl.result +++ b/mysql-test/r/subquery_sj_all_bka_nixbnl.result @@ -9829,10 +9829,11 @@ FROM t1 AS subquery3_t1 ) ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using where; Using index -1 PRIMARY ALL NULL NULL NULL NULL NULL NULL -1 PRIMARY ref 9 .7,test.subquery3_t1.col_varchar_key 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL NULL Using where +1 PRIMARY ref 9 const,.subquery3_field1 2 Using where 1 PRIMARY table2 index NULL PRIMARY 4 NULL 1 Using index +1 PRIMARY eq_ref 4 table1.col_int_key 1 NULL +4 MATERIALIZED subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using index 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 0 NULL 2 DERIVED subquery1_t1 ALL PRIMARY NULL NULL NULL 1 NULL 2 DERIVED subquery1_t2 eq_ref PRIMARY PRIMARY 4 test.subquery1_t1.pk 1 Using index diff --git a/mysql-test/r/subquery_sj_mat.result b/mysql-test/r/subquery_sj_mat.result index a59007ff6888..280a4eea816d 100644 --- a/mysql-test/r/subquery_sj_mat.result +++ b/mysql-test/r/subquery_sj_mat.result @@ -9912,10 +9912,11 @@ FROM t1 AS subquery3_t1 ) ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using where; Using index -1 PRIMARY ALL NULL NULL NULL NULL NULL Using join buffer (Block Nested Loop) -1 PRIMARY ref 9 .7,test.subquery3_t1.col_varchar_key 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL NULL Using where +1 PRIMARY ref 9 const,.subquery3_field1 2 Using where +1 PRIMARY eq_ref 4 table1.col_int_key 1 NULL 1 PRIMARY table2 index NULL PRIMARY 4 NULL 1 Using index; Using join buffer (Block Nested Loop) +4 MATERIALIZED subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using index 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 0 NULL 2 DERIVED subquery1_t1 ALL PRIMARY NULL NULL NULL 1 NULL 2 DERIVED subquery1_t2 eq_ref PRIMARY PRIMARY 4 test.subquery1_t1.pk 1 Using index diff --git a/mysql-test/r/subquery_sj_mat_bka.result b/mysql-test/r/subquery_sj_mat_bka.result index 3e16a6a701e4..8fb8bfa4fb2d 100644 --- a/mysql-test/r/subquery_sj_mat_bka.result +++ b/mysql-test/r/subquery_sj_mat_bka.result @@ -9913,10 +9913,11 @@ FROM t1 AS subquery3_t1 ) ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using where; Using index -1 PRIMARY ALL NULL NULL NULL NULL NULL Using join buffer (Block Nested Loop) -1 PRIMARY ref 9 .7,test.subquery3_t1.col_varchar_key 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL NULL Using where +1 PRIMARY ref 9 const,.subquery3_field1 2 Using where +1 PRIMARY eq_ref 4 table1.col_int_key 1 NULL 1 PRIMARY table2 index NULL PRIMARY 4 NULL 1 Using index; Using join buffer (Block Nested Loop) +4 MATERIALIZED subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using index 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 0 NULL 2 DERIVED subquery1_t1 ALL PRIMARY NULL NULL NULL 1 NULL 2 DERIVED subquery1_t2 eq_ref PRIMARY PRIMARY 4 test.subquery1_t1.pk 1 Using index diff --git a/mysql-test/r/subquery_sj_mat_bka_nixbnl.result b/mysql-test/r/subquery_sj_mat_bka_nixbnl.result index 1d833d763d03..287ecf17c164 100644 --- a/mysql-test/r/subquery_sj_mat_bka_nixbnl.result +++ b/mysql-test/r/subquery_sj_mat_bka_nixbnl.result @@ -9903,11 +9903,10 @@ FROM t1 AS subquery3_t1 ) ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using where; Using index -1 PRIMARY ALL NULL NULL NULL NULL NULL NULL -1 PRIMARY ref 9 .7,test.subquery3_t1.col_varchar_key 2 Using where -1 PRIMARY table2 index NULL PRIMARY 4 NULL 1 Using index -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 0 NULL +1 PRIMARY subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using where; Using index; Start temporary +1 PRIMARY t3 ALL NULL NULL NULL NULL 0 NULL +1 PRIMARY ref 9 const,test.subquery3_t1.col_varchar_key 2 NULL +1 PRIMARY table2 index NULL PRIMARY 4 NULL 1 Using index; End temporary 2 DERIVED subquery1_t1 ALL PRIMARY NULL NULL NULL 1 NULL 2 DERIVED subquery1_t2 eq_ref PRIMARY PRIMARY 4 test.subquery1_t1.pk 1 Using index SELECT table1.pk AS field1 diff --git a/mysql-test/r/subquery_sj_mat_bkaunique.result b/mysql-test/r/subquery_sj_mat_bkaunique.result index 3f64addb7a08..78eeee7bed6d 100644 --- a/mysql-test/r/subquery_sj_mat_bkaunique.result +++ b/mysql-test/r/subquery_sj_mat_bkaunique.result @@ -9914,10 +9914,11 @@ FROM t1 AS subquery3_t1 ) ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using where; Using index -1 PRIMARY ALL NULL NULL NULL NULL NULL Using join buffer (Block Nested Loop) -1 PRIMARY ref 9 .7,test.subquery3_t1.col_varchar_key 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL NULL Using where +1 PRIMARY ref 9 const,.subquery3_field1 2 Using where +1 PRIMARY eq_ref 4 table1.col_int_key 1 NULL 1 PRIMARY table2 index NULL PRIMARY 4 NULL 1 Using index; Using join buffer (Block Nested Loop) +4 MATERIALIZED subquery3_t1 index col_varchar_key col_varchar_key 9 NULL 0 Using index 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 0 NULL 2 DERIVED subquery1_t1 ALL PRIMARY NULL NULL NULL 1 NULL 2 DERIVED subquery1_t2 eq_ref PRIMARY PRIMARY 4 test.subquery1_t1.pk 1 Using index diff --git a/sql/sql_planner.cc b/sql/sql_planner.cc index 262ac56433a1..9a40cddf27c4 100644 --- a/sql/sql_planner.cc +++ b/sql/sql_planner.cc @@ -3479,12 +3479,24 @@ void Optimize_table_order::advance_sj_state( The simple way to model this is to remove SJM-SCAN(...) fanout once we reach the point #2. */ - pos->sjm_scan_need_tables= - emb_sj_nest->sj_inner_tables | - emb_sj_nest->nested_join->sj_depends_on; - pos->sjm_scan_last_inner= idx; - Opt_trace_object(trace).add_alnum("strategy", "MaterializeScan"). - add_alnum("choice", "deferred"); + if (pos->sjm_scan_need_tables && + emb_sj_nest != NULL && + emb_sj_nest != + join->positions[pos->sjm_scan_last_inner].table->emb_sj_nest) + /* + Prevent that inner tables of different semijoin nests are + interleaved for MatScan. + */ + pos->sjm_scan_need_tables= 0; + else + { + pos->sjm_scan_need_tables= + emb_sj_nest->sj_inner_tables | + emb_sj_nest->nested_join->sj_depends_on; + pos->sjm_scan_last_inner= idx; + Opt_trace_object(trace).add_alnum("strategy", "MaterializeScan"). + add_alnum("choice", "deferred"); + } } else if (sjm_strategy == SJ_OPT_MATERIALIZE_LOOKUP) { From 3e8a3c61b0beb6593da05bd3ad91e0befb94bdae Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Tue, 27 Nov 2018 14:23:12 +0530 Subject: [PATCH 121/214] Bug#28867993: POSSIBLE ISSUE WITH MYSQL SERVER RESTART (cherry picked from commit a8eb69418fecd2d2bcbb00f49e017a10fe8b30fd) --- sql/handler.cc | 36 +++++++++++++++++++++++++ sql/handler.h | 11 ++++++++ sql/sql_db.cc | 6 +++++ storage/innobase/handler/ha_innodb.cc | 39 +++++++++++++++++++++++++++ storage/innobase/include/log0log.h | 4 ++- storage/innobase/log/log0recv.cc | 3 +-- 6 files changed, 96 insertions(+), 3 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 56e5fcaa04eb..0a5b01f790c0 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -8785,3 +8785,39 @@ bool set_tx_isolation(THD *thd, } return false; } + + +/** + Checks if the file name is reserved word used by SE by invoking + the handlerton method. + + @param unused1 thread handler which is unused. + @param plugin SE plugin. + @param name Database name. + + @retval true If the name is reserved word. + @retval false If the name is not reserved word. +*/ +static my_bool is_reserved_db_name_handlerton(THD *unused1, plugin_ref plugin, + void *name) +{ + handlerton *hton= plugin_data(plugin); + if (hton->state == SHOW_OPTION_YES && hton->is_reserved_db_name) + return (hton->is_reserved_db_name(hton, (const char *)name)); + return false; +} + + +/** + Check if the file name is reserved word used by SE. + + @param name Database name. + + @retval true If the name is a reserved word. + @retval false If the name is not a reserved word. +*/ +bool ha_check_reserved_db_name(const char* name) +{ + return (plugin_foreach(NULL, is_reserved_db_name_handlerton, + MYSQL_STORAGE_ENGINE_PLUGIN, (char *)name)); +} diff --git a/sql/handler.h b/sql/handler.h index ca1ca5c3bc3d..d221748387ec 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -984,6 +984,16 @@ struct handlerton true on failure */ bool (*rotate_encryption_master_key)(void); + /** + Check if the given database name is reserved. + + @param hton Handlerton for SE. + @param name Database name. + + @retval true Database name is reserved by SE. + @retval false Database name is not reserved. + */ + bool (*is_reserved_db_name)(handlerton *hton, const char *name); uint32 license; /* Flag for Engine License */ void *data; /* Location for engines to keep personal structures */ @@ -4163,5 +4173,6 @@ int commit_owned_gtid_by_partial_command(THD *thd); bool set_tx_isolation(THD *thd, enum_tx_isolation tx_isolation, bool one_shot); +bool ha_check_reserved_db_name(const char *name); #endif /* HANDLER_INCLUDED */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e39afa716c3b..53b6afd4a213 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -572,6 +572,12 @@ int mysql_create_db(THD *thd, const char *db, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } + if (ha_check_reserved_db_name(db)) + { + my_error(ER_WRONG_DB_NAME, MYF(0), db); + DBUG_RETURN(-1); + } + if (lock_schema_name(thd, db)) DBUG_RETURN(-1); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ea3ed5c9c0a8..886c7952b365 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1272,6 +1272,17 @@ innobase_fts_store_docid( dbug_tmp_restore_column_map(tbl->write_set, old_map); } +/*****************************************************************//** +Checks if the filename name is reserved in InnoDB. +@return true if the name is reserved */ +static +bool +innobase_check_reserved_file_name( +/*===================*/ + handlerton* hton, /*!< in: handlerton of Innodb */ + const char* name); /*!< in: Name of the database */ + + /*************************************************************//** Check for a valid value of innobase_commit_concurrency. @return 0 for valid innodb_commit_concurrency */ @@ -3547,6 +3558,7 @@ innobase_init( innobase_hton->replace_native_transaction_in_thd = innodb_replace_trx_in_thd; innobase_hton->data = &innodb_api_cb; + innobase_hton->is_reserved_db_name= innobase_check_reserved_file_name; innobase_hton->is_supported_system_table= innobase_is_supported_system_table; @@ -21360,3 +21372,30 @@ innodb_buffer_pool_size_validate( return(0); } + +/*****************************************************************//** +Checks if the file name is reserved in InnoDB. Currently +redo log files(ib_logfile*) is reserved. +@return true if the name is reserved */ +static +bool +innobase_check_reserved_file_name( +/*===================*/ + handlerton* hton, /*!< in: handlerton of Innodb */ + const char* name) /*!< in: Name of the database */ +{ + CHARSET_INFO *ci= system_charset_info; + size_t logname_size = strlen(ib_logfile_basename); + + /* Name is smaller than reserved name */ + if (strlen(name) < logname_size) { + return (false); + } + /* Do case insensitive comparison for name. */ + for (uint i=0; i < logname_size; i++) { + if (my_tolower(ci, name[i]) != ib_logfile_basename[i]){ + return (false); + } + } + return (true); +} diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index dcd4d8709482..797080a68068 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2009, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -67,6 +67,8 @@ typedef ulint (*log_checksum_func_t)(const byte* log_block); log_sys->mutex. */ extern log_checksum_func_t log_checksum_algorithm_ptr; +static const char ib_logfile_basename[] = "ib_logfile"; + /*******************************************************************//** Calculates where in log files we find a specified lsn. @return log file number */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 35db4f1c80c6..878d14cd5205 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. This program is free software; you can redistribute it and/or modify it under @@ -4484,7 +4484,6 @@ recv_reset_log_files_for_backup( ulint i; ulint log_dir_len; char name[5000]; - static const char ib_logfile_basename[] = "ib_logfile"; log_dir_len = strlen(log_dir); /* full path name of ib_logfile consists of log dir path + basename From 44adfef41e3bc31abc997ff2f8a48697e0cecb64 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Tue, 27 Nov 2018 19:02:08 +0530 Subject: [PATCH 122/214] From 94b78cfc762b22e399cfe8934d387b5b8f0404a4 Mon Sep 17 00:00:00 2001 From: Daniel Blanchard Date: Mon, 26 Nov 2018 09:36:10 +0000 Subject: [PATCH 123/214] WL#12445 Improve Windows named pipe access control Post push fix for test failure of sys_vars.named_pipe_full_access_group_basic with embedded server. (cherry picked from commit 601e942a53be62253ff61e9d535aaa62ce4f4e29) --- .../suite/sys_vars/t/named_pipe_full_access_group_basic.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test index a1347cafe9a6..0195fec27d9d 100644 --- a/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test +++ b/mysql-test/suite/sys_vars/t/named_pipe_full_access_group_basic.test @@ -1,4 +1,5 @@ --source include/windows.inc +--source include/not_embedded.inc # # only global # From 93708ba9fef629961c46897146528671f65942c0 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 27 Nov 2018 10:38:13 +0100 Subject: [PATCH 124/214] WL#12445 : Improve Windows named pipe access control WL#12445 Improve Windows named pipe access control introduced new instrumented read write locks, hitting the current limit in the performance schema: PFS_MAX_RWLOCK_CLASS 40 This fix increases PFS_MAX_RWLOCK_CLASS to 50, and adjusts all tests results accordingly. (cherry picked from commit 4afa5c6941261d0deef272d64ba5ba2e2c8402d0) --- mysql-test/r/mysqld--help-notwin.result | 2 +- mysql-test/r/mysqld--help-win.result | 2 +- mysql-test/suite/perfschema/r/max_program_zero.result | 2 +- mysql-test/suite/perfschema/r/ortho_iter.result | 2 +- mysql-test/suite/perfschema/r/privilege_table_io.result | 2 +- .../suite/perfschema/r/start_server_disable_idle.result | 2 +- .../suite/perfschema/r/start_server_disable_stages.result | 2 +- .../suite/perfschema/r/start_server_disable_statements.result | 2 +- .../perfschema/r/start_server_disable_transactions.result | 2 +- .../suite/perfschema/r/start_server_disable_waits.result | 2 +- mysql-test/suite/perfschema/r/start_server_innodb.result | 2 +- mysql-test/suite/perfschema/r/start_server_low_index.result | 2 +- .../suite/perfschema/r/start_server_low_table_lock.result | 2 +- mysql-test/suite/perfschema/r/start_server_no_account.result | 2 +- .../suite/perfschema/r/start_server_no_cond_class.result | 2 +- .../suite/perfschema/r/start_server_no_cond_inst.result | 2 +- .../suite/perfschema/r/start_server_no_file_class.result | 2 +- .../suite/perfschema/r/start_server_no_file_inst.result | 2 +- mysql-test/suite/perfschema/r/start_server_no_host.result | 2 +- mysql-test/suite/perfschema/r/start_server_no_index.result | 2 +- mysql-test/suite/perfschema/r/start_server_no_mdl.result | 2 +- .../suite/perfschema/r/start_server_no_memory_class.result | 2 +- .../suite/perfschema/r/start_server_no_mutex_class.result | 2 +- .../suite/perfschema/r/start_server_no_mutex_inst.result | 2 +- .../r/start_server_no_prepared_stmts_instances.result | 2 +- .../suite/perfschema/r/start_server_no_rwlock_inst.result | 2 +- .../suite/perfschema/r/start_server_no_setup_actors.result | 2 +- .../suite/perfschema/r/start_server_no_setup_objects.result | 2 +- .../suite/perfschema/r/start_server_no_socket_class.result | 2 +- .../suite/perfschema/r/start_server_no_socket_inst.result | 2 +- .../suite/perfschema/r/start_server_no_stage_class.result | 2 +- .../suite/perfschema/r/start_server_no_stages_history.result | 2 +- .../perfschema/r/start_server_no_stages_history_long.result | 2 +- .../suite/perfschema/r/start_server_no_statement_class.result | 2 +- .../perfschema/r/start_server_no_statements_history.result | 2 +- .../r/start_server_no_statements_history_long.result | 2 +- .../suite/perfschema/r/start_server_no_table_hdl.result | 2 +- .../suite/perfschema/r/start_server_no_table_inst.result | 2 +- .../suite/perfschema/r/start_server_no_table_lock.result | 2 +- .../suite/perfschema/r/start_server_no_thread_class.result | 2 +- .../suite/perfschema/r/start_server_no_thread_inst.result | 2 +- .../perfschema/r/start_server_no_transactions_history.result | 2 +- .../r/start_server_no_transactions_history_long.result | 2 +- mysql-test/suite/perfschema/r/start_server_no_user.result | 2 +- .../suite/perfschema/r/start_server_no_waits_history.result | 2 +- .../perfschema/r/start_server_no_waits_history_long.result | 2 +- mysql-test/suite/perfschema/r/start_server_on.result | 2 +- .../suite/perfschema/r/statement_program_lost_inst.result | 2 +- .../suite/perfschema/r/table_aggregate_global_2u_2t.result | 2 +- .../suite/perfschema/r/table_aggregate_global_2u_3t.result | 2 +- .../suite/perfschema/r/table_aggregate_global_4u_2t.result | 2 +- .../suite/perfschema/r/table_aggregate_global_4u_3t.result | 2 +- .../suite/perfschema/r/table_aggregate_hist_2u_2t.result | 2 +- .../suite/perfschema/r/table_aggregate_hist_2u_3t.result | 2 +- .../suite/perfschema/r/table_aggregate_hist_4u_2t.result | 2 +- .../suite/perfschema/r/table_aggregate_hist_4u_3t.result | 2 +- mysql-test/suite/perfschema/r/table_aggregate_off.result | 2 +- .../suite/perfschema/r/table_aggregate_thread_2u_2t.result | 2 +- .../suite/perfschema/r/table_aggregate_thread_2u_3t.result | 2 +- .../suite/perfschema/r/table_aggregate_thread_4u_2t.result | 2 +- .../suite/perfschema/r/table_aggregate_thread_4u_3t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_global_2u_2t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_global_2u_3t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_global_4u_2t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_global_4u_3t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_hist_2u_2t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_hist_2u_3t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_hist_4u_2t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_hist_4u_3t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_thread_2u_2t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_thread_2u_3t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_thread_4u_2t.result | 2 +- .../suite/perfschema/r/table_io_aggregate_thread_4u_3t.result | 2 +- .../perfschema/r/table_lock_aggregate_global_2u_2t.result | 2 +- .../perfschema/r/table_lock_aggregate_global_2u_3t.result | 2 +- .../perfschema/r/table_lock_aggregate_global_4u_2t.result | 2 +- .../perfschema/r/table_lock_aggregate_global_4u_3t.result | 2 +- .../suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result | 2 +- .../suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result | 2 +- .../suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result | 2 +- .../suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result | 2 +- .../perfschema/r/table_lock_aggregate_thread_2u_2t.result | 2 +- .../perfschema/r/table_lock_aggregate_thread_2u_3t.result | 2 +- .../perfschema/r/table_lock_aggregate_thread_4u_2t.result | 2 +- .../perfschema/r/table_lock_aggregate_thread_4u_3t.result | 2 +- storage/perfschema/pfs_server.h | 4 ++-- 86 files changed, 87 insertions(+), 87 deletions(-) diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index e818dd427d86..a87c4634d288 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -1510,7 +1510,7 @@ performance-schema-max-mutex-classes 210 performance-schema-max-mutex-instances -1 performance-schema-max-prepared-statements-instances -1 performance-schema-max-program-instances -1 -performance-schema-max-rwlock-classes 40 +performance-schema-max-rwlock-classes 50 performance-schema-max-rwlock-instances -1 performance-schema-max-socket-classes 10 performance-schema-max-socket-instances -1 diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 40dc608d9716..034abbb04f17 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -1510,7 +1510,7 @@ performance-schema-max-mutex-classes 210 performance-schema-max-mutex-instances -1 performance-schema-max-prepared-statements-instances -1 performance-schema-max-program-instances -1 -performance-schema-max-rwlock-classes 40 +performance-schema-max-rwlock-classes 50 performance-schema-max-rwlock-instances -1 performance-schema-max-socket-classes 10 performance-schema-max-socket-instances -1 diff --git a/mysql-test/suite/perfschema/r/max_program_zero.result b/mysql-test/suite/perfschema/r/max_program_zero.result index 1f244a3a0064..54a203e82891 100644 --- a/mysql-test/suite/perfschema/r/max_program_zero.result +++ b/mysql-test/suite/perfschema/r/max_program_zero.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 0 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result index bf15d8172f77..dbb5eed68a5d 100644 --- a/mysql-test/suite/perfschema/r/ortho_iter.result +++ b/mysql-test/suite/perfschema/r/ortho_iter.result @@ -242,7 +242,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index f04aef0f1d3b..356e2390bec5 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -49,7 +49,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result index 38b50f1bebbf..03373d66b78f 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result index 454fd64e56cb..a2becc0b6030 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result index d2e1cb132a21..1c9cfb977ee1 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result index 8fc285e81d2b..ca4e6842be44 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result index 087d782da40a..28deef3ef738 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result index 116bbbcfb462..740ed6cb25b7 100644 --- a/mysql-test/suite/perfschema/r/start_server_innodb.result +++ b/mysql-test/suite/perfschema/r/start_server_innodb.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_low_index.result b/mysql-test/suite/perfschema/r/start_server_low_index.result index f2439059703f..e829c460feb9 100644 --- a/mysql-test/suite/perfschema/r/start_server_low_index.result +++ b/mysql-test/suite/perfschema/r/start_server_low_index.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result index f0e204935e7a..b0f3bbadfdff 100644 --- a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result +++ b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result index cc7f9a324a95..def072610a4d 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_account.result +++ b/mysql-test/suite/perfschema/r/start_server_no_account.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result index afd465aea899..276249c2b765 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result index 2ec4af0df434..b48a699e3673 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result index 042ba3f1623f..11cae0adaf50 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result index f8f2dc222d7b..5d2a9903cd8c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result index 38afb4570ecb..cc848fa2edf0 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_host.result +++ b/mysql-test/suite/perfschema/r/start_server_no_host.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_index.result b/mysql-test/suite/perfschema/r/start_server_no_index.result index 983342802070..2233f2c7210c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_index.result +++ b/mysql-test/suite/perfschema/r/start_server_no_index.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mdl.result b/mysql-test/suite/perfschema/r/start_server_no_mdl.result index 87f2ac8226d1..d9b6c8630e3e 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mdl.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mdl.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result index ea1bcb258902..ba3e9bea7d54 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result index ca4100fcdc5e..4714f33e4339 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 0 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result index 6345552b04de..41dc11311d40 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 0 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result index 4b993eb29cdb..1c047e94978e 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result +++ b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 0 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result index 336d316f0c32..d31044949396 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 0 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result index 03b60b2ca0bc..68c3086d5d87 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result index a8ef5935c52d..a00209342609 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result index 9bd55cf8ad91..37e56a623e1e 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 0 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result index 8029fb4286ea..ab454eb3ce16 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result index c5840ec78b11..7a6e45269f0b 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result index c63f5a97f723..28ae3017e137 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result index c354dfc60bf0..e08a4d879e96 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result index be3a675cd377..cb283dc4892f 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result index 6d1532db4bdc..9ce6f38b500b 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result index 633f2b5b34dd..2d3640fa00c5 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result index 4825823c584e..d89e5ab03be5 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result index fe0737909c15..6732eaa34f49 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result index 6a3a7e8d45fe..b530246a27f1 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result index d17982f16dc1..cd900fec3f8f 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result index 9ca1f6212e14..d69a8622f664 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result index 767358d1bcd1..f6739aa055be 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result index c9598b25a798..581019a044f8 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result index cf8b406fd167..a2a1bc121ee9 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_user.result +++ b/mysql-test/suite/perfschema/r/start_server_no_user.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result index 031f6fd666a5..ef82e08f55ea 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result index 6f3a1857e8a7..e67b8de7af89 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result index 116bbbcfb462..740ed6cb25b7 100644 --- a/mysql-test/suite/perfschema/r/start_server_on.result +++ b/mysql-test/suite/perfschema/r/start_server_on.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result index 6cbc50579dcb..2f0ab6988f4a 100644 --- a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result +++ b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result @@ -134,7 +134,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 7 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result index 931f9137e732..982a8e881be8 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result index 436ce0659e22..9e56822f5d04 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result index 38c8119635ea..07c3d7c2a187 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result index ba15a88d2dba..a718b2b513b9 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index acd70ee0e8ed..5b488993bfb4 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -79,7 +79,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index 941cfdb40a51..f5e8efd76c5c 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -78,7 +78,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index 57f8d3449f29..62a20e15c0b0 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -79,7 +79,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index 87652c6eccb8..37dba990a1dd 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -78,7 +78,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result index d45f76a24c72..65b00404947c 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_off.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result index c87b15d40cb2..68d47390d0f3 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result index e29ca28b9853..50744dd22d7c 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result index 0409bc416851..8d53db6ed8d2 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result index 953d61e02f96..8ddf5262d111 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result index c826fbf40754..91b32f148a96 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result index f83c8544cb0e..2567ab405b7d 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result index 1b48c0ed80c3..4a671b790135 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result index 9803ca537a44..51605627ad5f 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result index 2953be34d18b..699b2ce54091 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result index 48b38fdf4feb..d0f4e078033d 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result index b6dff427bfc3..aae364736a4a 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result index ccda9dd78f88..c2501355b8ac 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result index c7dda6c32b7b..45766897df3a 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result index c6bea5d133aa..89faa9c12ac5 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result index d7458f40c52c..9c61d65df50d 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result index dc18e99bb146..33925454953d 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result index 51deb6282b14..9f30b3b7efc1 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result index abcfe8fab162..c1c3ccbd8d3b 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result index 273b5b4f1d06..7efb952bc0d5 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result index c80f0b6f8b3e..a40d332a4ef5 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result index 5f85d8063ed5..264edae51f2e 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result index e4b450de2264..fbf61a3c9703 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result index d058b70a6960..bea2a5c19954 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result @@ -81,7 +81,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result index 0f532caf7298..639e29da7fae 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result @@ -80,7 +80,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result index d70555b02ac7..0f466c890c2e 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result index fb9342769b81..e237be9270a7 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result index 7262794c0d52..24d1786c543a 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result @@ -83,7 +83,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result index 665e924d870e..5bb0b38eec0f 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result @@ -82,7 +82,7 @@ performance_schema_max_mutex_classes 210 performance_schema_max_mutex_instances 5000 performance_schema_max_prepared_statements_instances 100 performance_schema_max_program_instances 5000 -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h index 73904c273381..52faaf926019 100644 --- a/storage/perfschema/pfs_server.h +++ b/storage/perfschema/pfs_server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #define PFS_MAX_MUTEX_CLASS 210 #endif #ifndef PFS_MAX_RWLOCK_CLASS - #define PFS_MAX_RWLOCK_CLASS 40 + #define PFS_MAX_RWLOCK_CLASS 50 #endif #ifndef PFS_MAX_COND_CLASS #define PFS_MAX_COND_CLASS 80 From 9064cfa7740e693c7e19cbb3aa92639562421971 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 27 Nov 2018 21:58:59 +0100 Subject: [PATCH 125/214] WL#12445 : Improve Windows named pipe access control WL#12445 Improve Windows named pipe access control introduced new instrumented read write locks, hitting the current limit in the performance schema: PFS_MAX_RWLOCK_CLASS 40 This fix increases PFS_MAX_RWLOCK_CLASS to 50, and adjusts all tests results accordingly. Fix also test start_server_no_rwlock_inst. (cherry picked from commit d3d4aa7a112c3c5e1028adb155d917925e132250) --- .../suite/perfschema/r/start_server_no_rwlock_inst.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result index d31044949396..b81a6377aec9 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result @@ -155,7 +155,7 @@ show engine PERFORMANCE_SCHEMA status; show global status like "performance_schema%"; show global variables like "performance_schema_max_rwlock_classes"; Variable_name Value -performance_schema_max_rwlock_classes 40 +performance_schema_max_rwlock_classes 50 select count(*) > 0 from performance_schema.setup_instruments where name like "wait/synch/rwlock/%"; count(*) > 0 From f602908685b5fca9390784b61c5c646dd986cd61 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 28 Nov 2018 10:52:11 +0100 Subject: [PATCH 126/214] From bbf9870a8dc1cc0c46c86bead2697ba444b95bf9 Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Thu, 13 Dec 2018 10:49:06 +0100 Subject: [PATCH 127/214] PS-5121: clang-7 warnings with -Wself-assign-overloaded Backport changes by upstream in 8.0: https://github.com/percona/percona-server/commit/86b3039e9dc7c7a0e038ea34f559a517edc1ff3e --- unittest/gunit/gis_algos-t.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/unittest/gunit/gis_algos-t.cc b/unittest/gunit/gis_algos-t.cc index beccc4b6cbc7..9fc5e550ce85 100644 --- a/unittest/gunit/gis_algos-t.cc +++ b/unittest/gunit/gis_algos-t.cc @@ -252,10 +252,6 @@ TEST_F(GeometryManipulationTest, PolygonManipulationTest) ls0->get_flags(), ls0->get_srid()); Gis_line_string ls00(*ls0); - ls= ls; - ls00= ls00; - plgn= plgn; - Geometry_buffer buffer3; String wkt3, str3; From 69b627305bee80b03506389816599bd2d32f04b7 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Mon, 19 Nov 2018 07:07:43 +0100 Subject: [PATCH 128/214] PS-4985: Two log encryption tests crashed with eatmydata. The issue wasn't realeted directly to libeatmydata, it was only a side effect. Eatmydata made the boostrap too quick: the master thread loop wasn't executed fully even once during bootstrap. As undo/redo encryption headers were only written out in this loop, the log files contained encrypted data, but didn't contain any information about the keys. This change writes encryption info out immediately after the server UUID is available, fixing this issue. The bugfix also uncovered a different issue: some key rotation calls were missing, resulting in possible crashes during recovery, which is also fixed in this commit. --- mysql-test/include/log_encrypt_5.inc | 4 ++-- mysql-test/include/log_encrypt_6.inc | 2 +- mysql-test/suite/innodb/t/disabled.def | 4 ---- mysql-test/suite/innodb/t/log_encrypt_2_mk.test | 2 +- storage/innobase/handler/ha_innodb.cc | 6 ++++-- storage/innobase/log/log0log.cc | 10 ++++++++-- storage/innobase/srv/srv0srv.cc | 2 -- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/mysql-test/include/log_encrypt_5.inc b/mysql-test/include/log_encrypt_5.inc index 5086302d9c1e..73fa4e11a03a 100644 --- a/mysql-test/include/log_encrypt_5.inc +++ b/mysql-test/include/log_encrypt_5.inc @@ -41,7 +41,7 @@ CREATE DATABASE test; EOF --echo # Stop the MTR default DB server --source include/shutdown_mysqld.inc -let NEW_CMD = $MYSQLD --no-defaults --initialize-insecure --innodb_log_file_size=$LOG_FILE_SIZE --innodb_page_size=$START_PAGE_SIZE --basedir=$MYSQLD_BASEDIR --datadir=$MYSQLD_DATADIR1 --init-file=$BOOTSTRAP_SQL --innodb_undo_directory=$MYSQLD_UNDO_DATADIR --innodb_undo_tablespaces=2 --secure-file-priv="" >$MYSQLTEST_VARDIR/tmp/bootstrap1.log 2>&1; +let NEW_CMD = $MYSQLD --no-defaults --initialize-insecure --innodb_log_file_size=$LOG_FILE_SIZE --innodb_page_size=$START_PAGE_SIZE --basedir=$MYSQLD_BASEDIR --datadir=$MYSQLD_DATADIR1 --init-file=$BOOTSTRAP_SQL --innodb_undo_directory=$MYSQLD_UNDO_DATADIR --innodb_undo_tablespaces=2 --secure-file-priv="" >$MYSQL_TMP_DIR/bootstrap1.log 2>&1; --echo # Run the bootstrap command of datadir1 --exec $NEW_CMD @@ -119,7 +119,7 @@ DROP DATABASE tde_db; --force-rmdir $MYSQL_TMP_DIR/log_encrypt_dir1 --force-rmdir $MYSQL_TMP_DIR/innodb_undo_data_dir ---remove_file $MYSQLTEST_VARDIR/tmp/bootstrap1.log +--remove_file $MYSQL_TMP_DIR/bootstrap1.log --remove_file $BOOTSTRAP_SQL --disable_query_log eval SET GLOBAL innodb_file_per_table=$old_innodb_file_per_table; diff --git a/mysql-test/include/log_encrypt_6.inc b/mysql-test/include/log_encrypt_6.inc index 8c053ee2cd84..9dd97af69f2b 100644 --- a/mysql-test/include/log_encrypt_6.inc +++ b/mysql-test/include/log_encrypt_6.inc @@ -35,7 +35,7 @@ EOF --echo # Stop the MTR default DB server --source include/shutdown_mysqld.inc -let NEW_CMD = $MYSQLD --no-defaults --initialize-insecure --innodb_log_file_size=$LOG_FILE_SIZE --innodb_page_size=$START_PAGE_SIZE --basedir=$MYSQLD_BASEDIR --datadir=$MYSQLD_DATADIR1 --init-file=$BOOTSTRAP_SQL --secure-file-priv="" --innodb_redo_log_encrypt=$redo_log_encrypt_mode --innodb_undo_tablespaces=2 --early-plugin-load="keyring_file=$KEYRING_PLUGIN" --keyring_file_data=$MYSQL_TMP_DIR/my_key_redo4 $KEYRING_PLUGIN_OPT >$MYSQLTEST_VARDIR/tmp/bootstrap1.log 2>&1; +let NEW_CMD = $MYSQLD --no-defaults --initialize-insecure --innodb_log_file_size=$LOG_FILE_SIZE --innodb_page_size=$START_PAGE_SIZE --basedir=$MYSQLD_BASEDIR --datadir=$MYSQLD_DATADIR1 --init-file=$BOOTSTRAP_SQL --secure-file-priv="" --innodb_redo_log_encrypt=$redo_log_encrypt_mode --innodb_undo_tablespaces=2 --early-plugin-load="keyring_file=$KEYRING_PLUGIN" --keyring_file_data=$MYSQL_TMP_DIR/my_key_redo4 $KEYRING_PLUGIN_OPT >$MYSQL_TMP_DIR/bootstrap1.log 2>&1; --echo # Run the bootstrap command of datadir1 --exec $NEW_CMD diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def index b816eef4177b..888298bbb09e 100644 --- a/mysql-test/suite/innodb/t/disabled.def +++ b/mysql-test/suite/innodb/t/disabled.def @@ -9,7 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -log_encrypt_4_mk : PS-4958 2018-10-24 Zsolt Parragi Testcase crashes with eatmydata in LD_PRELOAD -log_encrypt_4_rk : PS-4958 2018-10-24 Zsolt Parragi Testcase crashes with eatmydata in LD_PRELOAD -log_encrypt_6_mk : PS-4958 2018-10-24 Zsolt Parragi Testcase crashes with eatmydata in LD_PRELOAD -log_encrypt_6_rk : PS-4958 2018-10-24 Zsolt Parragi Testcase crashes with eatmydata in LD_PRELOAD diff --git a/mysql-test/suite/innodb/t/log_encrypt_2_mk.test b/mysql-test/suite/innodb/t/log_encrypt_2_mk.test index 7d77f9b86d7c..0eca7312ade9 100644 --- a/mysql-test/suite/innodb/t/log_encrypt_2_mk.test +++ b/mysql-test/suite/innodb/t/log_encrypt_2_mk.test @@ -1,2 +1,2 @@ ---let KEYRING_PARAMS=--early-plugin-load="keyring_file=$KEYRING_PLUGIN" --loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring1 $KEYRING_PLUGIN_OPT +--let KEYRING_PARAMS=--early-plugin-load="keyring_file=$KEYRING_PLUGIN" --loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring2 $KEYRING_PLUGIN_OPT --source include/log_encrypt_2.inc diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c7852c380410..d2202bd48ade 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3909,6 +3909,8 @@ innobase_fix_tablespaces_empty_uuid() return(false); } + log_enable_encryption_if_set(); + /* We only need to handle the case when an encrypted tablespace is created at startup. If it is 0, there is no encrypted tablespace, If it is > 1, it means we already have fixed the UUID */ @@ -3947,7 +3949,7 @@ innobase_fix_tablespaces_empty_uuid() space_ids.push_back(srv_sys_space.space_id()); space_ids.push_back(srv_tmp_space.space_id()); - bool ret = !fil_encryption_rotate_global(space_ids); + bool ret = !fil_encryption_rotate_global(space_ids) || !log_rotate_encryption(); my_free(master_key); @@ -4004,7 +4006,7 @@ innobase_encryption_key_rotation() return(true); } - ret = !fil_encryption_rotate(); + ret = !fil_encryption_rotate() || !log_rotate_encryption(); my_free(master_key); diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index a8e52df63215..d1bf4956584c 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -62,6 +62,8 @@ Created 12/9/1995 Heikki Tuuri #include "system_key.h" +static redo_log_encrypt_enum found_log_encryption_mode = REDO_LOG_ENCRYPT_OFF; + /* General philosophy of InnoDB redo-logs: @@ -1123,6 +1125,7 @@ log_read_encryption() if (memcmp(log_block_buf + LOG_HEADER_CREATOR_END, ENCRYPTION_KEY_MAGIC_RK, ENCRYPTION_MAGIC_SIZE) == 0) { encryption_magic = true; + found_log_encryption_mode = REDO_LOG_ENCRYPT_RK; /* Make sure the keyring is loaded. */ if (!Encryption::check_keyring()) { @@ -1165,6 +1168,7 @@ log_read_encryption() if (memcmp(log_block_buf + LOG_HEADER_CREATOR_END, ENCRYPTION_KEY_MAGIC_V2, ENCRYPTION_MAGIC_SIZE) == 0) { encryption_magic = true; + found_log_encryption_mode = REDO_LOG_ENCRYPT_MK; /* Make sure the keyring is loaded. */ if (!Encryption::check_keyring()) { @@ -1298,7 +1302,8 @@ log_write_encryption( } log_write_mutex_enter(); - if (srv_redo_log_encrypt == REDO_LOG_ENCRYPT_MK) { + if (srv_redo_log_encrypt == REDO_LOG_ENCRYPT_MK || + found_log_encryption_mode == REDO_LOG_ENCRYPT_MK) { if (!log_file_header_fill_encryption(log_block_buf, key, iv)) { @@ -1306,7 +1311,8 @@ log_write_encryption( log_write_mutex_exit(); return(false); } - } else if (srv_redo_log_encrypt == REDO_LOG_ENCRYPT_RK) { + } else if (srv_redo_log_encrypt == REDO_LOG_ENCRYPT_RK || + found_log_encryption_mode == REDO_LOG_ENCRYPT_RK) { if (!log_file_header_fill_encryption(log_block_buf, version, iv)) { diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 41a1a53b4243..2b2580b31685 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -2879,8 +2879,6 @@ DECLARE_THREAD(srv_master_thread)( srv_master_do_idle_tasks(); } - log_enable_encryption_if_set(); - srv_enable_undo_encryption_if_set(); } From fd21c457b171ee22bb302f85a275943cff243049 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Sat, 15 Dec 2018 13:44:38 +0200 Subject: [PATCH 129/214] [PS-5092] Save configs on package removal --- build-ps/percona-server.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build-ps/percona-server.spec b/build-ps/percona-server.spec index 3319655492d7..79df316b81e5 100644 --- a/build-ps/percona-server.spec +++ b/build-ps/percona-server.spec @@ -630,6 +630,18 @@ echo "See http://www.percona.com/doc/percona-server/5.7/management/udf_percona_t /sbin/chkconfig --del mysql fi %endif +if [ "$1" = 0 ]; then + timestamp=$(date "+%Y%m%d-%H%M%S") + if [ ! -L /etc/my.cnf ]; then + cp -p /etc/my.cnf /etc/my.cnf_back-${timestamp} + else + realfile=$(readlink -f /etc/my.cnf) + cp "${realfile}" "${realfile}_back-${timestamp}" + fi + cp -rp /etc/percona-server.conf.d /etc/percona-server.conf.d_back-${timestamp} + cp -rp /etc/my.cnf.d /etc/my.cnf.d_back-${timestamp} +fi + %postun -n Percona-Server-server%{product_suffix} %if 0%{?systemd} From 9e6918e30b80f98b975c432175e7de173be0cb84 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Sat, 15 Dec 2018 13:44:38 +0200 Subject: [PATCH 130/214] [PS-5092] Save configs on package removal (cherry picked from commit fd21c457b171ee22bb302f85a275943cff243049) --- build-ps/percona-server.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build-ps/percona-server.spec b/build-ps/percona-server.spec index 3319655492d7..79df316b81e5 100644 --- a/build-ps/percona-server.spec +++ b/build-ps/percona-server.spec @@ -630,6 +630,18 @@ echo "See http://www.percona.com/doc/percona-server/5.7/management/udf_percona_t /sbin/chkconfig --del mysql fi %endif +if [ "$1" = 0 ]; then + timestamp=$(date "+%Y%m%d-%H%M%S") + if [ ! -L /etc/my.cnf ]; then + cp -p /etc/my.cnf /etc/my.cnf_back-${timestamp} + else + realfile=$(readlink -f /etc/my.cnf) + cp "${realfile}" "${realfile}_back-${timestamp}" + fi + cp -rp /etc/percona-server.conf.d /etc/percona-server.conf.d_back-${timestamp} + cp -rp /etc/my.cnf.d /etc/my.cnf.d_back-${timestamp} +fi + %postun -n Percona-Server-server%{product_suffix} %if 0%{?systemd} From 7e995e286044007f7fe39c5805804fcea8e1eb60 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Sun, 16 Dec 2018 16:07:37 +0200 Subject: [PATCH 131/214] Change backup name --- build-ps/percona-server.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-ps/percona-server.spec b/build-ps/percona-server.spec index 79df316b81e5..5e7193890844 100644 --- a/build-ps/percona-server.spec +++ b/build-ps/percona-server.spec @@ -631,15 +631,15 @@ echo "See http://www.percona.com/doc/percona-server/5.7/management/udf_percona_t fi %endif if [ "$1" = 0 ]; then - timestamp=$(date "+%Y%m%d-%H%M%S") + timestamp=$(date '+%Y%m%d-%H%M') if [ ! -L /etc/my.cnf ]; then - cp -p /etc/my.cnf /etc/my.cnf_back-${timestamp} + cp -p /etc/my.cnf /etc/my.cnf_backup-${timestamp} else realfile=$(readlink -f /etc/my.cnf) - cp "${realfile}" "${realfile}_back-${timestamp}" + cp "${realfile}" "${realfile}_backup-${timestamp}" fi - cp -rp /etc/percona-server.conf.d /etc/percona-server.conf.d_back-${timestamp} - cp -rp /etc/my.cnf.d /etc/my.cnf.d_back-${timestamp} + cp -rp /etc/percona-server.conf.d /etc/percona-server.conf.d_backup-${timestamp} + cp -rp /etc/my.cnf.d /etc/my.cnf.d_backup-${timestamp} fi From 3b17d87e462427ec3fa578018b4dda489133877a Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Fri, 14 Dec 2018 21:56:49 +0200 Subject: [PATCH 132/214] Implement PS-2477 (Basic test cases should be created for PAM plugin) Although PAM authentication is impossible to test in MTR without system cooperation, it is possible to do minimal plugin testing without testing authentication itself: that INSTALL/UNINSTALL PLUGIN works and that it is possible to CREATE USER with this authentication method. Add such tests to the plugin-specific test directory, add this suite to the default suite list, and install the test files. --- mysql-test/include/have_auth_pam.inc | 21 +++++++++++++++++++ mysql-test/include/have_auth_pam_compat.inc | 21 +++++++++++++++++++ mysql-test/include/plugin.defs | 2 ++ mysql-test/mysql-test-run.pl | 3 ++- plugin/percona-pam-for-mysql/CMakeLists.txt | 7 +++++++ .../tests/mtr/auth_pam-master.opt | 1 + .../tests/mtr/auth_pam.result | 4 ++++ .../tests/mtr/auth_pam.test | 15 +++++++++++++ .../tests/mtr/auth_pam_compat-master.opt | 1 + .../tests/mtr/auth_pam_compat.result | 4 ++++ .../tests/mtr/auth_pam_compat.test | 15 +++++++++++++ 11 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 mysql-test/include/have_auth_pam.inc create mode 100644 mysql-test/include/have_auth_pam_compat.inc create mode 100644 plugin/percona-pam-for-mysql/tests/mtr/auth_pam-master.opt create mode 100644 plugin/percona-pam-for-mysql/tests/mtr/auth_pam.result create mode 100644 plugin/percona-pam-for-mysql/tests/mtr/auth_pam.test create mode 100644 plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat-master.opt create mode 100644 plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.result create mode 100644 plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.test diff --git a/mysql-test/include/have_auth_pam.inc b/mysql-test/include/have_auth_pam.inc new file mode 100644 index 000000000000..3fca46cd3abc --- /dev/null +++ b/mysql-test/include/have_auth_pam.inc @@ -0,0 +1,21 @@ +# +# Check if server has support for loading plugins +# +if (`SELECT @@have_dynamic_loading != 'YES'`) { + --skip auth_pam plugin requires dynamic loading +} + +# +# Check if the variable AUTH_PAM is set +# +if (!$AUTH_PAM) { + --skip Could not find library for auth_pam plugin, see the file plugin.defs +} + +# +# Check if --plugin-dir was setup for auth_pam +# +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$AUTH_PAM_OPT/'`) { + --skip auth_pam plugin requires that --plugin-dir is set to the auth_pam plugin dir +} +enable_query_log; diff --git a/mysql-test/include/have_auth_pam_compat.inc b/mysql-test/include/have_auth_pam_compat.inc new file mode 100644 index 000000000000..85726f162087 --- /dev/null +++ b/mysql-test/include/have_auth_pam_compat.inc @@ -0,0 +1,21 @@ +# +# Check if server has support for loading plugins +# +if (`SELECT @@have_dynamic_loading != 'YES'`) { + --skip auth_pam_compat plugin requires dynamic loading +} + +# +# Check if the variable AUTH_PAM_COMPAT is set +# +if (!$AUTH_PAM_COMPAT) { + --skip Could not find library for auth_pam_compat plugin, see the file plugin.defs +} + +# +# Check if --plugin-dir was setup for auth_pam_compat +# +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$AUTH_PAM_COMPAT_OPT/'`) { + --skip auth_pam_compat plugin requires that --plugin-dir is set to the auth_pam_compat plugin dir +} +enable_query_log; diff --git a/mysql-test/include/plugin.defs b/mysql-test/include/plugin.defs index c5b83de0d52a..db2d3045ac3e 100644 --- a/mysql-test/include/plugin.defs +++ b/mysql-test/include/plugin.defs @@ -61,3 +61,5 @@ connection_control plugin/connection_control CONNECTION_CONTROL_PLUGIN con ha_tokudb storage/tokudb TOKUDB tokudb,tokudb_trx,tokudb_locks,tokudb_lock_waits,tokudb_fractal_tree_info,tokudb_background_job_status,tokudb_file_map tokudb_backup plugin/tokudb-backup-plugin TOKUDB_BACKUP tokudb_backup ha_rocksdb storage/rocksdb ROCKSDB rocksdb,rocksdb_cfstats,rocksdb_dbstats,rocksdb_perf_context,rocksdb_perf_context_global,rocksdb_cf_options,rocksdb_compaction_stats,rocksdb_global_info,rocksdb_ddl,rocksdb_index_file_map,rocksdb_locks,rocksdb_trx +auth_pam plugin/percona-pam-for-mysql AUTH_PAM +auth_pam_compat plugin/percona-pam-for-mysql AUTH_PAM_COMPAT diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index bbfd57faf362..a4dc9a2a8e7f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -170,7 +170,8 @@ END ."innodb_zip,perfschema,funcs_1,funcs_2,opt_trace,parts,auth_sec," ."connection_control,jp,stress,engines/iuds,engines/funcs," ."query_response_time,innodb_stress,tokudb.add_index,tokudb.alter_table," - ."tokudb,tokudb.bugs,tokudb.parts,tokudb.rpl,tokudb.perfschema"; + ."tokudb,tokudb.bugs,tokudb.parts,tokudb.rpl,tokudb.perfschema," + ."percona-pam-for-mysql"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose diff --git a/plugin/percona-pam-for-mysql/CMakeLists.txt b/plugin/percona-pam-for-mysql/CMakeLists.txt index 695a571b47b1..b650d8669563 100644 --- a/plugin/percona-pam-for-mysql/CMakeLists.txt +++ b/plugin/percona-pam-for-mysql/CMakeLists.txt @@ -32,5 +32,12 @@ IF(HAVE_PAM AND HAVE_GETPWNAM_R AND HAVE_GETGRGID_R) MYSQL_ADD_PLUGIN(auth_pam ${AUTH_PAM_SOURCES} LINK_LIBRARIES pam MODULE_ONLY) MYSQL_ADD_PLUGIN(auth_pam_compat ${AUTH_PAM_COMPAT_SOURCES} LINK_LIBRARIES pam MODULE_ONLY) MYSQL_ADD_PLUGIN(dialog src/dialog.c LINK_LIBRARIES perconaserverclient MODULE_ONLY) + + IF(UNIX) + IF(INSTALL_MYSQLTESTDIR) + INSTALL(DIRECTORY tests/mtr/ DESTINATION ${INSTALL_MYSQLTESTDIR}/suite/percona-pam-for-mysql COMPONENT Test) + ENDIF() + ENDIF() + ENDIF(HAVE_PAM AND HAVE_GETPWNAM_R AND HAVE_GETGRGID_R) ENDIF(WITH_PAM) diff --git a/plugin/percona-pam-for-mysql/tests/mtr/auth_pam-master.opt b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam-master.opt new file mode 100644 index 000000000000..e5a630e0d3dc --- /dev/null +++ b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam-master.opt @@ -0,0 +1 @@ +$AUTH_PAM_OPT diff --git a/plugin/percona-pam-for-mysql/tests/mtr/auth_pam.result b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam.result new file mode 100644 index 000000000000..0e94f5174213 --- /dev/null +++ b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam.result @@ -0,0 +1,4 @@ +INSTALL PLUGIN auth_pam SONAME 'auth_pam.so'; +CREATE USER 'pam_user'@'localhost' IDENTIFIED WITH auth_pam; +DROP USER 'pam_user'@'localhost'; +UNINSTALL PLUGIN auth_pam; diff --git a/plugin/percona-pam-for-mysql/tests/mtr/auth_pam.test b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam.test new file mode 100644 index 000000000000..fecc14dfddf5 --- /dev/null +++ b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam.test @@ -0,0 +1,15 @@ +# +# auth_pam MTR tests. Complete testing is impossible to do in MTR without +# system-wide PAM setup, but it is possible to do minimal tests not involving +# actual authentication +# +--source include/have_auth_pam.inc + +--replace_regex /\.dll/.so/ +eval INSTALL PLUGIN auth_pam SONAME '$AUTH_PAM'; + +CREATE USER 'pam_user'@'localhost' IDENTIFIED WITH auth_pam; + +DROP USER 'pam_user'@'localhost'; + +UNINSTALL PLUGIN auth_pam; diff --git a/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat-master.opt b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat-master.opt new file mode 100644 index 000000000000..ad3ff260bb63 --- /dev/null +++ b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat-master.opt @@ -0,0 +1 @@ +$AUTH_PAM_COMPAT_OPT diff --git a/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.result b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.result new file mode 100644 index 000000000000..29d150c35d27 --- /dev/null +++ b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.result @@ -0,0 +1,4 @@ +INSTALL PLUGIN auth_pam_compat SONAME 'auth_pam_compat.so'; +CREATE USER 'pam_user'@'localhost' IDENTIFIED WITH auth_pam_compat; +DROP USER 'pam_user'@'localhost'; +UNINSTALL PLUGIN auth_pam_compat; diff --git a/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.test b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.test new file mode 100644 index 000000000000..df5e74084f11 --- /dev/null +++ b/plugin/percona-pam-for-mysql/tests/mtr/auth_pam_compat.test @@ -0,0 +1,15 @@ +# +# auth_pam MTR tests. Complete testing is impossible to do in MTR without +# system-wide PAM setup, but it is possible to do minimal tests not involving +# actual authentication +# +--source include/have_auth_pam_compat.inc + +--replace_regex /\.dll/.so/ +eval INSTALL PLUGIN auth_pam_compat SONAME '$AUTH_PAM_COMPAT'; + +CREATE USER 'pam_user'@'localhost' IDENTIFIED WITH auth_pam_compat; + +DROP USER 'pam_user'@'localhost'; + +UNINSTALL PLUGIN auth_pam_compat; From 635b8e751fff2bd090b1534deef48b44d1d914e6 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Mon, 17 Dec 2018 10:35:52 +0100 Subject: [PATCH 133/214] PS-5025: Testcase ensuring that compressed columns work after altering --- .../innodb/r/xtradb_compressed_columns.result | 29 +++++++++++ .../innodb/t/xtradb_compressed_columns.test | 52 +++++++++++-------- 2 files changed, 59 insertions(+), 22 deletions(-) diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns.result index 44fa40e4b4a1..69710c89e90f 100644 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns.result +++ b/mysql-test/suite/innodb/r/xtradb_compressed_columns.result @@ -1,3 +1,4 @@ +# only blob/text/varchar/varbinary are supported CREATE TABLE t1 (a INT COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; ERROR HY000: Can not define column 'a' in compressed format CREATE TABLE t2 (a VARCHAR(100) COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; @@ -48,6 +49,8 @@ Table Create Table t9 CREATE TABLE `t9` ( `a` varchar(1000) /*!50633 COLUMN_FORMAT COMPRESSED */ DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# test index creation +# compressed columns are not allowed to defined as a part or a key CREATE TABLE t1(a BLOB COLUMN_FORMAT COMPRESSED, KEY(a(10))); ERROR HY000: Compressed column 'a' is not allowed in the key list CREATE TABLE t1(a BLOB COLUMN_FORMAT COMPRESSED); @@ -55,7 +58,9 @@ ALTER TABLE t3 ADD KEY(a(10)); ERROR HY000: Compressed column 'a' is not allowed in the key list DROP TABLE t1; CREATE TABLE t1 (a BLOB) ENGINE=InnoDB; +# it's ok if a blob column is not compressed ALTER TABLE t1 ADD KEY(a(10)); +# test modifying column format DROP TABLE t1; CREATE TABLE t1 (a BLOB) ENGINE=InnoDB; INSERT INTO t1 VALUES (REPEAT('abc',5)); @@ -88,6 +93,7 @@ ALTER TABLE t1 MODIFY COLUMN a BLOB COLUMN_FORMAT COMPRESSED; CHECKSUM TABLE t1; Table Checksum test.t1 1570560110 +# test adding column with default value DROP TABLE t1; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (NULL); @@ -103,6 +109,7 @@ a b c d 2 NULL NULL hello, world! see you! 3 hello! world! hello, world! see you! 4 hello world! hello, world! see you! +# test new option: innodb_compressed_columns_zip_level SHOW VARIABLES LIKE 'innodb_compressed_columns_zip_level'; Variable_name Value innodb_compressed_columns_zip_level 6 @@ -135,6 +142,7 @@ SELECT @@global.innodb_compressed_columns_zip_level; SELECT MAX(LENGTH(a)) FROM t1; MAX(LENGTH(a)) 800 +# test new option: innodb_compressed_columns_threshold SHOW VARIABLES LIKE 'innodb_compressed_columns_threshold'; Variable_name Value innodb_compressed_columns_threshold 96 @@ -194,6 +202,7 @@ a b c SELECT MAX(LENGTH(d)) FROM t1; MAX(LENGTH(d)) 300 +# test checksum DROP TABLE t2; CREATE TABLE t2 LIKE t1; INSERT INTO t2 SELECT * FROM t1; @@ -211,9 +220,13 @@ CHECKSUM TABLE t1, t2; Table Checksum test.t1 2260691284 test.t2 2260691284 +# cleanup SET GLOBAL innodb_compressed_columns_zip_level = @old_innodb_compressed_columns_zip_level; SET GLOBAL innodb_compressed_columns_threshold = @old_innodb_compressed_columns_threshold; DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8, t9; +# +# Bug lp:1621708 "InnoDB: Failing assertion: len <= col->len || col->mtype == 5 || (col->len == 0 && col->mtype == 1) Edit" +# SET @saved_innodb_compressed_columns_threshold = @@global.innodb_compressed_columns_threshold; CREATE TABLE t1( a VARCHAR(1) COLUMN_FORMAT COMPRESSED @@ -254,11 +267,17 @@ abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcab abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc DROP TABLE t1; SET GLOBAL innodb_compressed_columns_threshold = @saved_innodb_compressed_columns_threshold; +# +# Bug lp:1622588 "handle_fatal_signal (sig=11) in free_root from TABLE_SHARE::destroy on ALTER TABLE t1 ADD COLUMN ... COLUMN_FORMAT COMPRESSED" +# CREATE TABLE t1( id INT ); ALTER TABLE t1 ADD COLUMN c VARCHAR(1000) COLUMN_FORMAT COMPRESSED; DROP TABLE t1; +# +# A bug in row_merge_buf_add(): "ut_ad(len <= col->len || col->mtype == DATA_BLOB)" assertion +# SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; SET GLOBAL innodb_compressed_columns_zip_level = 0; CREATE TABLE t1 ( @@ -276,6 +295,9 @@ number_of_rows_after_alteration 1 DROP TABLE t1; SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; +# +# Bug lp:1640810 "Adding COMPRESSED attributes to InnoDB special tables fields can lead to server crashes" +# call mtr.add_suppression("InnoDB: Error: Column .* in table .* has unexpected COMPRESSED attribute"); ALTER TABLE mysql.innodb_index_stats MODIFY stat_description VARCHAR(1024) COLLATE utf8_bin NOT NULL COLUMN_FORMAT COMPRESSED; @@ -284,3 +306,10 @@ SELECT * FROM mysql.innodb_index_stats; DROP TABLE t1; ALTER TABLE mysql.innodb_index_stats MODIFY stat_description VARCHAR(1024) COLLATE utf8_bin NOT NULL; +# +# Bug PS-5025 Assertion after altering a compressed column +# +CREATE TABLE t1 (c1 VARBINARY(5) COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; +ALTER TABLE t1 ADD c2 CHAR(10) FIRST; +INSERT INTO t1 VALUES(0,11111); +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns.test index af03b6a88459..8cb481dea9a7 100644 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns.test +++ b/mysql-test/suite/innodb/t/xtradb_compressed_columns.test @@ -1,6 +1,6 @@ --source include/have_innodb.inc -# only blob/text/varchar/varbinary are supported +--echo # only blob/text/varchar/varbinary are supported --error ER_UNSUPPORTED_COMPRESSED_COLUMN_TYPE CREATE TABLE t1 (a INT COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; CREATE TABLE t2 (a VARCHAR(100) COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; @@ -20,8 +20,8 @@ SHOW CREATE TABLE t8; CREATE TABLE t9 (a VARCHAR(1000) COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; SHOW CREATE TABLE t9; -# test index creation -# compressed columns are not allowed to defined as a part or a key +--echo # test index creation +--echo # compressed columns are not allowed to defined as a part or a key --error ER_COMPRESSED_COLUMN_USED_AS_KEY CREATE TABLE t1(a BLOB COLUMN_FORMAT COMPRESSED, KEY(a(10))); @@ -31,10 +31,10 @@ ALTER TABLE t3 ADD KEY(a(10)); DROP TABLE t1; CREATE TABLE t1 (a BLOB) ENGINE=InnoDB; -# it's ok if a blob column is not compressed +--echo # it's ok if a blob column is not compressed ALTER TABLE t1 ADD KEY(a(10)); -# test modifying column format +--echo # test modifying column format DROP TABLE t1; CREATE TABLE t1 (a BLOB) ENGINE=InnoDB; INSERT INTO t1 VALUES (REPEAT('abc',5)); @@ -50,7 +50,7 @@ ALTER TABLE t1 MODIFY COLUMN a VARCHAR(10000); ALTER TABLE t1 MODIFY COLUMN a BLOB COLUMN_FORMAT COMPRESSED; CHECKSUM TABLE t1; -# test adding column with default value +--echo # test adding column with default value DROP TABLE t1; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (NULL); @@ -62,7 +62,7 @@ ALTER TABLE t1 ADD COLUMN d VARCHAR(10000) COLUMN_FORMAT COMPRESSED DEFAULT "hel INSERT INTO t1 (a,b,c) VALUES (NULL, "hello", "world!"); SELECT * FROM t1; -# test new option: innodb_compressed_columns_zip_level +--echo # test new option: innodb_compressed_columns_zip_level SHOW VARIABLES LIKE 'innodb_compressed_columns_zip_level'; SET @old_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; @@ -85,7 +85,7 @@ SELECT @@global.innodb_compressed_columns_zip_level; SELECT MAX(LENGTH(a)) FROM t1; -#test new option: innodb_compressed_columns_threshold +--echo # test new option: innodb_compressed_columns_threshold SHOW VARIABLES LIKE 'innodb_compressed_columns_threshold'; SET @old_innodb_compressed_columns_threshold = @@global.innodb_compressed_columns_threshold; @@ -116,7 +116,7 @@ SELECT COUNT(*) FROM t1; SELECT a,b,c FROM t1 LIMIT 10; SELECT MAX(LENGTH(d)) FROM t1; -#test checksum +--echo # test checksum DROP TABLE t2; CREATE TABLE t2 LIKE t1; INSERT INTO t2 SELECT * FROM t1; @@ -125,14 +125,14 @@ SHOW CREATE TABLE t2; CHECKSUM TABLE t1, t2; -#cleanup +--echo # cleanup SET GLOBAL innodb_compressed_columns_zip_level = @old_innodb_compressed_columns_zip_level; SET GLOBAL innodb_compressed_columns_threshold = @old_innodb_compressed_columns_threshold; DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8, t9; -# -# Bug lp:1621708 "InnoDB: Failing assertion: len <= col->len || col->mtype == 5 || (col->len == 0 && col->mtype == 1) Edit" -# +--echo # +--echo # Bug lp:1621708 "InnoDB: Failing assertion: len <= col->len || col->mtype == 5 || (col->len == 0 && col->mtype == 1) Edit" +--echo # SET @saved_innodb_compressed_columns_threshold = @@global.innodb_compressed_columns_threshold; CREATE TABLE t1( @@ -164,9 +164,9 @@ DROP TABLE t1; SET GLOBAL innodb_compressed_columns_threshold = @saved_innodb_compressed_columns_threshold; -# -# Bug lp:1622588 "handle_fatal_signal (sig=11) in free_root from TABLE_SHARE::destroy on ALTER TABLE t1 ADD COLUMN ... COLUMN_FORMAT COMPRESSED" -# +--echo # +--echo # Bug lp:1622588 "handle_fatal_signal (sig=11) in free_root from TABLE_SHARE::destroy on ALTER TABLE t1 ADD COLUMN ... COLUMN_FORMAT COMPRESSED" +--echo # CREATE TABLE t1( id INT ); @@ -174,9 +174,9 @@ ALTER TABLE t1 ADD COLUMN c VARCHAR(1000) COLUMN_FORMAT COMPRESSED; DROP TABLE t1; -# -# A bug in row_merge_buf_add(): "ut_ad(len <= col->len || col->mtype == DATA_BLOB)" assertion -# +--echo # +--echo # A bug in row_merge_buf_add(): "ut_ad(len <= col->len || col->mtype == DATA_BLOB)" assertion +--echo # SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; SET GLOBAL innodb_compressed_columns_zip_level = 0; @@ -196,9 +196,9 @@ DROP TABLE t1; SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; -# -# Bug lp:1640810 "Adding COMPRESSED attributes to InnoDB special tables fields can lead to server crashes" -# +--echo # +--echo # Bug lp:1640810 "Adding COMPRESSED attributes to InnoDB special tables fields can lead to server crashes" +--echo # call mtr.add_suppression("InnoDB: Error: Column .* in table .* has unexpected COMPRESSED attribute"); ALTER TABLE mysql.innodb_index_stats @@ -210,3 +210,11 @@ SELECT * FROM mysql.innodb_index_stats; DROP TABLE t1; ALTER TABLE mysql.innodb_index_stats MODIFY stat_description VARCHAR(1024) COLLATE utf8_bin NOT NULL; + +--echo # +--echo # Bug PS-5025 Assertion after altering a compressed column +--echo # +CREATE TABLE t1 (c1 VARBINARY(5) COLUMN_FORMAT COMPRESSED) ENGINE=InnoDB; +ALTER TABLE t1 ADD c2 CHAR(10) FIRST; +INSERT INTO t1 VALUES(0,11111); +DROP TABLE t1; From 72330f539f4dfe68d36b30ed6ccd09c92122ec24 Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Mon, 17 Dec 2018 08:43:58 -0700 Subject: [PATCH 134/214] PS-5163 : [PS8QA] handle_fatal_signal (sig=11) in DsMrr_impl::dsmrr_init - TokuDB was not properly initializing its DsMrr_impl in all locations needed. This was discovered in 8.0 as there has been some added validations/assertions there that do not exist in 5.6 or 5.7, but the change still applies to the lesser versions. There isn't a known test scenario in the lesser versions that would expose this, but created a test that triggers the assertion in 8.0. --- mysql-test/suite/tokudb.bugs/r/PS-5163.result | 5 +++++ mysql-test/suite/tokudb.bugs/t/PS-5163.test | 11 +++++++++++ storage/tokudb/ha_tokudb_mrr_mysql.cc | 1 + 3 files changed, 17 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/PS-5163.result create mode 100644 mysql-test/suite/tokudb.bugs/t/PS-5163.test diff --git a/mysql-test/suite/tokudb.bugs/r/PS-5163.result b/mysql-test/suite/tokudb.bugs/r/PS-5163.result new file mode 100644 index 000000000000..a203787f11d9 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/PS-5163.result @@ -0,0 +1,5 @@ +CREATE TABLE t1(c1 INT,c2 INT,c3 CHAR(10),c4 CHAR(10),c5 CHAR(10),PRIMARY KEY(c1),INDEX(c3,c4(1),c5(1)),INDEX(c2)) ENGINE=TokuDB; +INSERT INTO t1 VALUES(),(),(),(),(); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +UPDATE t1 SET c1=1 WHERE c1=1 OR c2=1; +DROP TABLE t1; diff --git a/mysql-test/suite/tokudb.bugs/t/PS-5163.test b/mysql-test/suite/tokudb.bugs/t/PS-5163.test new file mode 100644 index 000000000000..5fc01bb5f0e0 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/PS-5163.test @@ -0,0 +1,11 @@ +--source include/have_tokudb.inc + +CREATE TABLE t1(c1 INT,c2 INT,c3 CHAR(10),c4 CHAR(10),c5 CHAR(10),PRIMARY KEY(c1),INDEX(c3,c4(1),c5(1)),INDEX(c2)) ENGINE=TokuDB; +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES(),(),(),(),(); + +# 8.0 asserts here down in data dictionary because ha_tokudb::ds_mrr did not +# properly call ds_mrr.init(this, table) +UPDATE t1 SET c1=1 WHERE c1=1 OR c2=1; + +DROP TABLE t1; diff --git a/storage/tokudb/ha_tokudb_mrr_mysql.cc b/storage/tokudb/ha_tokudb_mrr_mysql.cc index 84b64009ef2f..480ae23802b8 100644 --- a/storage/tokudb/ha_tokudb_mrr_mysql.cc +++ b/storage/tokudb/ha_tokudb_mrr_mysql.cc @@ -31,6 +31,7 @@ int ha_tokudb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf) { + ds_mrr.init(this, table); return ds_mrr.dsmrr_init(this, seq, seq_init_param, n_ranges, mode, buf); } From 13fb5548812ae194f581d78f8876203cc72e1d47 Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Sun, 16 Dec 2018 20:50:44 -0700 Subject: [PATCH 135/214] PS-5158 : *** buffer overflow detected *** in mysqld on INSERT query - For table/index names expanded into fscs, bulk load status buffer was too small to contain entire name and message. Also, code was using unsafe sprintf instead of snprintf. Made buffer large enough to always contain full path and fscs table name as well as converted to using snprintf. - Created new test that would trigger the overrun/segfault without the fix. - This must be cherry-picked forward from 5.6 as test passage requires the fix from commit 53371b029266587b8624d544d33b753d93f2d9ff to be present which is net yet behind the 5.6->5.7 GCA point. (cherry picked from 5.6 commit a7160d701f1f331ba10832a08bc67d8fada75e1e) --- mysql-test/suite/tokudb.bugs/r/PS-5158.result | 7 +++++ mysql-test/suite/tokudb.bugs/t/PS-5158.test | 27 ++++++++++++++++++ storage/tokudb/ha_tokudb.cc | 28 +++++++++++-------- storage/tokudb/ha_tokudb.h | 2 +- 4 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 mysql-test/suite/tokudb.bugs/r/PS-5158.result create mode 100644 mysql-test/suite/tokudb.bugs/t/PS-5158.test diff --git a/mysql-test/suite/tokudb.bugs/r/PS-5158.result b/mysql-test/suite/tokudb.bugs/r/PS-5158.result new file mode 100644 index 000000000000..7b91bd13b1aa --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/PS-5158.result @@ -0,0 +1,7 @@ +include/assert.inc [Requires tokudb_dir_per_db=1] +CREATE DATABASE `new..............................................end`; +USE `new..............................................end`; +CREATE TABLE t1(a INT KEY,b INT)ENGINE=TokuDB; +INSERT INTO t1 VALUES(1,11),(2,12),(3,13),(4,14),(5,15); +USE test; +DROP DATABASE `new..............................................end`; diff --git a/mysql-test/suite/tokudb.bugs/t/PS-5158.test b/mysql-test/suite/tokudb.bugs/t/PS-5158.test new file mode 100644 index 000000000000..1dea7757819b --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/PS-5158.test @@ -0,0 +1,27 @@ +# Test for PS-5163 : [PS8QA] handle_fatal_signal (sig=11) in DsMrr_impl::dsmrr_init +# and PS-4828 : Inserting data into TokuDB database with name that contains non-alphanumerical characters can lead to the ZN9ha_tokudb16bulk_insert_pollEPvf assertion +# +# The cause is a buffer overrun in LOADER_CONTEXT where the char buffer used for +# maintaining the proc info string was too small and no validation or prevention +# was being done to ensure the string stayed within the limits of the buffer. +# Normally this would have been difficult to hit, but, now with the combination +# of tokudb_dir_per_db=ON and the expansion of the database name from latin1 +# (or whatever) to the fscs encoding the space required for a max length +# db.table name could be quite larger than the buffer was originally sized. + +--source include/have_tokudb.inc + +--let $assert_text= Requires tokudb_dir_per_db=1 +--let $assert_cond= [SELECT @@tokudb_dir_per_db] = 1 +--source include/assert.inc + +CREATE DATABASE `new..............................................end`; +USE `new..............................................end`; +CREATE TABLE t1(a INT KEY,b INT)ENGINE=TokuDB; + +# +# TokuDB bulk_insert_poll would crash here +# +INSERT INTO t1 VALUES(1,11),(2,12),(3,13),(4,14),(5,15); +USE test; +DROP DATABASE `new..............................................end`; diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index cdf68305bd41..243343726252 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -3301,15 +3301,17 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { int ha_tokudb::bulk_insert_poll(void* extra, float progress) { LOADER_CONTEXT context = (LOADER_CONTEXT)extra; if (thd_killed(context->thd)) { - sprintf(context->write_status_msg, - "The process has been killed, aborting bulk load."); + snprintf(context->write_status_msg, + sizeof(context->write_status_msg), + "The process has been killed, aborting bulk load."); return ER_ABORTING_CONNECTION; } float percentage = progress * 100; - sprintf(context->write_status_msg, - "Loading of data t %s about %.1f%% done", - context->ha->share->full_table_name(), - percentage); + snprintf(context->write_status_msg, + sizeof(context->write_status_msg), + "Loading of data t %s about %.1f%% done", + context->ha->share->full_table_name(), + percentage); thd_proc_info(context->thd, context->write_status_msg); #ifdef HA_TOKUDB_HAS_THD_PROGRESS thd_progress_report(context->thd, (unsigned long long)percentage, 100); @@ -8486,15 +8488,17 @@ int ha_tokudb::tokudb_add_index( int ha_tokudb::tokudb_add_index_poll(void* extra, float progress) { LOADER_CONTEXT context = (LOADER_CONTEXT)extra; if (thd_killed(context->thd)) { - sprintf(context->write_status_msg, - "The process has been killed, aborting add index."); + snprintf(context->write_status_msg, + sizeof(context->write_status_msg), + "The process has been killed, aborting add index."); return ER_ABORTING_CONNECTION; } float percentage = progress * 100; - sprintf(context->write_status_msg, - "Adding of indexes to %s about %.1f%% done", - context->ha->share->full_table_name(), - percentage); + snprintf(context->write_status_msg, + sizeof(context->write_status_msg), + "Adding of indexes to %s about %.1f%% done", + context->ha->share->full_table_name(), + percentage); thd_proc_info(context->thd, context->write_status_msg); #ifdef HA_TOKUDB_HAS_THD_PROGRESS thd_progress_report(context->thd, (unsigned long long)percentage, 100); diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index a600d0e4fc75..e48caad2c190 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -41,7 +41,7 @@ class ha_tokudb; typedef struct loader_context { THD* thd; - char write_status_msg[200]; + char write_status_msg[1024]; ha_tokudb* ha; } *LOADER_CONTEXT; From 54f17454281985ad1f9251c28fb0cf4910f97d65 Mon Sep 17 00:00:00 2001 From: Sergei Glushchenko Date: Tue, 18 Dec 2018 11:21:21 +0700 Subject: [PATCH 136/214] PS-4758: A sequence of LOCK TABLES FOR BACKUP and STOP SLAVE SQL_THREAD can cause replication to be blocked and cannot be restarted normally When after LOCK TABLES FOR BACKUP / LOCK BINLOG FOR BACKUP slave SQL thread is waiting for backup / binlog lock subsequent STOP SLAVE SQL_THREAD causing deadlock. SQL thread is waiting for backup lock, STOP SLAVE is waiting for SQL thread to complete current statement. Fix is to throw an error when the thread which acquired the backup lock is trying to stop slave. --- .../suite/rpl/r/rpl_backup_locks.result | 18 ++++++ mysql-test/suite/rpl/t/rpl_backup_locks.test | 60 +++++++++++++++++++ sql/sql_parse.cc | 5 +- 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/r/rpl_backup_locks.result b/mysql-test/suite/rpl/r/rpl_backup_locks.result index 4a8f78820d4d..b2944203f389 100644 --- a/mysql-test/suite/rpl/r/rpl_backup_locks.result +++ b/mysql-test/suite/rpl/r/rpl_backup_locks.result @@ -37,5 +37,23 @@ INSERT INTO t_innodb VALUES (1); include/check_slave_param.inc [Exec_Master_Log_Pos] UNLOCK BINLOG; # connection master +# connection slave +LOCK TABLES FOR BACKUP; +# connection master +INSERT INTO t_myisam VALUES (0); +# connection slave +STOP SLAVE SQL_THREAD; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +UNLOCK TABLES; +# connection master +# connection slave +LOCK BINLOG FOR BACKUP; +# connection master +INSERT INTO t_innodb VALUES (1); +# connection slave +STOP SLAVE SQL_THREAD; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +UNLOCK BINLOG; +# connection master DROP TABLE t_innodb, t_myisam; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_backup_locks.test b/mysql-test/suite/rpl/t/rpl_backup_locks.test index 0091cad5f96d..91cb7869f5b9 100644 --- a/mysql-test/suite/rpl/t/rpl_backup_locks.test +++ b/mysql-test/suite/rpl/t/rpl_backup_locks.test @@ -121,6 +121,66 @@ UNLOCK BINLOG; --connection master --echo # connection master +############################################################################ +# PS-4758: A sequence of LOCK TABLES FOR BACKUP and STOP SLAVE SQL_THREAD +# can cause replication to be blocked and cannot be restarted +# normally +############################################################################ + +--connection slave +--echo # connection slave + +LOCK TABLES FOR BACKUP; + +--connection master +--echo # connection master + +INSERT INTO t_myisam VALUES (0); + +--connection slave +--echo # connection slave + +let $wait_condition= + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE STATE = "Waiting for backup lock" AND + (INFO = "INSERT INTO t_myisam VALUES (0)" OR INFO IS NULL); +--source include/wait_condition.inc + +--error ER_LOCK_OR_ACTIVE_TRANSACTION +STOP SLAVE SQL_THREAD; +UNLOCK TABLES; + +--connection master +--echo # connection master + +sync_slave_with_master; + +--connection slave +--echo # connection slave + +LOCK BINLOG FOR BACKUP; + +--connection master +--echo # connection master + +INSERT INTO t_innodb VALUES (1); + +--connection slave +--echo # connection slave + +let $wait_condition= + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE STATE = "Waiting for binlog lock" AND + (INFO = "INSERT INTO t_innodb VALUES (1)" OR INFO IS NULL); +--source include/wait_condition.inc + +--error ER_LOCK_OR_ACTIVE_TRANSACTION +STOP SLAVE SQL_THREAD; +UNLOCK BINLOG; + +--connection master +--echo # connection master + DROP TABLE t_innodb, t_myisam; sync_slave_with_master; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 541d0e3bccb2..77d81d83e478 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3655,7 +3655,10 @@ case SQLCOM_PREPARE: client thread has locked tables */ if (thd->locked_tables_mode || - thd->in_active_multi_stmt_transaction() || thd->global_read_lock.is_acquired()) + thd->in_active_multi_stmt_transaction() || + thd->global_read_lock.is_acquired() || + thd->backup_tables_lock.is_acquired() || + thd->backup_binlog_lock.is_acquired()) { my_message(ER_LOCK_OR_ACTIVE_TRANSACTION, ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0)); From e607d24fda862c3858e2f8b3b581b6e0d87ec667 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Tue, 18 Dec 2018 08:46:45 +0200 Subject: [PATCH 137/214] PS-3672 / PS-3673 / PS-3568 / PS-3535 in preparation for PS-5041 / PS-4999 Improve, cleanup and attempt to stabilize extended slow query log testcases: - create new include file log_prepare.inc to be included from each testcase that uses log_start.inc/log_stop.inc/log_cleanup.inc, and move saving the old slow_query_log, slow_query_log_file, and log_output values, and the setting of log_output to FILE from log_start.inc. These actions are redundant (and unstable in 8.0) for each log_start.inc invocation. Consequently move the restoring of these variables from log_stop.inc to log_cleanup.inc; - adjust the testcases to restore global variables to initial values, not to defaults; - drop any DROP thing IF EXISTS foo; idioms; - drop any restoring of session variables to default values; - use SET SESSION instead of plain SET consistently; - delete main.percona_bug1016991-master.opt and set slow_query_log_use_global_control to all in the testcase dynamically; - deleted stray innodb.percona_log_slow_slave_statements-innodb.result. --- mysql-test/include/log_cleanup.inc | 6 ++++ mysql-test/include/log_prepare.inc | 10 ++++++ mysql-test/include/log_start.inc | 5 --- mysql-test/include/log_stop.inc | 3 -- mysql-test/r/percona_bug1016991.result | 6 +++- .../percona_log_slow_admin_statements.result | 6 ++-- .../r/percona_log_slow_query_plan.result | 24 ++++++-------- .../r/percona_log_slow_query_plan_qc.result | 9 ++---- ...na_log_slow_slave_statements-innodb.result | 31 ------------------- .../percona_log_slow_slave_statements.result | 10 +++--- .../r/percona_log_slow_sp_statements.result | 7 ++--- .../r/percona_log_slow_verbosity.result | 7 ++--- mysql-test/r/percona_long_query_time.result | 6 ++-- .../r/percona_min_examined_row_limit.result | 10 +++--- ...percona_slow_extended_error_on_quit.result | 10 +++--- .../r/percona_slow_extended_log_error.result | 5 +-- ...ona_slow_query_log_rate_limit_write.result | 1 - ...ona_slow_query_log_timestamp_always.result | 5 ++- ..._slow_query_log_timestamp_precision.result | 7 ++--- ...a_slow_query_log_use_global_control.result | 10 +++--- .../innodb/t/percona_log_slow_innodb.test | 2 ++ .../t/percona_log_slow_innodb_debug.test | 2 ++ ...cona_log_slow_slave_statements_innodb.test | 6 ++-- mysql-test/t/percona_bug1016991-master.opt | 1 - mysql-test/t/percona_bug1016991.test | 7 ++++- mysql-test/t/percona_bug643149.test | 2 ++ .../t/percona_log_slow_admin_statements.test | 10 ++---- .../percona_log_slow_admin_statements_sp.test | 2 ++ mysql-test/t/percona_log_slow_query_plan.test | 8 ++--- .../t/percona_log_slow_query_plan_qc.test | 15 +++------ .../t/percona_log_slow_slave_statements.test | 19 +++++++----- .../t/percona_log_slow_sp_statements.test | 10 ++---- mysql-test/t/percona_log_slow_verbosity.test | 10 +++--- mysql-test/t/percona_long_query_time.test | 8 ++--- .../t/percona_min_examined_row_limit.test | 13 ++++---- .../percona_slow_extended_error_on_quit.test | 16 +++++----- .../t/percona_slow_extended_log_error.test | 10 ++---- .../percona_slow_query_log_always_write.test | 2 ++ mysql-test/t/percona_slow_query_log_rate.test | 2 ++ ...rcona_slow_query_log_rate_limit_write.test | 5 ++- ...rcona_slow_query_log_timestamp_always.test | 8 +++-- ...na_slow_query_log_timestamp_precision.test | 10 +++--- ...ona_slow_query_log_use_global_control.test | 12 ++++--- 43 files changed, 164 insertions(+), 194 deletions(-) create mode 100644 mysql-test/include/log_prepare.inc delete mode 100644 mysql-test/r/percona_log_slow_slave_statements-innodb.result delete mode 100644 mysql-test/t/percona_bug1016991-master.opt diff --git a/mysql-test/include/log_cleanup.inc b/mysql-test/include/log_cleanup.inc index 3fa330ec67d5..1c09c775a79f 100644 --- a/mysql-test/include/log_cleanup.inc +++ b/mysql-test/include/log_cleanup.inc @@ -1 +1,7 @@ --remove_files_wildcard $MYSQLTEST_VARDIR *.slog + +--disable_query_log +EVAL SET GLOBAL log_output= $log_output_old; +EVAL SET GLOBAL slow_query_log_file= "$slow_query_log_file_old"; +EVAL SET GLOBAL slow_query_log= $slow_query_log_old; +--enable_query_log diff --git a/mysql-test/include/log_prepare.inc b/mysql-test/include/log_prepare.inc new file mode 100644 index 000000000000..a5674b3a717d --- /dev/null +++ b/mysql-test/include/log_prepare.inc @@ -0,0 +1,10 @@ +--disable_query_log +--let slow_query_log_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log';` +SET GLOBAL slow_query_log=0; + +--let slow_query_log_file_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log_file';` +--let log_output_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'log_output';` + +SET GLOBAL log_output=FILE; + +--enable_query_log diff --git a/mysql-test/include/log_start.inc b/mysql-test/include/log_start.inc index f68aeaa6d03c..2951c19e14a0 100644 --- a/mysql-test/include/log_start.inc +++ b/mysql-test/include/log_start.inc @@ -1,10 +1,5 @@ ---let slow_query_log_file_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log_file';` ---let slow_query_log_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'slow_query_log';` ---let log_output_old=`SELECT Variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE Variable_name = 'log_output';` --disable_query_log --let log_file_full_path = $MYSQLTEST_VARDIR/$log_file.slog -SET GLOBAL slow_query_log=0; -SET GLOBAL log_output=FILE; --echo [log_start.inc] $log_file EVAL SET GLOBAL slow_query_log_file="$log_file_full_path"; SET GLOBAL slow_query_log=1; diff --git a/mysql-test/include/log_stop.inc b/mysql-test/include/log_stop.inc index b46c8888a36f..f95dd9d7cbaf 100644 --- a/mysql-test/include/log_stop.inc +++ b/mysql-test/include/log_stop.inc @@ -1,7 +1,4 @@ --disable_query_log SET GLOBAL slow_query_log=0; --echo [log_stop.inc] $log_file -EVAL SET GLOBAL log_output= $log_output_old; -EVAL SET GLOBAL slow_query_log_file= "$slow_query_log_file_old"; -EVAL SET GLOBAL slow_query_log= $slow_query_log_old; --enable_query_log diff --git a/mysql-test/r/percona_bug1016991.result b/mysql-test/r/percona_bug1016991.result index 968976c1bea9..a346f64bc97b 100644 --- a/mysql-test/r/percona_bug1016991.result +++ b/mysql-test/r/percona_bug1016991.result @@ -1,3 +1,6 @@ +SET @saved_long_query_time= @@long_query_time; +SET @saved_slow_query_log_use_global_control=@@GLOBAL.slow_query_log_use_global_control; +SET GLOBAL slow_query_log_use_global_control=ALL; SET @saved_slow_query_log_timestamp_always= @@slow_query_log_timestamp_always; SET GLOBAL slow_query_log_timestamp_always= TRUE; [log_start.inc] percona_slow_extended_query_log_1 @@ -12,5 +15,6 @@ SELECT 1; [log_stop.inc] percona_slow_extended_query_log_1 [log_grep.inc] file: percona_slow_extended_query_log_1 pattern: ^# Time: \d{6} (\d| )\d:\d\d:\d\d$ [log_grep.inc] lines: 1 -SET GLOBAL long_query_time=default; +SET GLOBAL long_query_time= @saved_long_query_time; SET GLOBAL slow_query_log_timestamp_always= @saved_slow_query_log_timestamp_always; +SET GLOBAL slow_query_log_use_global_control=@saved_slow_query_log_use_global_control; diff --git a/mysql-test/r/percona_log_slow_admin_statements.result b/mysql-test/r/percona_log_slow_admin_statements.result index dea666bfeab4..46de65e7460e 100644 --- a/mysql-test/r/percona_log_slow_admin_statements.result +++ b/mysql-test/r/percona_log_slow_admin_statements.result @@ -1,7 +1,7 @@ -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INT); SET SESSION min_examined_row_limit=0; SET SESSION long_query_time=0; +SET @saved_log_slow_admin_statements=@@GLOBAL.log_slow_admin_statements; SET GLOBAL log_slow_admin_statements=ON; [log_start.inc] percona_log_slow_admin_stmt_1 ALTER TABLE t1 ADD INDEX a(a); @@ -14,7 +14,5 @@ ALTER TABLE t1 DROP INDEX a; [log_stop.inc] percona_log_slow_admin_stmt_2 [log_grep.inc] file: percona_log_slow_admin_stmt_2 pattern: ALTER TABLE t1 DROP INDEX a; [log_grep.inc] lines: 0 -SET GLOBAL log_slow_admin_statements=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL log_slow_admin_statements=@saved_log_slow_admin_statements; DROP TABLE t1; diff --git a/mysql-test/r/percona_log_slow_query_plan.result b/mysql-test/r/percona_log_slow_query_plan.result index 57f454b3fe46..544c6de54744 100644 --- a/mysql-test/r/percona_log_slow_query_plan.result +++ b/mysql-test/r/percona_log_slow_query_plan.result @@ -98,7 +98,7 @@ Sort_merge_passes 6 SET SESSION sort_buffer_size=default; SHOW SESSION STATUS LIKE 'Select_scan'; Variable_name Value -Select_scan 37 +Select_scan 19 [log_start.inc] percona_slow_query_log.query_plan_4 SELECT * FROM t1 WHERE a=1; a b @@ -108,7 +108,7 @@ a b [log_grep.inc] found expected match count: 2 SHOW SESSION STATUS LIKE 'Select_scan'; Variable_name Value -Select_scan 40 +Select_scan 19 [log_start.inc] percona_slow_query_log.query_plan_5 SELECT COUNT(*) FROM t1; COUNT(*) @@ -118,7 +118,7 @@ COUNT(*) [log_grep.inc] found expected match count: 1 SHOW SESSION STATUS LIKE 'Select_scan'; Variable_name Value -Select_scan 44 +Select_scan 20 SET SESSION log_slow_filter='full_join,tmp_table,tmp_table_on_disk,filesort,filesort_on_disk'; [log_start.inc] percona_slow_query_log.query_plan_5a SELECT COUNT(*) FROM t1; @@ -129,7 +129,7 @@ COUNT(*) [log_grep.inc] lines: 0 SHOW SESSION STATUS LIKE 'Select_scan'; Variable_name Value -Select_scan 48 +Select_scan 21 SET SESSION log_slow_filter=default; CREATE TABLE t3(a INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t3 VALUES (1), (2), (3); @@ -173,7 +173,7 @@ Select_full_join 2 SET SESSION log_slow_filter=default; SHOW SESSION STATUS LIKE 'Created_tmp_tables'; Variable_name Value -Created_tmp_tables 49 +Created_tmp_tables 13 SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; Variable_name Value Created_tmp_disk_tables 0 @@ -191,7 +191,7 @@ COUNT(*) [log_grep.inc] found expected match count: 2 SHOW SESSION STATUS LIKE 'Created_tmp_tables'; Variable_name Value -Created_tmp_tables 52 +Created_tmp_tables 13 SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; Variable_name Value Created_tmp_disk_tables 0 @@ -211,7 +211,7 @@ COUNT(*) [log_grep.inc] found expected match count: 1 SHOW SESSION STATUS LIKE 'Created_tmp_tables'; Variable_name Value -Created_tmp_tables 57 +Created_tmp_tables 15 SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; Variable_name Value Created_tmp_disk_tables 0 @@ -228,7 +228,7 @@ COUNT(*) [log_grep.inc] lines: 0 SHOW SESSION STATUS LIKE 'Created_tmp_tables'; Variable_name Value -Created_tmp_tables 61 +Created_tmp_tables 16 SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; Variable_name Value Created_tmp_disk_tables 0 @@ -254,7 +254,7 @@ COUNT(*) [log_grep.inc] found expected match count: 1 SHOW SESSION STATUS LIKE 'Created_tmp_tables'; Variable_name Value -Created_tmp_tables 66 +Created_tmp_tables 18 SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; Variable_name Value Created_tmp_disk_tables 1 @@ -271,14 +271,10 @@ COUNT(*) [log_grep.inc] lines: 0 SHOW SESSION STATUS LIKE 'Created_tmp_tables'; Variable_name Value -Created_tmp_tables 70 +Created_tmp_tables 19 SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; Variable_name Value Created_tmp_disk_tables 2 -SET SESSION log_slow_filter=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; -SET SESSION log_slow_verbosity=default; DROP TABLE t1, t2, t3, t4; # # Bug#1592694 Query plan temp flag set is missed in diff --git a/mysql-test/r/percona_log_slow_query_plan_qc.result b/mysql-test/r/percona_log_slow_query_plan_qc.result index 42176e841c13..557268af4fa4 100644 --- a/mysql-test/r/percona_log_slow_query_plan_qc.result +++ b/mysql-test/r/percona_log_slow_query_plan_qc.result @@ -1,9 +1,9 @@ FLUSH STATUS; SET SESSION min_examined_row_limit=0; -DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUE(5); SET SESSION query_cache_type=1; +SET @saved_query_cache_size=@@GLOBAL.query_cache_size; SET GLOBAL query_cache_size=1355776; SET SESSION long_query_time=0; SET SESSION log_slow_verbosity='microtime,query_plan'; @@ -37,10 +37,5 @@ a SHOW STATUS LIKE 'Qcache_hits'; Variable_name Value Qcache_hits 1 -SET SESSION log_slow_filter=default; -SET SESSION long_query_time=default; -SET SESSION log_slow_verbosity=default; -SET SESSION query_cache_type=default; -SET GLOBAL query_cache_size=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL query_cache_size=@saved_query_cache_size; DROP TABLE t1; diff --git a/mysql-test/r/percona_log_slow_slave_statements-innodb.result b/mysql-test/r/percona_log_slow_slave_statements-innodb.result deleted file mode 100644 index 7081fc98201c..000000000000 --- a/mysql-test/r/percona_log_slow_slave_statements-innodb.result +++ /dev/null @@ -1,31 +0,0 @@ -include/master-slave.inc -Warnings: -Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. -Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. -[connection master] -SET SESSION min_examined_row_limit=0; -DROP TABLE IF EXISTS t; -CREATE TABLE t(id INT,data CHAR(30)) ENGINE=InnoDB; -INSERT INTO t VALUES -(1,"aaaaabbbbbcccccdddddeeeeefffff"), -(2,"aaaaabbbbbcccccdddddeeeeefffff"), -(3,"aaaaabbbbbcccccdddddeeeeefffff"), -(4,"aaaaabbbbbcccccdddddeeeeefffff"), -(5,"aaaaabbbbbcccccdddddeeeeefffff"); -INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; -INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; -SET GLOBAL long_query_time=0; -SET GLOBAL log_slow_slave_statements=TRUE; -SET GLOBAL log_slow_verbosity='innodb'; -include/restart_slave.inc -[log_start.inc] percona.slow_extended.log_slow_slave_statements-innodb -INSERT INTO t SELECT t.id,t.data from t; -[log_stop.inc] percona.slow_extended.log_slow_slave_statements-innodb -[log_grep.inc] file: percona.slow_extended.log_slow_slave_statements-innodb pattern: InnoDB_IO_r_ops -[log_grep.inc] lines: 1 -DROP TABLE t; -SET GLOBAL long_query_time=default; -SET GLOBAL log_slow_slave_statements=default; -SET GLOBAL log_slow_verbosity=default; -SET SESSION min_examined_row_limit=default; -include/rpl_end.inc diff --git a/mysql-test/r/percona_log_slow_slave_statements.result b/mysql-test/r/percona_log_slow_slave_statements.result index b7ab4b76790f..a1a554a93abf 100644 --- a/mysql-test/r/percona_log_slow_slave_statements.result +++ b/mysql-test/r/percona_log_slow_slave_statements.result @@ -3,10 +3,12 @@ Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] -DROP TABLE IF EXISTS t; CREATE TABLE t(id INT) ENGINE=InnoDB; +SET @saved_min_examined_row_limit=@@GLOBAL.min_examined_row_limit; SET GLOBAL min_examined_row_limit=0; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=0; +SET @saved_log_slow_slave_statements=@@GLOBAL.log_slow_slave_statements; SET GLOBAL log_slow_slave_statements=OFF; include/restart_slave.inc [log_start.inc] percona.slow_extended.log_slow_slave_statements @@ -27,7 +29,7 @@ INSERT INTO t VALUES (3); [log_grep.inc] file: percona.slow_extended.log_slow_slave_statements pattern: ^# User@Host: \[SQL_SLAVE\] @ \[\] [log_grep.inc] lines: 2 DROP TABLE t; -SET GLOBAL log_slow_slave_statements=default; -SET GLOBAL long_query_time=default; -SET GLOBAL min_examined_row_limit=default; +SET GLOBAL log_slow_slave_statements=@saved_log_slow_slave_statements; +SET GLOBAL long_query_time=@saved_long_query_time; +SET GLOBAL min_examined_row_limit=@saved_min_examined_row_limit; include/rpl_end.inc diff --git a/mysql-test/r/percona_log_slow_sp_statements.result b/mysql-test/r/percona_log_slow_sp_statements.result index 5a4a19716e5e..3df745a66d63 100644 --- a/mysql-test/r/percona_log_slow_sp_statements.result +++ b/mysql-test/r/percona_log_slow_sp_statements.result @@ -1,5 +1,3 @@ -DROP PROCEDURE IF EXISTS test_outer; -DROP PROCEDURE IF EXISTS test_inner; SET SESSION min_examined_row_limit=0; SET SESSION long_query_time=0; CREATE PROCEDURE test_inner() @@ -12,6 +10,7 @@ SELECT 1; CALL test_inner(); END^ PREPARE stmt FROM "CALL test_outer()"; +SET @saved_log_slow_sp_statements=@@GLOBAL.log_slow_sp_statements; SET GLOBAL log_slow_sp_statements=ON; [log_start.inc] percona.slow_extended.sp1 SELECT "log_always"; @@ -94,6 +93,4 @@ EXECUTE stmt; [log_grep.inc] lines: 0 DROP PROCEDURE test_outer; DROP PROCEDURE test_inner; -SET GLOBAL log_slow_sp_statements=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL log_slow_sp_statements=@saved_log_slow_sp_statements; diff --git a/mysql-test/r/percona_log_slow_verbosity.result b/mysql-test/r/percona_log_slow_verbosity.result index e7b332de3f67..d302a0c8a5c8 100644 --- a/mysql-test/r/percona_log_slow_verbosity.result +++ b/mysql-test/r/percona_log_slow_verbosity.result @@ -80,7 +80,7 @@ log_slow_verbosity='microtime,innodb,query_plan': [log_grep.inc] lines: 0 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# No InnoDB statistics available for this query$ [log_grep.inc] lines: 2 -SET log_slow_verbosity='microtime'; +SET SESSION log_slow_verbosity='microtime'; [log_start.inc] percona.slow_extended.log_slow_verbosity_2 INSERT INTO t1 VALUE(1); [log_stop.inc] percona.slow_extended.log_slow_verbosity_2 @@ -117,7 +117,7 @@ log_slow_verbosity='microtime': [log_grep.inc] lines: 0 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# No InnoDB statistics available for this query$ [log_grep.inc] lines: 0 -SET log_slow_verbosity='microtime,query_plan'; +SET SESSION log_slow_verbosity='microtime,query_plan'; [log_start.inc] percona.slow_extended.log_slow_verbosity_3 INSERT INTO t1 VALUE(2); [log_stop.inc] percona.slow_extended.log_slow_verbosity_3 @@ -154,7 +154,4 @@ log_slow_verbosity='query_plan': [log_grep.inc] lines: 0 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# No InnoDB statistics available for this query$ [log_grep.inc] lines: 0 -SET SESSION log_slow_verbosity=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; DROP TABLE t1; diff --git a/mysql-test/r/percona_long_query_time.result b/mysql-test/r/percona_long_query_time.result index ec68f2e62915..c319159ab3bb 100644 --- a/mysql-test/r/percona_long_query_time.result +++ b/mysql-test/r/percona_long_query_time.result @@ -1,5 +1,5 @@ SET SESSION min_examined_row_limit=0; -SET long_query_time=2; +SET SESSION long_query_time=2; [log_start.inc] percona.slow_extended.long_query_time SET SESSION query_exec_time=1.1; SELECT 1; @@ -27,9 +27,7 @@ SELECT 1; 1 1 SET SESSION query_exec_time=default; -SET long_query_time=2; +SET SESSION long_query_time=2; [log_stop.inc] percona.slow_extended.long_query_time -SET long_query_time=default; -SET SESSION min_examined_row_limit=default; [log_grep.inc] file: percona.slow_extended.long_query_time pattern: Query_time [log_grep.inc] lines: 3 diff --git a/mysql-test/r/percona_min_examined_row_limit.result b/mysql-test/r/percona_min_examined_row_limit.result index 46488bde7cd5..7a9815394a42 100644 --- a/mysql-test/r/percona_min_examined_row_limit.result +++ b/mysql-test/r/percona_min_examined_row_limit.result @@ -1,9 +1,11 @@ -drop table if exists t; create table t(id INT PRIMARY KEY); insert into t values(1); insert into t values(2); insert into t values(3); +SET @saved_min_examined_row_limit=@@GLOBAL.min_examined_row_limit; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=2; +SET @saved_slow_query_log_use_global_control=@@GLOBAL.slow_query_log_use_global_control; SET GLOBAL slow_query_log_use_global_control='long_query_time,min_examined_row_limit'; [log_start.inc] percona.slow_extended.min_examined_row_limit SET SESSION query_exec_time=2.1; @@ -27,9 +29,9 @@ SELECT 1; 1 SET SESSION query_exec_time=default; [log_stop.inc] percona.slow_extended.min_examined_row_limit -SET GLOBAL min_examined_row_limit=default; -SET GLOBAL slow_query_log_use_global_control=default; -SET GLOBAL long_query_time=default; +SET GLOBAL min_examined_row_limit=@saved_min_examined_row_limit; +SET GLOBAL slow_query_log_use_global_control=@saved_slow_query_log_use_global_control; +SET GLOBAL long_query_time=@saved_long_query_time; [log_grep.inc] file: percona.slow_extended.min_examined_row_limit pattern: Query_time [log_grep.inc] lines: 1 DROP TABLE t; diff --git a/mysql-test/r/percona_slow_extended_error_on_quit.result b/mysql-test/r/percona_slow_extended_error_on_quit.result index fe1a1f9144fc..deff1ce9ac21 100644 --- a/mysql-test/r/percona_slow_extended_error_on_quit.result +++ b/mysql-test/r/percona_slow_extended_error_on_quit.result @@ -1,6 +1,8 @@ -DROP TABLE IF EXISTS t; +SET @saved_log_slow_admin_statements=@@GLOBAL.log_slow_admin_statements; SET GLOBAL log_slow_admin_statements=ON; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=0; +SET @saved_min_examined_row_limit=@@GLOBAL.min_examined_row_limit; SET GLOBAL min_examined_row_limit=0; CREATE TABLE t(a INT) engine=InnoDB; [log_start.inc] percona.slow_extended.error_on_quit_1 @@ -22,6 +24,6 @@ a [log_grep.inc] file: percona.slow_extended.error_on_quit_3 pattern: Last_errno: 0\s expected_matches: 3 [log_grep.inc] found expected match count: 3 DROP TABLE t; -SET GLOBAL log_slow_admin_statements=default; -SET GLOBAL long_query_time=default; -SET GLOBAL min_examined_row_limit=default; +SET GLOBAL log_slow_admin_statements=@saved_log_slow_admin_statements; +SET GLOBAL long_query_time=@saved_long_query_time; +SET GLOBAL min_examined_row_limit=@saved_min_examined_row_limit; diff --git a/mysql-test/r/percona_slow_extended_log_error.result b/mysql-test/r/percona_slow_extended_log_error.result index f057d7682767..a101576ddb4b 100644 --- a/mysql-test/r/percona_slow_extended_log_error.result +++ b/mysql-test/r/percona_slow_extended_log_error.result @@ -1,6 +1,5 @@ -DROP TABLE IF EXISTS t1; SET SESSION min_examined_row_limit=0; -SET long_query_time=0; +SET SESSION long_query_time=0; [log_start.inc] percona.slow_extended.log_error_1 CREATE TABLE t1(a INT); [log_stop.inc] percona.slow_extended.log_error_1 @@ -13,5 +12,3 @@ ERROR 42S01: Table 't1' already exists [log_grep.inc] file: percona.slow_extended.log_error_2 pattern: ^.*Last_errno: 1050 .*$ [log_grep.inc] lines: 1 DROP TABLE t1; -SET long_query_time=default; -SET SESSION min_examined_row_limit=default; diff --git a/mysql-test/r/percona_slow_query_log_rate_limit_write.result b/mysql-test/r/percona_slow_query_log_rate_limit_write.result index 2b38d6f6685b..a13cb53f5927 100644 --- a/mysql-test/r/percona_slow_query_log_rate_limit_write.result +++ b/mysql-test/r/percona_slow_query_log_rate_limit_write.result @@ -33,7 +33,6 @@ this-should-not-be-logged [log_stop.inc] percona.slow_extended.percona_slow_query_log_rate_limit_write_2 [log_grep.inc] file: percona.slow_extended.percona_slow_query_log_rate_limit_write_2 pattern: ^# Log_slow_rate_type: [log_grep.inc] lines: 1 -SET GLOBAL long_query_time=0; SET GLOBAL debug=@old_debug; SET GLOBAL log_slow_rate_type=@old_log_slow_rate_type; SET GLOBAL log_slow_rate_limit=@old_log_slow_rate_limit; diff --git a/mysql-test/r/percona_slow_query_log_timestamp_always.result b/mysql-test/r/percona_slow_query_log_timestamp_always.result index 4687e55e1ed5..36f01f2add0d 100644 --- a/mysql-test/r/percona_slow_query_log_timestamp_always.result +++ b/mysql-test/r/percona_slow_query_log_timestamp_always.result @@ -1,5 +1,6 @@ SET SESSION min_examined_row_limit=0; SET SESSION long_query_time=0; +SET @saved_slow_query_log_timestamp_always=@@GLOBAL.slow_query_log_timestamp_always; SET GLOBAL slow_query_log_timestamp_always=TRUE; [log_start.inc] percona_slow_query_log_timestamp_always SELECT 1; @@ -11,6 +12,4 @@ SELECT 2; [log_stop.inc] percona_slow_query_log_timestamp_always [log_grep.inc] file: percona_slow_query_log_timestamp_always pattern: ^# Time: \d{6} (\d| )\d:\d\d:\d\d$ expected_matches: 3 [log_grep.inc] found expected match count: 3 -SET GLOBAL slow_query_log_timestamp_always=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL slow_query_log_timestamp_always=@saved_slow_query_log_timestamp_always; diff --git a/mysql-test/r/percona_slow_query_log_timestamp_precision.result b/mysql-test/r/percona_slow_query_log_timestamp_precision.result index e72144064db1..0f38c69ecbaa 100644 --- a/mysql-test/r/percona_slow_query_log_timestamp_precision.result +++ b/mysql-test/r/percona_slow_query_log_timestamp_precision.result @@ -1,7 +1,8 @@ SET @old_slow_query_log_timestamp_always=@@slow_query_log_timestamp_always; SET SESSION min_examined_row_limit=0; -SET long_query_time=0; +SET SESSION long_query_time=0; SET GLOBAL slow_query_log_timestamp_always=TRUE; +SET @old_slow_query_log_timestamp_precision=@@slow_query_log_timestamp_precision; SET GLOBAL slow_query_log_timestamp_precision='microsecond'; [log_start.inc] percona_slow_extended_1 SELECT 1; @@ -18,7 +19,5 @@ SELECT 1; [log_stop.inc] percona_slow_extended_2 [log_grep.inc] file: percona_slow_extended_2 pattern: ^# Time: \d{6} (\d| )\d:\d\d:\d\d$ [log_grep.inc] lines: 2 -SET long_query_time=default; -SET SESSION min_examined_row_limit=default; SET GLOBAL slow_query_log_timestamp_always=@old_slow_query_log_timestamp_always; -SET GLOBAL slow_query_log_timestamp_precision=default; +SET GLOBAL slow_query_log_timestamp_precision=@old_slow_query_log_timestamp_precision; diff --git a/mysql-test/r/percona_slow_query_log_use_global_control.result b/mysql-test/r/percona_slow_query_log_use_global_control.result index af67084a8dc6..bfb3f3a6c090 100644 --- a/mysql-test/r/percona_slow_query_log_use_global_control.result +++ b/mysql-test/r/percona_slow_query_log_use_global_control.result @@ -1,4 +1,7 @@ SET SESSION min_examined_row_limit=0; +SET @saved_log_slow_verbosity=@@GLOBAL.log_slow_verbosity; +SET @saved_slow_query_log_use_global_control=@@GLOBAL.slow_query_log_use_global_control; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=1; [log_start.inc] percona.slow_extended.slow_query_log_use_global_control SET SESSION query_exec_time=1.1; @@ -12,9 +15,8 @@ SELECT 1; 1 SET SESSION query_exec_time=default; [log_stop.inc] percona.slow_extended.slow_query_log_use_global_control -SET GLOBAL slow_query_log_use_global_control=''; -SET GLOBAL log_slow_verbosity=''; -SET GLOBAL long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL slow_query_log_use_global_control=@saved_slow_query_log_use_global_control; +SET GLOBAL log_slow_verbosity=@saved_log_slow_verbosity; +SET GLOBAL long_query_time=@saved_long_query_time; [log_grep.inc] file: percona.slow_extended.slow_query_log_use_global_control pattern: No InnoDB statistics available for this query [log_grep.inc] lines: 1 diff --git a/mysql-test/suite/innodb/t/percona_log_slow_innodb.test b/mysql-test/suite/innodb/t/percona_log_slow_innodb.test index 37695851aa90..15f4a7d04998 100644 --- a/mysql-test/suite/innodb/t/percona_log_slow_innodb.test +++ b/mysql-test/suite/innodb/t/percona_log_slow_innodb.test @@ -13,6 +13,8 @@ INSERT INTO t2 VALUE(1); --source include/count_sessions.inc +--source include/log_prepare.inc + SET SESSION long_query_time=0; SET SESSION log_slow_verbosity='microtime,innodb'; diff --git a/mysql-test/suite/innodb/t/percona_log_slow_innodb_debug.test b/mysql-test/suite/innodb/t/percona_log_slow_innodb_debug.test index 782a1248c5ff..a294281d5374 100644 --- a/mysql-test/suite/innodb/t/percona_log_slow_innodb_debug.test +++ b/mysql-test/suite/innodb/t/percona_log_slow_innodb_debug.test @@ -4,6 +4,8 @@ --source include/have_innodb.inc --source include/have_debug_sync.inc +--source include/log_prepare.inc + --source include/count_sessions.inc SET @saved_innodb_thread_sleep_delay = @@GLOBAL.innodb_thread_sleep_delay; diff --git a/mysql-test/suite/rpl/t/percona_log_slow_slave_statements_innodb.test b/mysql-test/suite/rpl/t/percona_log_slow_slave_statements_innodb.test index 02eda921d198..973dd956d428 100644 --- a/mysql-test/suite/rpl/t/percona_log_slow_slave_statements_innodb.test +++ b/mysql-test/suite/rpl/t/percona_log_slow_slave_statements_innodb.test @@ -14,6 +14,8 @@ INSERT INTO t SELECT t2.id,t2.data from t as t1, t as t2; --sync_slave_with_master +--source include/log_prepare.inc + SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=0; SET @saved_log_slow_slave_statements=@@GLOBAL.log_slow_slave_statements; @@ -44,6 +46,6 @@ SET GLOBAL long_query_time=@saved_long_query_time; SET GLOBAL log_slow_slave_statements=@saved_log_slow_slave_statements; SET GLOBAL log_slow_verbosity=@saved_log_slow_verbosity; ---source include/rpl_end.inc - --source include/log_cleanup.inc + +--source include/rpl_end.inc diff --git a/mysql-test/t/percona_bug1016991-master.opt b/mysql-test/t/percona_bug1016991-master.opt deleted file mode 100644 index 60dd192a29f7..000000000000 --- a/mysql-test/t/percona_bug1016991-master.opt +++ /dev/null @@ -1 +0,0 @@ ---slow_query_log_use_global_control=all diff --git a/mysql-test/t/percona_bug1016991.test b/mysql-test/t/percona_bug1016991.test index 1caa51dd33fc..4dcc2a714967 100644 --- a/mysql-test/t/percona_bug1016991.test +++ b/mysql-test/t/percona_bug1016991.test @@ -1,7 +1,11 @@ # # bug 1016991 - long_query_time not respected when slow_query_log_use_global_control = all # +--source include/log_prepare.inc +SET @saved_long_query_time= @@long_query_time; +SET @saved_slow_query_log_use_global_control=@@GLOBAL.slow_query_log_use_global_control; +SET GLOBAL slow_query_log_use_global_control=ALL; SET @saved_slow_query_log_timestamp_always= @@slow_query_log_timestamp_always; SET GLOBAL slow_query_log_timestamp_always= TRUE; @@ -20,6 +24,7 @@ SELECT 1; --let grep_pattern= ^# Time: \d{6} (\d| )\d:\d\d:\d\d\$ --source include/log_grep.inc -SET GLOBAL long_query_time=default; +SET GLOBAL long_query_time= @saved_long_query_time; SET GLOBAL slow_query_log_timestamp_always= @saved_slow_query_log_timestamp_always; +SET GLOBAL slow_query_log_use_global_control=@saved_slow_query_log_use_global_control; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_bug643149.test b/mysql-test/t/percona_bug643149.test index 192c16f8cc0e..376f488a7fc1 100644 --- a/mysql-test/t/percona_bug643149.test +++ b/mysql-test/t/percona_bug643149.test @@ -1,5 +1,7 @@ --source include/have_profiling.inc +--source include/log_prepare.inc + SET LOCAL log_slow_verbosity='profiling'; SET LOCAL long_query_time=0; diff --git a/mysql-test/t/percona_log_slow_admin_statements.test b/mysql-test/t/percona_log_slow_admin_statements.test index 0075ff2e7579..ed01b90f3e04 100644 --- a/mysql-test/t/percona_log_slow_admin_statements.test +++ b/mysql-test/t/percona_log_slow_admin_statements.test @@ -1,10 +1,7 @@ # # Test log_slow_slave_admin_statements # - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings +--source include/log_prepare.inc CREATE TABLE t1 (a INT); @@ -14,6 +11,7 @@ SET SESSION long_query_time=0; # # Test enabled admin statement slow-logging # +SET @saved_log_slow_admin_statements=@@GLOBAL.log_slow_admin_statements; SET GLOBAL log_slow_admin_statements=ON; --let log_file=percona_log_slow_admin_stmt_1 --source include/log_start.inc @@ -35,9 +33,7 @@ ALTER TABLE t1 DROP INDEX a; --let log_expected_matches= 0 --source include/log_grep.inc -SET GLOBAL log_slow_admin_statements=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL log_slow_admin_statements=@saved_log_slow_admin_statements; DROP TABLE t1; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_log_slow_admin_statements_sp.test b/mysql-test/t/percona_log_slow_admin_statements_sp.test index ca6bdcdbae0c..d43df0c2217d 100644 --- a/mysql-test/t/percona_log_slow_admin_statements_sp.test +++ b/mysql-test/t/percona_log_slow_admin_statements_sp.test @@ -2,6 +2,8 @@ # Test log_slow_slave_admin_statements in stored procedures # +--source include/log_prepare.inc + CREATE TABLE t1 (a INT); SET @old_log_slow_admin_statements=@@global.log_slow_admin_statements; diff --git a/mysql-test/t/percona_log_slow_query_plan.test b/mysql-test/t/percona_log_slow_query_plan.test index f208e9e025b9..22bd091221da 100644 --- a/mysql-test/t/percona_log_slow_query_plan.test +++ b/mysql-test/t/percona_log_slow_query_plan.test @@ -3,6 +3,8 @@ # --source include/have_innodb.inc +--source include/log_prepare.inc + FLUSH STATUS; CREATE TABLE t1( @@ -320,12 +322,6 @@ SELECT COUNT(*) FROM t1, t4 WHERE t1.a = t4.a GROUP BY t4.b; SHOW SESSION STATUS LIKE 'Created_tmp_tables'; SHOW SESSION STATUS LIKE 'Created_tmp_disk_tables'; -SET SESSION log_slow_filter=default; - -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; -SET SESSION log_slow_verbosity=default; - DROP TABLE t1, t2, t3, t4; --echo # diff --git a/mysql-test/t/percona_log_slow_query_plan_qc.test b/mysql-test/t/percona_log_slow_query_plan_qc.test index d7350391e858..7a811ae52368 100644 --- a/mysql-test/t/percona_log_slow_query_plan_qc.test +++ b/mysql-test/t/percona_log_slow_query_plan_qc.test @@ -4,18 +4,17 @@ --source include/have_innodb.inc --source include/have_query_cache.inc +--source include/log_prepare.inc + FLUSH STATUS; SET SESSION min_examined_row_limit=0; ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - CREATE TABLE t1 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUE(5); SET SESSION query_cache_type=1; +SET @saved_query_cache_size=@@GLOBAL.query_cache_size; SET GLOBAL query_cache_size=1355776; SET SESSION long_query_time=0; @@ -59,13 +58,7 @@ SELECT * FROM t1 WHERE a > 5; SHOW STATUS LIKE 'Qcache_hits'; -SET SESSION log_slow_filter=default; - -SET SESSION long_query_time=default; -SET SESSION log_slow_verbosity=default; -SET SESSION query_cache_type=default; -SET GLOBAL query_cache_size=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL query_cache_size=@saved_query_cache_size; DROP TABLE t1; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_log_slow_slave_statements.test b/mysql-test/t/percona_log_slow_slave_statements.test index 0fa1d081a949..c26cab424eee 100644 --- a/mysql-test/t/percona_log_slow_slave_statements.test +++ b/mysql-test/t/percona_log_slow_slave_statements.test @@ -5,15 +5,16 @@ --source include/have_binlog_format_statement.inc --source include/master-slave.inc ---disable_warnings -DROP TABLE IF EXISTS t; ---enable_warnings - CREATE TABLE t(id INT) ENGINE=InnoDB; sync_slave_with_master; +--source include/log_prepare.inc + +SET @saved_min_examined_row_limit=@@GLOBAL.min_examined_row_limit; SET GLOBAL min_examined_row_limit=0; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=0; +SET @saved_log_slow_slave_statements=@@GLOBAL.log_slow_slave_statements; SET GLOBAL log_slow_slave_statements=OFF; --source include/restart_slave_sql.inc @@ -61,8 +62,10 @@ connection master; DROP TABLE t; sync_slave_with_master; -SET GLOBAL log_slow_slave_statements=default; -SET GLOBAL long_query_time=default; -SET GLOBAL min_examined_row_limit=default; ---source include/rpl_end.inc +SET GLOBAL log_slow_slave_statements=@saved_log_slow_slave_statements; +SET GLOBAL long_query_time=@saved_long_query_time; +SET GLOBAL min_examined_row_limit=@saved_min_examined_row_limit; + --source include/log_cleanup.inc + +--source include/rpl_end.inc diff --git a/mysql-test/t/percona_log_slow_sp_statements.test b/mysql-test/t/percona_log_slow_sp_statements.test index 0ce473815988..95f20d9cfcd9 100644 --- a/mysql-test/t/percona_log_slow_sp_statements.test +++ b/mysql-test/t/percona_log_slow_sp_statements.test @@ -1,10 +1,7 @@ # # Test slow-logging of statements in stored procedures # ---disable_warnings -DROP PROCEDURE IF EXISTS test_outer; -DROP PROCEDURE IF EXISTS test_inner; ---enable_warnings +--source include/log_prepare.inc SET SESSION min_examined_row_limit=0; SET SESSION long_query_time=0; @@ -26,6 +23,7 @@ delimiter ;^ PREPARE stmt FROM "CALL test_outer()"; +SET @saved_log_slow_sp_statements=@@GLOBAL.log_slow_sp_statements; SET GLOBAL log_slow_sp_statements=ON; --let log_file=percona.slow_extended.sp1 --source include/log_start.inc @@ -85,7 +83,5 @@ EXECUTE stmt; DROP PROCEDURE test_outer; DROP PROCEDURE test_inner; -SET GLOBAL log_slow_sp_statements=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL log_slow_sp_statements=@saved_log_slow_sp_statements; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_log_slow_verbosity.test b/mysql-test/t/percona_log_slow_verbosity.test index ad27f47a86b1..7b2590142704 100644 --- a/mysql-test/t/percona_log_slow_verbosity.test +++ b/mysql-test/t/percona_log_slow_verbosity.test @@ -3,6 +3,8 @@ # --source include/have_innodb.inc +--source include/log_prepare.inc + CREATE TABLE t1(a INT) ENGINE=InnoDB; INSERT INTO t1 VALUE(0); @@ -43,7 +45,7 @@ SELECT 1; # Test only 'microtime' in the output (bug 730173: InnoDB and query plan information # are logged when not enabled) # -SET log_slow_verbosity='microtime'; +SET SESSION log_slow_verbosity='microtime'; --let log_file=percona.slow_extended.log_slow_verbosity_2 --source include/log_start.inc @@ -56,7 +58,7 @@ INSERT INTO t1 VALUE(1); # # Test 'query_plan' # -SET log_slow_verbosity='microtime,query_plan'; +SET SESSION log_slow_verbosity='microtime,query_plan'; --let log_file=percona.slow_extended.log_slow_verbosity_3 --source include/log_start.inc @@ -66,9 +68,5 @@ INSERT INTO t1 VALUE(2); --echo log_slow_verbosity='query_plan': --source include/percona_slow_log_verbosity_grep.inc -SET SESSION log_slow_verbosity=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; - DROP TABLE t1; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_long_query_time.test b/mysql-test/t/percona_long_query_time.test index dac5ec0fb044..8b69ec5bc7b3 100644 --- a/mysql-test/t/percona_long_query_time.test +++ b/mysql-test/t/percona_long_query_time.test @@ -1,7 +1,9 @@ --source include/have_debug.inc +--source include/log_prepare.inc + SET SESSION min_examined_row_limit=0; -SET long_query_time=2; +SET SESSION long_query_time=2; --let log_file=percona.slow_extended.long_query_time --source include/log_start.inc @@ -17,11 +19,9 @@ SET SESSION query_exec_time=5.1; SELECT 1; SET SESSION query_exec_time=default; -SET long_query_time=2; +SET SESSION long_query_time=2; --source include/log_stop.inc -SET long_query_time=default; -SET SESSION min_examined_row_limit=default; --let grep_pattern = Query_time --source include/log_grep.inc diff --git a/mysql-test/t/percona_min_examined_row_limit.test b/mysql-test/t/percona_min_examined_row_limit.test index 32475a18a10d..17ecfaffe4d6 100644 --- a/mysql-test/t/percona_min_examined_row_limit.test +++ b/mysql-test/t/percona_min_examined_row_limit.test @@ -1,15 +1,16 @@ --source include/have_debug.inc ---disable_warnings -drop table if exists t; ---enable_warnings +--source include/log_prepare.inc create table t(id INT PRIMARY KEY); insert into t values(1); insert into t values(2); insert into t values(3); +SET @saved_min_examined_row_limit=@@GLOBAL.min_examined_row_limit; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=2; +SET @saved_slow_query_log_use_global_control=@@GLOBAL.slow_query_log_use_global_control; SET GLOBAL slow_query_log_use_global_control='long_query_time,min_examined_row_limit'; --let log_file=percona.slow_extended.min_examined_row_limit --source include/log_start.inc @@ -25,9 +26,9 @@ SELECT 1; SET SESSION query_exec_time=default; --source include/log_stop.inc -SET GLOBAL min_examined_row_limit=default; -SET GLOBAL slow_query_log_use_global_control=default; -SET GLOBAL long_query_time=default; +SET GLOBAL min_examined_row_limit=@saved_min_examined_row_limit; +SET GLOBAL slow_query_log_use_global_control=@saved_slow_query_log_use_global_control; +SET GLOBAL long_query_time=@saved_long_query_time; --let grep_pattern = Query_time --source include/log_grep.inc diff --git a/mysql-test/t/percona_slow_extended_error_on_quit.test b/mysql-test/t/percona_slow_extended_error_on_quit.test index 1d02b0cf051d..baf6736d218f 100644 --- a/mysql-test/t/percona_slow_extended_error_on_quit.test +++ b/mysql-test/t/percona_slow_extended_error_on_quit.test @@ -2,14 +2,16 @@ # See Launchpad Bug #716210 --source include/have_innodb.inc ---source include/count_sessions.inc ---disable_warnings -DROP TABLE IF EXISTS t; ---enable_warnings +--source include/log_prepare.inc + +--source include/count_sessions.inc +SET @saved_log_slow_admin_statements=@@GLOBAL.log_slow_admin_statements; SET GLOBAL log_slow_admin_statements=ON; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=0; +SET @saved_min_examined_row_limit=@@GLOBAL.min_examined_row_limit; SET GLOBAL min_examined_row_limit=0; CREATE TABLE t(a INT) engine=InnoDB; @@ -67,7 +69,7 @@ SELECT * FROM t; --source include/log_grep.inc DROP TABLE t; -SET GLOBAL log_slow_admin_statements=default; -SET GLOBAL long_query_time=default; -SET GLOBAL min_examined_row_limit=default; +SET GLOBAL log_slow_admin_statements=@saved_log_slow_admin_statements; +SET GLOBAL long_query_time=@saved_long_query_time; +SET GLOBAL min_examined_row_limit=@saved_min_examined_row_limit; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_slow_extended_log_error.test b/mysql-test/t/percona_slow_extended_log_error.test index 020487e15eb4..1b7a0a68000c 100644 --- a/mysql-test/t/percona_slow_extended_log_error.test +++ b/mysql-test/t/percona_slow_extended_log_error.test @@ -1,13 +1,11 @@ # # Test last_errno in extended slow query log -# +# ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings +--source include/log_prepare.inc SET SESSION min_examined_row_limit=0; -SET long_query_time=0; +SET SESSION long_query_time=0; --let log_file=percona.slow_extended.log_error_1 --source include/log_start.inc @@ -26,6 +24,4 @@ CREATE TABLE t1(a INT); DROP TABLE t1; -SET long_query_time=default; -SET SESSION min_examined_row_limit=default; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_slow_query_log_always_write.test b/mysql-test/t/percona_slow_query_log_always_write.test index b3812703c60c..41326e484698 100644 --- a/mysql-test/t/percona_slow_query_log_always_write.test +++ b/mysql-test/t/percona_slow_query_log_always_write.test @@ -7,6 +7,8 @@ # Force deterministic session and query ids --source include/restart_mysqld.inc +--source include/log_prepare.inc + SET @old_long_query_time=@@global.long_query_time; SET @old_log_slow_rate_type=@@global.log_slow_rate_type; SET @old_log_slow_rate_limit=@@global.log_slow_rate_limit; diff --git a/mysql-test/t/percona_slow_query_log_rate.test b/mysql-test/t/percona_slow_query_log_rate.test index f30bbcc22a12..866b51e38815 100644 --- a/mysql-test/t/percona_slow_query_log_rate.test +++ b/mysql-test/t/percona_slow_query_log_rate.test @@ -3,6 +3,8 @@ # Force deterministic session and query ids --source include/restart_mysqld.inc +--source include/log_prepare.inc + let $old_long_query_time=`SELECT @@global.long_query_time`; let $old_log_slow_rate_type=`SELECT @@global.log_slow_rate_type`; let $old_log_slow_rate_limit=`SELECT @@global.log_slow_rate_limit`; diff --git a/mysql-test/t/percona_slow_query_log_rate_limit_write.test b/mysql-test/t/percona_slow_query_log_rate_limit_write.test index 4c4f41cf625d..b3c66e64cfdf 100644 --- a/mysql-test/t/percona_slow_query_log_rate_limit_write.test +++ b/mysql-test/t/percona_slow_query_log_rate_limit_write.test @@ -6,6 +6,8 @@ --source include/restart_mysqld.inc +--source include/log_prepare.inc + SET @old_log_slow_rate_type=@@global.log_slow_rate_type; SET @old_long_query_time=@@global.long_query_time; SET @old_log_slow_rate_limit=@@global.log_slow_rate_limit; @@ -64,9 +66,6 @@ SELECT 'this-should-not-be-logged'; --let grep_pattern= ^# Log_slow_rate_type: --source include/log_grep.inc -# off the rate limit -SET GLOBAL long_query_time=0; - SET GLOBAL debug=@old_debug; SET GLOBAL log_slow_rate_type=@old_log_slow_rate_type; SET GLOBAL log_slow_rate_limit=@old_log_slow_rate_limit; diff --git a/mysql-test/t/percona_slow_query_log_timestamp_always.test b/mysql-test/t/percona_slow_query_log_timestamp_always.test index 9cbb802de104..7c1ef7654caf 100644 --- a/mysql-test/t/percona_slow_query_log_timestamp_always.test +++ b/mysql-test/t/percona_slow_query_log_timestamp_always.test @@ -3,8 +3,12 @@ # the log entries with the same timestamp are indeed not timestamped, but this is # impossible to test in MTR without debug injections. # + +--source include/log_prepare.inc + SET SESSION min_examined_row_limit=0; SET SESSION long_query_time=0; +SET @saved_slow_query_log_timestamp_always=@@GLOBAL.slow_query_log_timestamp_always; SET GLOBAL slow_query_log_timestamp_always=TRUE; --let log_expected_matches=3 @@ -16,7 +20,5 @@ SELECT 2; --let grep_pattern= ^# Time: \d{6} (\d| )\d:\d\d:\d\d\$ --source include/log_grep.inc -SET GLOBAL slow_query_log_timestamp_always=default; -SET SESSION long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL slow_query_log_timestamp_always=@saved_slow_query_log_timestamp_always; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_slow_query_log_timestamp_precision.test b/mysql-test/t/percona_slow_query_log_timestamp_precision.test index 0f4c00dc583f..9ae5e732e728 100644 --- a/mysql-test/t/percona_slow_query_log_timestamp_precision.test +++ b/mysql-test/t/percona_slow_query_log_timestamp_precision.test @@ -1,14 +1,18 @@ # # Test slow_query_log_timestamp_precision variable. # + +--source include/log_prepare.inc + SET @old_slow_query_log_timestamp_always=@@slow_query_log_timestamp_always; SET SESSION min_examined_row_limit=0; -SET long_query_time=0; +SET SESSION long_query_time=0; SET GLOBAL slow_query_log_timestamp_always=TRUE; # # microsecond # +SET @old_slow_query_log_timestamp_precision=@@slow_query_log_timestamp_precision; SET GLOBAL slow_query_log_timestamp_precision='microsecond'; --let log_file=percona_slow_extended_1 @@ -30,8 +34,6 @@ SELECT 1; --let grep_pattern= ^# Time: \d{6} (\d| )\d:\d\d:\d\d\$ --source include/log_grep.inc -SET long_query_time=default; -SET SESSION min_examined_row_limit=default; SET GLOBAL slow_query_log_timestamp_always=@old_slow_query_log_timestamp_always; -SET GLOBAL slow_query_log_timestamp_precision=default; +SET GLOBAL slow_query_log_timestamp_precision=@old_slow_query_log_timestamp_precision; --source include/log_cleanup.inc diff --git a/mysql-test/t/percona_slow_query_log_use_global_control.test b/mysql-test/t/percona_slow_query_log_use_global_control.test index 8f14badba44d..5293f12cdb5d 100644 --- a/mysql-test/t/percona_slow_query_log_use_global_control.test +++ b/mysql-test/t/percona_slow_query_log_use_global_control.test @@ -1,7 +1,12 @@ --source include/have_debug.inc --source include/have_innodb.inc +--source include/log_prepare.inc + SET SESSION min_examined_row_limit=0; +SET @saved_log_slow_verbosity=@@GLOBAL.log_slow_verbosity; +SET @saved_slow_query_log_use_global_control=@@GLOBAL.slow_query_log_use_global_control; +SET @saved_long_query_time=@@GLOBAL.long_query_time; SET GLOBAL long_query_time=1; --let log_file=percona.slow_extended.slow_query_log_use_global_control @@ -20,10 +25,9 @@ SET SESSION query_exec_time=default; --source include/log_stop.inc -SET GLOBAL slow_query_log_use_global_control=''; -SET GLOBAL log_slow_verbosity=''; -SET GLOBAL long_query_time=default; -SET SESSION min_examined_row_limit=default; +SET GLOBAL slow_query_log_use_global_control=@saved_slow_query_log_use_global_control; +SET GLOBAL log_slow_verbosity=@saved_log_slow_verbosity; +SET GLOBAL long_query_time=@saved_long_query_time; --let grep_pattern = No InnoDB statistics available for this query --source include/log_grep.inc From 1d32a39853c73b2ca9c97dbf4226820e91afcded Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Tue, 18 Dec 2018 14:43:53 +0200 Subject: [PATCH 138/214] PS-4855 (Replace http with https in http://bugs.percona.com in server crash messages) Fixed trivially --- sql/signal_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 87f3bd46d3c4..92db93ba3fe5 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -99,7 +99,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) "diagnose the problem, but since we have already crashed, \n" "something is definitely wrong and this may fail.\n" "Please help us make Percona Server better by reporting any\n" - "bugs at http://bugs.percona.com/\n\n"); + "bugs at https://bugs.percona.com/\n\n"); my_safe_printf_stderr("key_buffer_size=%lu\n", (ulong) dflt_key_cache->key_cache_mem_size); From bd42700eb73ea337be545953b607db1b0392cdb2 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Tue, 18 Dec 2018 17:24:44 +0200 Subject: [PATCH 139/214] Update version --- VERSION | 2 +- storage/innobase/include/univ.i | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 41dc80043516..a48cda9b860f 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=7 MYSQL_VERSION_PATCH=24 -MYSQL_VERSION_EXTRA=-26 +MYSQL_VERSION_EXTRA=-27 diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 8210693c1103..a82bf07f84e6 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 26 +#define PERCONA_INNODB_VERSION 27 #endif /* The following is the InnoDB version as shown in From 44037847b077cccfc6f6b3d02d31aaa79ecab228 Mon Sep 17 00:00:00 2001 From: hrvojem Date: Tue, 18 Dec 2018 16:34:26 +0100 Subject: [PATCH 140/214] Percona Server 5.7.24-27 release notes (5.7) --- doc/source/conf.py | 2 +- .../Percona-Server-5.7.24-27.rst | 35 +++++++++++++++++++ .../release-notes/release-notes_index.rst | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 doc/source/release-notes/Percona-Server-5.7.24-27.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index 0f22c95e15dc..23df6def2591 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -54,7 +54,7 @@ # The short X.Y version. version = '5.7' # The full version, including alpha/beta/rc tags. -release = '5.7.23-23' +release = '5.7.24-27' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/release-notes/Percona-Server-5.7.24-27.rst b/doc/source/release-notes/Percona-Server-5.7.24-27.rst new file mode 100644 index 000000000000..b66ec873503f --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.7.24-27.rst @@ -0,0 +1,35 @@ +.. rn:: 5.7.24-27 + +========================== +|Percona Server| |release| +========================== + +Percona is glad to announce the release of |Percona Server| |release| on +December 18, 2018. Downloads are available `here +`_ +and from the :doc:`Percona Software Repositories `. + +This release is based on `MySQL 5.7.24 +`_ +and includes all the bug fixes in it. |Percona Server| |release| is +now the current GA (Generally Available) release in the 5.7 series. + +All software developed by Percona is open-source and free. + +.. note:: + + If you're currently using |Percona Server| 5.7, Percona recommends + upgrading to this version of 5.7 prior to upgrading to |Percona Server| + 8.0. + +Bugs Fixed +========== + +* When uninstalling |Percona Server| packages on *CentOS 7* default + configuration file :file:`my.cnf` would get removed as well. This fix + makes the backup of the configuration file instead of removing it. + Bug fixed :psbug:`5092`. + + +.. |release| replace:: 5.7.24-27 + diff --git a/doc/source/release-notes/release-notes_index.rst b/doc/source/release-notes/release-notes_index.rst index ee59e46ef6b5..a169e9673f6c 100644 --- a/doc/source/release-notes/release-notes_index.rst +++ b/doc/source/release-notes/release-notes_index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 :glob: + Percona-Server-5.7.24-27 Percona-Server-5.7.23-23 Percona-Server-5.7.22-22 Percona-Server-5.7.21-21 From 43337b5f80c6ec086d4308d17c6bc917e2f23dc6 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Wed, 19 Dec 2018 09:38:39 +0200 Subject: [PATCH 141/214] Add a testcase for PS-5180 ([PS8QA] handle_fatal_signal (sig=11) in my_strnncollsp_simple | ctype-simple.cc:190) The actual regression is in 8.0, but the testcase works on 5.7 too. --- mysql-test/r/percona_encrypt_tmp_files.result | 29 +++++++++++++++++ mysql-test/t/percona_encrypt_tmp_files.test | 31 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/mysql-test/r/percona_encrypt_tmp_files.result b/mysql-test/r/percona_encrypt_tmp_files.result index bb23b961e976..2d3a4092e4eb 100644 --- a/mysql-test/r/percona_encrypt_tmp_files.result +++ b/mysql-test/r/percona_encrypt_tmp_files.result @@ -129,4 +129,33 @@ DROP TABLE seq_1_to_15; DROP TABLE seq_0_to_9; DROP TABLE seq_0_to_26; DROP TABLE universal_seq; +# +# [PS8QA] handle_fatal_signal (sig=11) in my_strnncollsp_simple | ctype-simple.cc:190 +# +SET SESSION tmp_table_size=1024; +CREATE TABLE t1(a TEXT,b TEXT); +INSERT INTO t1 VALUES(7553,'7553'); +INSERT INTO t1 VALUES(662,'aaaaaaaaaaaaaaaaaaaa'); +INSERT INTO t1 VALUES(1,10),(2,20); +REPLACE INTO t1 VALUES(@id,"REPLACE,deleting the duplicate"); +INSERT INTO t1 VALUES(2,"ccccc"); +INSERT INTO t1 VALUES(1,1),(2,2),(3,3),(4,4); +INSERT INTO t1 VALUES("abcd", -3); +INSERT INTO t1 SET b=REPEAT('a',600); +INSERT INTO t1 VALUES(1,"aaa"),(2,"bbb"),(3,"ccc"); +INSERT INTO t1 values("john","doe"),("John","Doe"); +INSERT INTO t1 VALUES(1,0),(1,1); +INSERT INTO t1 VALUES(4811,'4811'); +INSERT INTO t1 VALUES(3,'2001-01-01 10:11:02'); +INSERT INTO t1 VALUES('a','a'),('b','b'),('c','c'),('aa','aa'),('bb','bb'),('cc','cc'); +INSERT INTO t1 VALUES(8799,'8799'); +INSERT INTO t1 VALUES(7436,'7436'); +SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; +GROUP_CONCAT(DISTINCT UCASE(b)) +-3,0,1,10,2,20,2001-01-01 10:11:02,3,4,4811,7436,7553,8799,A,AA,AAA,AAAAAAAAAAAAAAAAAAAA,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,B,BB,BBB,C,CC,CCC,CCCCC,DOE,REPLACE,DELETING THE DUPLICATE +SET SESSION tmp_table_size = default; +DROP TABLE t1; +# +# End of 5.7 testcases +# SET GLOBAL binlog_format = @binlog_format_saved; diff --git a/mysql-test/t/percona_encrypt_tmp_files.test b/mysql-test/t/percona_encrypt_tmp_files.test index 97cab0225e61..7f63f94470ee 100644 --- a/mysql-test/t/percona_encrypt_tmp_files.test +++ b/mysql-test/t/percona_encrypt_tmp_files.test @@ -121,6 +121,37 @@ DROP TABLE seq_0_to_9; DROP TABLE seq_0_to_26; DROP TABLE universal_seq; +--echo # +--echo # [PS8QA] handle_fatal_signal (sig=11) in my_strnncollsp_simple | ctype-simple.cc:190 +--echo # + +SET SESSION tmp_table_size=1024; +CREATE TABLE t1(a TEXT,b TEXT); +INSERT INTO t1 VALUES(7553,'7553'); +INSERT INTO t1 VALUES(662,'aaaaaaaaaaaaaaaaaaaa'); +INSERT INTO t1 VALUES(1,10),(2,20); +REPLACE INTO t1 VALUES(@id,"REPLACE,deleting the duplicate"); +INSERT INTO t1 VALUES(2,"ccccc"); +INSERT INTO t1 VALUES(1,1),(2,2),(3,3),(4,4); +INSERT INTO t1 VALUES("abcd", -3); +INSERT INTO t1 SET b=REPEAT('a',600); +INSERT INTO t1 VALUES(1,"aaa"),(2,"bbb"),(3,"ccc"); +INSERT INTO t1 values("john","doe"),("John","Doe"); +INSERT INTO t1 VALUES(1,0),(1,1); +INSERT INTO t1 VALUES(4811,'4811'); +INSERT INTO t1 VALUES(3,'2001-01-01 10:11:02'); +INSERT INTO t1 VALUES('a','a'),('b','b'),('c','c'),('aa','aa'),('bb','bb'),('cc','cc'); +INSERT INTO t1 VALUES(8799,'8799'); +INSERT INTO t1 VALUES(7436,'7436'); +SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; + +SET SESSION tmp_table_size = default; +DROP TABLE t1; + +--echo # +--echo # End of 5.7 testcases +--echo # + --source include/wait_until_count_sessions.inc SET GLOBAL binlog_format = @binlog_format_saved; From 2e67e86b087212fdd827cb3bcd09f871d4ffba02 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Wed, 19 Dec 2018 14:17:28 +0100 Subject: [PATCH 142/214] PS-5189: Fixing a possible crash during redo log encryption init --- mysql-test/include/log_encrypt_1.inc | 6 ++- mysql-test/include/log_encrypt_3.inc | 6 +++ .../suite/innodb/r/log_encrypt_1_mk.result | 1 - .../suite/innodb/r/log_encrypt_1_rk.result | 1 - .../suite/innodb/r/log_encrypt_kill.result | 2 +- .../suite/innodb/r/percona_bug_ps5189.result | 3 ++ .../innodb/t/percona_bug_ps5189-master.opt | 5 +++ .../suite/innodb/t/percona_bug_ps5189.test | 2 + storage/innobase/handler/ha_innodb.cc | 42 ++++++++++++++++++- storage/innobase/log/log0log.cc | 6 ++- 10 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/innodb/r/percona_bug_ps5189.result create mode 100644 mysql-test/suite/innodb/t/percona_bug_ps5189-master.opt create mode 100644 mysql-test/suite/innodb/t/percona_bug_ps5189.test diff --git a/mysql-test/include/log_encrypt_1.inc b/mysql-test/include/log_encrypt_1.inc index 8d954508a312..045dbdeae55a 100644 --- a/mysql-test/include/log_encrypt_1.inc +++ b/mysql-test/include/log_encrypt_1.inc @@ -6,7 +6,11 @@ --source include/not_embedded.inc --source include/have_innodb_max_16k.inc -call mtr.add_suppression("\\[Error\\] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded."); +--disable_query_log +call mtr.add_suppression("Encryption can't find master key, please check the keyring plugin is loaded."); +call mtr.add_suppression("Can't set redo log tablespace to be encrypted."); +call mtr.add_suppression("Redo log key generation failed."); +--enable_query_log # eNable redo log encryption, should report error in server log, since keyring is not loaded. eval SET GLOBAL innodb_redo_log_encrypt = $redo_log_mode; diff --git a/mysql-test/include/log_encrypt_3.inc b/mysql-test/include/log_encrypt_3.inc index 7051323e8a18..cbb1b2be1aeb 100644 --- a/mysql-test/include/log_encrypt_3.inc +++ b/mysql-test/include/log_encrypt_3.inc @@ -5,6 +5,12 @@ --source include/not_embedded.inc --source include/have_innodb_max_16k.inc +--disable_query_log +call mtr.add_suppression("Encryption can't find master key, please check the keyring plugin is loaded."); +call mtr.add_suppression("Can't set redo log tablespace to be encrypted."); +call mtr.add_suppression("Redo log key generation failed."); +--enable_query_log + let $old_innodb_file_per_table = `SELECT @@innodb_file_per_table`; let $old_innodb_redo_log_encrypt = `SELECT @@innodb_redo_log_encrypt`; CREATE DATABASE tde_db; diff --git a/mysql-test/suite/innodb/r/log_encrypt_1_mk.result b/mysql-test/suite/innodb/r/log_encrypt_1_mk.result index f76b0376be04..9fd83f86861a 100644 --- a/mysql-test/suite/innodb/r/log_encrypt_1_mk.result +++ b/mysql-test/suite/innodb/r/log_encrypt_1_mk.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("\\[Error\\] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded."); SET GLOBAL innodb_redo_log_encrypt = MASTER_KEY; CREATE TABLE t1(c1 INT, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB; ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully. diff --git a/mysql-test/suite/innodb/r/log_encrypt_1_rk.result b/mysql-test/suite/innodb/r/log_encrypt_1_rk.result index 8df6f7349e13..faf3dcd78192 100644 --- a/mysql-test/suite/innodb/r/log_encrypt_1_rk.result +++ b/mysql-test/suite/innodb/r/log_encrypt_1_rk.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("\\[Error\\] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded."); SET GLOBAL innodb_redo_log_encrypt = KEYRING_KEY; CREATE TABLE t1(c1 INT, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB; ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully. diff --git a/mysql-test/suite/innodb/r/log_encrypt_kill.result b/mysql-test/suite/innodb/r/log_encrypt_kill.result index 8aab98a18d45..be6917127f0a 100644 --- a/mysql-test/suite/innodb/r/log_encrypt_kill.result +++ b/mysql-test/suite/innodb/r/log_encrypt_kill.result @@ -14,7 +14,7 @@ c1 LEFT(c2,10) 100 cccccccccc DROP TABLE tne_1; # Stop the MTR default DB server -Pattern "Can\'t set redo log tablespace to be encrypted" not found +Pattern "Can\'t set redo log tablespace to be encrypted" found # create bootstrap file # Prepare new datadir # Run the bootstrap command with keyring diff --git a/mysql-test/suite/innodb/r/percona_bug_ps5189.result b/mysql-test/suite/innodb/r/percona_bug_ps5189.result new file mode 100644 index 000000000000..990e0a29506e --- /dev/null +++ b/mysql-test/suite/innodb/r/percona_bug_ps5189.result @@ -0,0 +1,3 @@ +SELECT 1; +1 +1 diff --git a/mysql-test/suite/innodb/t/percona_bug_ps5189-master.opt b/mysql-test/suite/innodb/t/percona_bug_ps5189-master.opt new file mode 100644 index 000000000000..7df2ee671e12 --- /dev/null +++ b/mysql-test/suite/innodb/t/percona_bug_ps5189-master.opt @@ -0,0 +1,5 @@ +$KEYRING_PLUGIN_OPT +$KEYRING_PLUGIN_EARLY_LOAD +--loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring2 +--innodb_temp_tablespace_encrypt=ON +--innodb_redo_log_encrypt=MASTER_KEY diff --git a/mysql-test/suite/innodb/t/percona_bug_ps5189.test b/mysql-test/suite/innodb/t/percona_bug_ps5189.test new file mode 100644 index 000000000000..e87c2bb72447 --- /dev/null +++ b/mysql-test/suite/innodb/t/percona_bug_ps5189.test @@ -0,0 +1,2 @@ +# PS-5189: startup crash when both temporary table encryption and log encryption enabled +SELECT 1; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 5559c9473e9c..117b9e8df59f 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3915,7 +3915,15 @@ innobase_fix_tablespaces_empty_uuid() return(false); } - log_enable_encryption_if_set(); + if (Encryption::master_key_id == 0 && srv_redo_log_encrypt == REDO_LOG_ENCRYPT_RK) { + /* redo log can be encrypted with keyring_key, which has to be + initialized even when nothing's encrypted with master_key - in + which case, master_key_id == 0, so this condition succeeds. + We call this function here, because otherwise, if the redo log + is encrypted with master_key, log encryption has to be initialized + after Encryption::create_master_key. */ + log_enable_encryption_if_set(); + } /* We only need to handle the case when an encrypted tablespace is created at startup. If it is 0, there is no encrypted tablespace, @@ -3947,6 +3955,8 @@ innobase_fix_tablespaces_empty_uuid() return(true); } + log_enable_encryption_if_set(); + /** Check if sys, temp need rotation to fix the empty uuid */ /* Also, in future, it is possible to fix empty uuid for redo & undo here. Just add the space_id into vector */ @@ -21411,6 +21421,34 @@ innodb_temp_tablespace_encryption_update( } } +/** Enable or disable encryption of redo logs +@param[in] thd thread handle +@param[in] var system variable +@param[out] var_ptr current value +@param[in] save immediate result from check function */ +static +void +innodb_redo_encryption_update( + THD* thd, + struct st_mysql_sys_var* var, + void* var_ptr, + const void* save) +{ + if (srv_read_only_mode) { + push_warning_printf( + thd, Sql_condition::SL_WARNING, + ER_WRONG_ARGUMENTS, + " Redo log cannot be" + " encrypted in innodb_read_only mode"); + return; + } + + *static_cast(var_ptr) = + *static_cast(save); + + log_enable_encryption_if_set(); +} + static SHOW_VAR innodb_status_variables_export[]= { {"Innodb", (char*) &show_innodb_vars, SHOW_FUNC, SHOW_SCOPE_GLOBAL}, {NullS, NullS, SHOW_LONG, SHOW_SCOPE_GLOBAL} @@ -22474,7 +22512,7 @@ static MYSQL_SYSVAR_ENUM(default_row_format, innodb_default_row_format, static MYSQL_SYSVAR_ENUM(redo_log_encrypt, srv_redo_log_encrypt, PLUGIN_VAR_OPCMDARG, "Enable or disable Encryption of REDO tablespace. Possible values: OFF, MASTER_KEY, KEYRING_KEY.", - NULL, NULL, REDO_LOG_ENCRYPT_OFF, &redo_log_encrypt_typelib); + NULL, innodb_redo_encryption_update, REDO_LOG_ENCRYPT_OFF, &redo_log_encrypt_typelib); #ifdef UNIV_DEBUG static MYSQL_SYSVAR_UINT(trx_rseg_n_slots_debug, trx_rseg_n_slots_debug, diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 368ad0f00394..03ab21b77152 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1435,8 +1435,10 @@ log_enable_encryption_if_set() } } - ut_ad(redo_key_type && strcmp(redo_key_type, "AES") == 0); - my_free(redo_key_type); + if (encryption_enabled) { + ut_ad(redo_key_type && strcmp(redo_key_type, "AES") == 0); + my_free(redo_key_type); + } #ifdef UNIV_ENCRYPT_DEBUG fprintf(stderr, "Fetched redo key: %s.\n", key); From 3701bd36bec259fe494c75c9b30c57b01e598297 Mon Sep 17 00:00:00 2001 From: Daniel Blanchard Date: Thu, 20 Dec 2018 15:07:12 +0000 Subject: [PATCH 143/214] Bug #29121165 MYSQL SERVER FAILS TO START ON NON-ENGLISH WINDOWS WITH NAMED PIPES ENABLED (cherry picked from commit ac20471ab13b361c9702661c1b674d12e62ba900) --- mysql-test/r/mysqld--help-win.result | 2 +- .../named_pipe_full_access_group_basic.result | 10 ++-- sql/named_pipe.cc | 58 ++++++++++++++----- sql/named_pipe.h | 2 +- 4 files changed, 49 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 034abbb04f17..bb6c1d88949a 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -1449,7 +1449,7 @@ myisam-stats-method nulls_unequal myisam-use-mmap FALSE mysql-native-password-proxy-users FALSE named-pipe FALSE -named-pipe-full-access-group everyone +named-pipe-full-access-group *everyone* net-buffer-length 16384 net-read-timeout 30 net-retry-count 10 diff --git a/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result index 23a30a61aa28..72989183fe35 100644 --- a/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result +++ b/mysql-test/suite/sys_vars/r/named_pipe_full_access_group_basic.result @@ -1,17 +1,17 @@ select @@global.named_pipe_full_access_group; @@global.named_pipe_full_access_group -everyone +*everyone* select @@session.named_pipe_full_access_group; ERROR HY000: Variable 'named_pipe_full_access_group' is a GLOBAL variable show global variables like 'named_pipe_full_access_group'; Variable_name Value -named_pipe_full_access_group everyone +named_pipe_full_access_group *everyone* show session variables like 'named_pipe_full_access_group'; Variable_name Value -named_pipe_full_access_group everyone +named_pipe_full_access_group *everyone* select * from performance_schema.global_variables where variable_name='named_pipe_full_access_group'; VARIABLE_NAME VARIABLE_VALUE -named_pipe_full_access_group everyone +named_pipe_full_access_group *everyone* select * from performance_schema.session_variables where variable_name='named_pipe_full_access_group'; VARIABLE_NAME VARIABLE_VALUE -named_pipe_full_access_group everyone +named_pipe_full_access_group *everyone* diff --git a/sql/named_pipe.cc b/sql/named_pipe.cc index c0528cf88d18..f49679e768f3 100644 --- a/sql/named_pipe.cc +++ b/sql/named_pipe.cc @@ -50,6 +50,13 @@ bool is_existing_windows_group_name(const char *group_name) bool is_valid_named_pipe_full_access_group(const char *group_name) { + // Treat the DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP value + // as a special case: we (later) convert it to the "world" SID + if (strcmp(group_name, DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP) == 0) + { + return true; + } + if (!group_name || group_name[0] == '\0' || is_existing_windows_group_name(group_name)) { @@ -74,25 +81,44 @@ bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, DWORD size_referencedDomainName= MAX_PATH; SID_NAME_USE sid_name_use; - if (!LookupAccountName(nullptr, group_name, soughtSID, &size_sid, - referencedDomainName, &size_referencedDomainName, - &sid_name_use)) + // Treat the DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP value + // as a special case: we convert it to the "world" SID + if (strcmp(group_name, DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP) == 0) { - DWORD last_error_num= GetLastError(); - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, last_error_num, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, - sizeof(last_error_msg) / sizeof(TCHAR), NULL); - sql_print_error("my_security_attr_add_rights_to_group, LookupAccountName failed: %s", - last_error_msg); - return true; + if (!CreateWellKnownSid(WinWorldSid, NULL, soughtSID, &size_sid)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("my_security_attr_add_rights_to_group, CreateWellKnownSid failed: %s", + last_error_msg); + return true; + } } - - // sid_name_use is SidTypeAlias when group_name is a local group - if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + else { - sql_print_error("LookupAccountName failed: unexpected sid_name_use"); - return true; + if (!LookupAccountName(NULL, group_name, soughtSID, &size_sid, + referencedDomainName, &size_referencedDomainName, + &sid_name_use)) + { + DWORD last_error_num= GetLastError(); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, last_error_num, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), last_error_msg, + sizeof(last_error_msg) / sizeof(TCHAR), NULL); + sql_print_error("my_security_attr_add_rights_to_group, LookupAccountName failed: %s", + last_error_msg); + return true; + } + + // sid_name_use is SidTypeAlias when group_name is a local group + if (sid_name_use != SidTypeAlias && sid_name_use != SidTypeWellKnownGroup) + { + sql_print_error("LookupAccountName failed: unexpected sid_name_use"); + return true; + } } PACL pNewDACL= nullptr; diff --git a/sql/named_pipe.h b/sql/named_pipe.h index eeb9d36712bb..651068fa3eba 100644 --- a/sql/named_pipe.h +++ b/sql/named_pipe.h @@ -35,5 +35,5 @@ bool is_valid_named_pipe_full_access_group(const char *group_name); bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa, const char *group_name, DWORD group_rights); -#define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP "everyone" +#define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP "*everyone*" #endif /* NAMED_PIPE_INCLUDED */ From 85c5572a78c751a84546e9cdeaab5cc54b582216 Mon Sep 17 00:00:00 2001 From: Robert Golebiowski Date: Sun, 23 Dec 2018 12:56:06 +0100 Subject: [PATCH 144/214] PS-4797: rpl.rpl_master_errors failing, likely due to binlog encryption peek_event_header calls my_b_read. my_b_read will return error on failure, but also on reading outside the file. We are using peek_event_header to check if next event is START_ENCRYPTION_EVENT. The fix is to seek back to position before peek_event_header was called, also in case when peek_event_header returns error. --- sql/rpl_binlog_sender.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/rpl_binlog_sender.cc b/sql/rpl_binlog_sender.cc index be6f74b9c32d..bb3eeab2e7ac 100644 --- a/sql/rpl_binlog_sender.cc +++ b/sql/rpl_binlog_sender.cc @@ -1056,13 +1056,19 @@ int Binlog_sender::send_format_description_event(IO_CACHE *log_cache, if (send_packet()) DBUG_RETURN(1); + my_off_t binlog_pos_after_fdle= my_b_tell(log_cache); + char header_buffer[LOG_EVENT_MINIMAL_HEADER_LEN]; // Let's check if next event is Start encryption event + // If we go outside the file peek_event_header will also return an error if (Log_event::peek_event_header(header_buffer, log_cache)) - DBUG_RETURN(1); + { + my_b_seek(log_cache, binlog_pos_after_fdle); + DBUG_RETURN(0); + } // peek_event_header actually moves the log_cache->read_pos, thus we need to rewind - log_cache->read_pos-= LOG_EVENT_MINIMAL_HEADER_LEN; + my_b_seek(log_cache, binlog_pos_after_fdle); if (static_cast(header_buffer[EVENT_TYPE_OFFSET]) == binary_log::START_ENCRYPTION_EVENT) { From ac038cc5ed04675c90f3921bcd4c72e89979cbd2 Mon Sep 17 00:00:00 2001 From: Przemek Skibinski Date: Mon, 24 Dec 2018 13:11:53 +0100 Subject: [PATCH 145/214] PS-5126: SHOW BINLOG EVENTS FROM is not diagnosed inside Format_description_log_events Backport improved rpl.bug75480 test from 8.0 --- mysql-test/suite/rpl/r/bug75480.result | 7 ++- mysql-test/suite/rpl/t/bug75480.test | 68 ++++++++++++++++++++++++-- 2 files changed, 68 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/rpl/r/bug75480.result b/mysql-test/suite/rpl/r/bug75480.result index 663ab28b881a..96d1ccb35024 100644 --- a/mysql-test/suite/rpl/r/bug75480.result +++ b/mysql-test/suite/rpl/r/bug75480.result @@ -3,6 +3,10 @@ Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] +# +# Bug 75480: Selecting wrong pos with SHOW BINLOG EVENTS causes +# a potentially misleading message in the server error log +# CREATE TABLE t (a INT, b INT); INSERT INTO t (a, b) VALUES (1, 1); INSERT INTO t (a, b) VALUES (2, 2); @@ -11,7 +15,6 @@ INSERT INTO t (a, b) VALUES (4, 4); INSERT INTO t (a, b) VALUES (5, 5); INSERT INTO t (a, b) VALUES (6, 6); INSERT INTO t (a, b) VALUES (7, 7); -SHOW BINLOG EVENTS FROM 5; -ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error +include/sync_slave_sql_with_master.inc DROP TABLE t; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/bug75480.test b/mysql-test/suite/rpl/t/bug75480.test index 5172372cd4eb..eec2f847a921 100644 --- a/mysql-test/suite/rpl/t/bug75480.test +++ b/mysql-test/suite/rpl/t/bug75480.test @@ -1,8 +1,13 @@ +--source include/master-slave.inc + +--echo # +--echo # Bug 75480: Selecting wrong pos with SHOW BINLOG EVENTS causes +--echo # a potentially misleading message in the server error log +--echo # + # without fix this test will fail with # 'Found warnings/errors in server log file!' error -source include/master-slave.inc; - connection master; CREATE TABLE t (a INT, b INT); @@ -15,10 +20,63 @@ INSERT INTO t (a, b) VALUES (5, 5); INSERT INTO t (a, b) VALUES (6, 6); INSERT INTO t (a, b) VALUES (7, 7); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc + +# 'mix', 'row', and 'stmt' generate different outputs +--disable_query_log +--disable_result_log + +--let $binlog_end_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +--let $end_pos= 0 +--let $row_number= 2 + +# no error for binlog position 0 +SHOW BINLOG EVENTS FROM 0 LIMIT 1; + +# no error for binlog position 1 (Incorrect and should be fixed by PS-5237) +SHOW BINLOG EVENTS FROM 1 LIMIT 1; + +# no error for binlog position 3 (Incorrect and should be fixed by PS-5237) +SHOW BINLOG EVENTS FROM 3 LIMIT 1; + +# no error for binlog position 4 +SHOW BINLOG EVENTS FROM 4 LIMIT 1; + +# expect error for binlog position 5 +--error ER_ERROR_WHEN_EXECUTING_COMMAND +SHOW BINLOG EVENTS FROM 5 LIMIT 1; + +while ($end_pos < $binlog_end_pos) +{ + --let $start_pos= query_get_value(SHOW BINLOG EVENTS, Pos, $row_number) + --let $end_pos= query_get_value(SHOW BINLOG EVENTS, End_log_pos, $row_number) + --inc $row_number + --let $start_pos_prev= $start_pos + --dec $start_pos_prev + --let $start_pos_next= $start_pos + --inc $start_pos_next + + # expect error for $start_pos - 1 + --error ER_ERROR_WHEN_EXECUTING_COMMAND + --eval SHOW BINLOG EVENTS FROM $start_pos_prev LIMIT 1 + + # no error for $start_pos + --eval SHOW BINLOG EVENTS FROM $start_pos LIMIT 1 + + # expect error for $start_pos + 1 + --error ER_ERROR_WHEN_EXECUTING_COMMAND + --eval SHOW BINLOG EVENTS FROM $start_pos_next LIMIT 1 +} + +# no error for $binlog_end_pos +--eval SHOW BINLOG EVENTS FROM $binlog_end_pos LIMIT 1 + +# no error for $binlog_end_pos + 1 (Incorrect and should be fixed by PS-5213) +--inc $binlog_end_pos +--eval SHOW BINLOG EVENTS FROM $binlog_end_pos LIMIT 1 ---error 1220 -SHOW BINLOG EVENTS FROM 5; +--enable_query_log +--enable_result_log connection master; From bae64d743ef7d0e739621d8d8febc82facec15c1 Mon Sep 17 00:00:00 2001 From: Przemek Skibinski Date: Mon, 24 Dec 2018 14:39:11 +0100 Subject: [PATCH 146/214] PS-5165: Use Xenial instead of Trusty in Travis-CI 1. Use Xenial image and modify addresses of repos to Xenial 2. Force to check a commit if `last_commit.txt` is not found for the trunk (solves issues when `Auto cancel branch builds` is turned on for Travis CI) 3. Remove less frequently updated `ppa:jonathonf/gcc` --- .travis.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f64c86b782a..17ee7f3a455c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -# Ubuntu 14.04 -dist: trusty +# Ubuntu 16.04 +dist: xenial sudo: required language: cpp @@ -26,7 +26,7 @@ matrix: - env: COMMAND=clang-test script: - curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -; - - echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" | sudo tee -a /etc/apt/sources.list > /dev/null; + - echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" | sudo tee -a /etc/apt/sources.list > /dev/null; - sudo -E apt-get -yq update >> ~/apt-get-update.log 2>&1; - sudo -E apt-get -yq --no-install-suggests --no-install-recommends install clang-format-5.0 || travis_terminate 1 - wget https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py || travis_terminate 1 @@ -187,15 +187,19 @@ script: PARENT_COMMIT=$(git rev-list --first-parent --topo-order $TRAVIS_COMMIT ^master_repo_$PARENT_BRANCH | tail -1); TRAVIS_COMMIT_RANGE=$PARENT_COMMIT^..$TRAVIS_COMMIT; else - if [ -s "$CCACHE_DIR/last_commit.txt" ]; then TRAVIS_COMMIT_RANGE=$(cat $CCACHE_DIR/last_commit.txt)..$TRAVIS_COMMIT; fi; + if [ -s "$CCACHE_DIR/last_commit.txt" ]; then + TRAVIS_COMMIT_RANGE=$(cat $CCACHE_DIR/last_commit.txt)..$TRAVIS_COMMIT; + else + TRAVIS_COMMIT_RANGE="Force testing of this commit"; + fi; fi; if MODIFIED_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE 2>/dev/null); then echo -e "--- Modified files in $TRAVIS_COMMIT_RANGE:\n$MODIFIED_FILES"; - if ! echo "$MODIFIED_FILES" | grep -qvE '^(doc|build-ps|mysql-test|packaging|policy|scripts|support-files)/'; then + if echo "$MODIFIED_FILES" | grep -qvE '^(doc|build-ps|mysql-test|packaging|policy|scripts|support-files)/'; then + echo "--- Code changes were found"; + else echo "--- There are no code changes, stopping build process."; travis_terminate 0; - else - echo "--- Code changes were found"; fi; else echo "--- Can't prepare MODIFIED_FILES for $TRAVIS_COMMIT_RANGE"; @@ -205,11 +209,10 @@ script: if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "clang" ]]; then PACKAGES="llvm-$VERSION-dev $PACKAGES"; curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -; - echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-$VERSION main" | sudo tee -a /etc/apt/sources.list > /dev/null; - sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"; + echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$VERSION main" | sudo tee -a /etc/apt/sources.list > /dev/null; fi; - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "gcc" ]]; then - sudo -E apt-add-repository -y "ppa:jonathonf/gcc"; + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"; fi; if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo -E apt-add-repository -y "ppa:jonathonf/mysql"; From 7735dcc60757bbf0fc4c2fd56e49c55157a71a9e Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Wed, 2 Jan 2019 10:15:34 -0700 Subject: [PATCH 147/214] PS-5217 : Merge fb-prod201803 - Update rocksdb submodule commit pointer to match production tag fb-prod201803 - Re-recorded tests where rocksdb default for max_manifest_file_size has changed - Re-recorded compression tests where default COMPRESSION_OPTS changed when not explicitly specified. --- .../r/rocksdb_max_manifest_file_size_basic.result | 2 +- mysql-test/suite/rocksdb/r/compression_lz4.result | 2 +- mysql-test/suite/rocksdb/r/compression_lz4hc.result | 2 +- mysql-test/suite/rocksdb/r/compression_zlib.result | 2 +- mysql-test/suite/rocksdb/r/rocksdb.result | 2 +- storage/rocksdb/rocksdb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manifest_file_size_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manifest_file_size_basic.result index 27cddc9f60a3..45330b827028 100644 --- a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manifest_file_size_basic.result +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manifest_file_size_basic.result @@ -1,7 +1,7 @@ SET @start_global_value = @@global.ROCKSDB_MAX_MANIFEST_FILE_SIZE; SELECT @start_global_value; @start_global_value -18446744073709551615 +1073741824 "Trying to set variable @@global.ROCKSDB_MAX_MANIFEST_FILE_SIZE to 444. It should fail because it is readonly." SET @@global.ROCKSDB_MAX_MANIFEST_FILE_SIZE = 444; ERROR HY000: Variable 'rocksdb_max_manifest_file_size' is a read only variable diff --git a/mysql-test/suite/rocksdb/r/compression_lz4.result b/mysql-test/suite/rocksdb/r/compression_lz4.result index 45d9bc6d6492..3bb3a948fbd8 100644 --- a/mysql-test/suite/rocksdb/r/compression_lz4.result +++ b/mysql-test/suite/rocksdb/r/compression_lz4.result @@ -9,7 +9,7 @@ SUM(id) SUM(data) 50005000 50005000 select cf_name, option_type, value from information_schema.rocksdb_cf_options where cf_name='default' and option_type like 'COMPRESSION%' order by option_type; cf_name option_type value -default COMPRESSION_OPTS -14:-1:0 +default COMPRESSION_OPTS -14:32767:0 default COMPRESSION_PER_LEVEL NUL default COMPRESSION_TYPE kLZ4Compression select table_name, index_name, cf from information_schema.rocksdb_ddl where table_name='t1' order by table_name, index_name; diff --git a/mysql-test/suite/rocksdb/r/compression_lz4hc.result b/mysql-test/suite/rocksdb/r/compression_lz4hc.result index ae85857cdc98..15ca1684b558 100644 --- a/mysql-test/suite/rocksdb/r/compression_lz4hc.result +++ b/mysql-test/suite/rocksdb/r/compression_lz4hc.result @@ -9,7 +9,7 @@ SUM(id) SUM(data) 50005000 50005000 select cf_name, option_type, value from information_schema.rocksdb_cf_options where cf_name='default' and option_type like 'COMPRESSION%' order by option_type; cf_name option_type value -default COMPRESSION_OPTS -14:-1:0 +default COMPRESSION_OPTS -14:32767:0 default COMPRESSION_PER_LEVEL NUL default COMPRESSION_TYPE kLZ4HCCompression select table_name, index_name, cf from information_schema.rocksdb_ddl where table_name='t1' order by table_name, index_name; diff --git a/mysql-test/suite/rocksdb/r/compression_zlib.result b/mysql-test/suite/rocksdb/r/compression_zlib.result index 99912759e3b6..71ed4a96b497 100644 --- a/mysql-test/suite/rocksdb/r/compression_zlib.result +++ b/mysql-test/suite/rocksdb/r/compression_zlib.result @@ -9,7 +9,7 @@ SUM(id) SUM(data) 50005000 50005000 select cf_name, option_type, value from information_schema.rocksdb_cf_options where cf_name='default' and option_type like 'COMPRESSION%' order by option_type; cf_name option_type value -default COMPRESSION_OPTS -14:-1:0 +default COMPRESSION_OPTS -14:32767:0 default COMPRESSION_PER_LEVEL NUL default COMPRESSION_TYPE kZlibCompression select table_name, index_name, cf from information_schema.rocksdb_ddl where table_name='t1' order by table_name, index_name; diff --git a/mysql-test/suite/rocksdb/r/rocksdb.result b/mysql-test/suite/rocksdb/r/rocksdb.result index afb1aab66cad..fddc959ca4fc 100644 --- a/mysql-test/suite/rocksdb/r/rocksdb.result +++ b/mysql-test/suite/rocksdb/r/rocksdb.result @@ -959,7 +959,7 @@ rocksdb_manual_wal_flush ON rocksdb_max_background_jobs 2 rocksdb_max_latest_deadlocks 5 rocksdb_max_log_file_size 0 -rocksdb_max_manifest_file_size 18446744073709551615 +rocksdb_max_manifest_file_size 1073741824 rocksdb_max_row_locks 1048576 rocksdb_max_subcompactions 1 rocksdb_max_total_wal_size 0 diff --git a/storage/rocksdb/rocksdb b/storage/rocksdb/rocksdb index dc4ac5ffa670..516c7df05dd2 160000 --- a/storage/rocksdb/rocksdb +++ b/storage/rocksdb/rocksdb @@ -1 +1 @@ -Subproject commit dc4ac5ffa6708dae4ab70d6fe24b946cca0d20a5 +Subproject commit 516c7df05dd267e4725e7dd061a6767de7aaac0d From 94fa6f7474e46678853c9b23fab97f7573aaced3 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Thu, 3 Jan 2019 11:31:36 +0200 Subject: [PATCH 148/214] Fix PS-5268 (main.mysqldump is failing because of dropped event) Bump one of the event scheduled dates from 2018-12-31 (which is now in the past) to 2036-12-31. Do not bother with a proper fix, i.e. NOW() + 1 year, as upstream is likely to fix it too. --- mysql-test/r/mysqldump.result | 6 +++--- mysql-test/t/mysqldump.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 5965116c83ec..e24ed830e876 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4210,12 +4210,12 @@ second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL E show create event ee1; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci -create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5; +create event ee2 on schedule at '2036-12-31 21:01:23' do set @a=5; create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5; show events; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci -second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +second ee2 root@localhost UTC ONE TIME 2036-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci drop database second; create database third; @@ -4223,7 +4223,7 @@ use third; show events; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci -third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +third ee2 root@localhost UTC ONE TIME 2036-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci drop database third; set time_zone = 'SYSTEM'; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index c317fdd5ff90..65fe8f206340 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1771,7 +1771,7 @@ show create event ee1; ## prove three works (with spaces and tabs on the end) # start with one from the previous restore -create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5; +create event ee2 on schedule at '2036-12-31 21:01:23' do set @a=5; create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5; show events; --exec $MYSQL_DUMP --events second > $MYSQLTEST_VARDIR/tmp/bug16853-2.sql From 53351fdeaef49fd1149274d8ada1deb5906dddcb Mon Sep 17 00:00:00 2001 From: mayank prasad Date: Fri, 2 Aug 2013 10:57:07 +0530 Subject: [PATCH 149/214] Fix PS-5269 (5.6 ASan: intermittent thread stack overrun on two MTR testcases) Cherry-pick the commit below: fixing Windows specific thread stack overrun issue seen on trunk-stage (cherry picked from commit 83a9e3621595cb52e48ccb6b4a710e11e83af7d5) --- .../suite/sys_vars/t/max_sp_recursion_depth_func-master.opt | 2 +- mysql-test/t/signal_demo3-master.opt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func-master.opt b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func-master.opt index d03d176150db..95eb3b1912fe 100644 --- a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func-master.opt +++ b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func-master.opt @@ -1 +1 @@ -${?PB_HOST_SPECIFIC_MYSQLD_ARGS} +${?PB_HOST_SPECIFIC_MYSQLD_ARGS} --thread_stack=655360 diff --git a/mysql-test/t/signal_demo3-master.opt b/mysql-test/t/signal_demo3-master.opt index d03d176150db..95eb3b1912fe 100644 --- a/mysql-test/t/signal_demo3-master.opt +++ b/mysql-test/t/signal_demo3-master.opt @@ -1 +1 @@ -${?PB_HOST_SPECIFIC_MYSQLD_ARGS} +${?PB_HOST_SPECIFIC_MYSQLD_ARGS} --thread_stack=655360 From 84e1945b0d73e497abd2c8ee1fd4f648cf30d14a Mon Sep 17 00:00:00 2001 From: parveez Date: Wed, 16 Sep 2015 14:58:00 +0200 Subject: [PATCH 150/214] Fix PS-5271 (5.6 ASan: intermittent thread stack overrun on rpl.rpl_row_sp011) by cherry-picking the commit below: Bug #21161874 -TEST:RPL.RPL_ROW_SP011 FAILS WITH THREAD STACK OVERRRUN. rpl_row_sp011 test was failing due to thread stack overrun problem.Fix: increased the thread stack size for the test in the opt file. (cherry picked from commit 71d72830c2c6b487058eab9b2823d6313a133745) --- mysql-test/suite/rpl/t/rpl_row_sp011-master.opt | 1 + mysql-test/suite/rpl/t/rpl_row_sp011.test | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/rpl_row_sp011-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp011-master.opt index d03d176150db..2a213c3b06f1 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp011-master.opt +++ b/mysql-test/suite/rpl/t/rpl_row_sp011-master.opt @@ -1 +1,2 @@ ${?PB_HOST_SPECIFIC_MYSQLD_ARGS} +--thread_stack=409600 diff --git a/mysql-test/suite/rpl/t/rpl_row_sp011.test b/mysql-test/suite/rpl/t/rpl_row_sp011.test index c5027c79f7b2..a7a5209efbff 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp011.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp011.test @@ -2,8 +2,11 @@ # Original Author: JBM # # Original Date: Aug/18/2005 # # Updated: 08/29/2005 turned on diff and commented out debug SQL statements# +# Updated: sep/16/2015 # +# This testcase requires minimum stack size of 300KB to run on WIN.# +# Modified *-master.opt file to increase the thread_stack to 400KB.# ############################################################################# -#TEST: SP to test alter table and nested SP calls # +# TEST: SP to test alter table and nested SP calls # ############################################################################# # Includes From b250cfeccb67e0c381101f47fea316fc823ff139 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Thu, 3 Jan 2019 16:41:44 +0200 Subject: [PATCH 151/214] Add testcase for upstream bug 88797 --- mysql-test/r/bug88797.result | 13 +++++++++++++ mysql-test/t/bug88797.test | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 mysql-test/r/bug88797.result create mode 100644 mysql-test/t/bug88797.test diff --git a/mysql-test/r/bug88797.result b/mysql-test/r/bug88797.result new file mode 100644 index 000000000000..b337689e12ee --- /dev/null +++ b/mysql-test/r/bug88797.result @@ -0,0 +1,13 @@ +# +# Bug 88797: handle_fatal_signal (sig=11) in is_null_in_record +# +SELECT @default_temp_storage_engine; +@default_temp_storage_engine +NULL +SET default_storage_engine=ARCHIVE; +CREATE TABLE t1 (a text not null); +INSERT INTO t1 VALUES (854); +CREATE TABLE t (a CHAR(80)); +CREATE TEMPORARY TABLE tmp ENGINE=ARCHIVE AS SELECT VALUES(a) FROM t1; +INSERT INTO t SELECT * FROM tmp; +DROP TABLE t, t1; diff --git a/mysql-test/t/bug88797.test b/mysql-test/t/bug88797.test new file mode 100644 index 000000000000..2572247e670a --- /dev/null +++ b/mysql-test/t/bug88797.test @@ -0,0 +1,13 @@ +--echo # +--echo # Bug 88797: handle_fatal_signal (sig=11) in is_null_in_record +--echo # +SELECT @default_temp_storage_engine; +SET default_storage_engine=ARCHIVE; +CREATE TABLE t1 (a text not null); +INSERT INTO t1 VALUES (854); + +CREATE TABLE t (a CHAR(80)); +CREATE TEMPORARY TABLE tmp ENGINE=ARCHIVE AS SELECT VALUES(a) FROM t1; +INSERT INTO t SELECT * FROM tmp; + +DROP TABLE t, t1; From 5684aa42371c5574d8d866cf771fa93b2990e919 Mon Sep 17 00:00:00 2001 From: chouxi Date: Thu, 12 Jul 2018 10:16:07 -0700 Subject: [PATCH 152/214] Integrate deadlock timestamp to MySQL (#855) Upstream commit ID : fb-mysql-5.6.35/a47797f16671a44a92632935fc93e302e0c969ff PS-5217 : Merge fb-prod201803 Summary: Integrate deadlock timestamp info to MySQL based on RocksDB changes. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/855 Differential Revision: D8795674 Pulled By: chouxi fbshipit-source-id: fd4dd75 --- .../suite/rocksdb/r/i_s_deadlock.result | 58 +++++++++---------- mysql-test/suite/rocksdb/t/i_s_deadlock.test | 14 ++--- storage/rocksdb/ha_rocksdb.cc | 2 + storage/rocksdb/ha_rocksdb.h | 1 + storage/rocksdb/rdb_i_s.cc | 7 ++- 5 files changed, 45 insertions(+), 37 deletions(-) diff --git a/mysql-test/suite/rocksdb/r/i_s_deadlock.result b/mysql-test/suite/rocksdb/r/i_s_deadlock.result index ab4231d6a60d..5193c4081085 100644 --- a/mysql-test/suite/rocksdb/r/i_s_deadlock.result +++ b/mysql-test/suite/rocksdb/r/i_s_deadlock.result @@ -20,7 +20,7 @@ set global rocksdb_max_latest_deadlocks = @prior_max_latest_deadlocks; create table t (i int primary key) engine=rocksdb; insert into t values (1), (2), (3); select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK Deadlock #1 begin; select * from t where i=1 for update; @@ -38,9 +38,9 @@ i 2 rollback; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 Deadlock #2 begin; select * from t where i=1 for update; @@ -58,11 +58,11 @@ i 2 rollback; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 set global rocksdb_max_latest_deadlocks = 10; Deadlock #3 begin; @@ -81,18 +81,18 @@ i 2 rollback; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 set global rocksdb_max_latest_deadlocks = 1; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 1 set rocksdb_deadlock_detect_depth = 2; Deadlock #4 begin; @@ -124,7 +124,7 @@ i rollback; set global rocksdb_max_latest_deadlocks = 5; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK Deadlock #5 begin; select * from t where i=1 for update; @@ -158,9 +158,9 @@ i rollback; rollback; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY SHARED PRIMARY test.t 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE PRIMARY test.t 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY SHARED PRIMARY test.t 1 Deadlock #6 create table t1 (id int primary key, value int) engine=rocksdb; insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5); @@ -184,13 +184,13 @@ set global rocksdb_lock_wait_timeout = @prior_lock_wait_timeout; set global rocksdb_deadlock_detect = @prior_deadlock_detect; drop table t; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE INDEX_NAME TABLE_NAME 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE INDEX_NAME TABLE_NAME 1 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY EXCLUSIVE INDEX_NAME TABLE_NAME 0 -DEADLOCK_ID TRANSACTION_ID default WAITING_KEY SHARED INDEX_NAME TABLE_NAME 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE INDEX_NAME TABLE_NAME 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE INDEX_NAME TABLE_NAME 1 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY EXCLUSIVE INDEX_NAME TABLE_NAME 0 +DEADLOCK_ID TIMESTAMP TRANSACTION_ID default WAITING_KEY SHARED INDEX_NAME TABLE_NAME 1 set global rocksdb_max_latest_deadlocks = 0; # Clears deadlock buffer of any existent deadlocks. set global rocksdb_max_latest_deadlocks = @prior_max_latest_deadlocks; select * from information_schema.rocksdb_deadlock; -DEADLOCK_ID TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK +DEADLOCK_ID TIMESTAMP TRANSACTION_ID CF_NAME WAITING_KEY LOCK_TYPE INDEX_NAME TABLE_NAME ROLLED_BACK diff --git a/mysql-test/suite/rocksdb/t/i_s_deadlock.test b/mysql-test/suite/rocksdb/t/i_s_deadlock.test index e63180b23a5e..fb462cf79f9d 100644 --- a/mysql-test/suite/rocksdb/t/i_s_deadlock.test +++ b/mysql-test/suite/rocksdb/t/i_s_deadlock.test @@ -37,23 +37,23 @@ select * from information_schema.rocksdb_deadlock; echo Deadlock #1; --source ../include/simple_deadlock.inc connection default; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY select * from information_schema.rocksdb_deadlock; echo Deadlock #2; --source ../include/simple_deadlock.inc connection default; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY select * from information_schema.rocksdb_deadlock; set global rocksdb_max_latest_deadlocks = 10; echo Deadlock #3; --source ../include/simple_deadlock.inc connection default; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY select * from information_schema.rocksdb_deadlock; set global rocksdb_max_latest_deadlocks = 1; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY select * from information_schema.rocksdb_deadlock; connection con3; @@ -103,7 +103,7 @@ rollback; connection default; set global rocksdb_max_latest_deadlocks = 5; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY select * from information_schema.rocksdb_deadlock; echo Deadlock #5; @@ -145,7 +145,7 @@ connection con3; rollback; connection default; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY select * from information_schema.rocksdb_deadlock; @@ -187,7 +187,7 @@ disconnect con3; set global rocksdb_lock_wait_timeout = @prior_lock_wait_timeout; set global rocksdb_deadlock_detect = @prior_deadlock_detect; drop table t; ---replace_column 1 DEADLOCK_ID 2 TRANSACTION_ID 4 WAITING_KEY 6 INDEX_NAME 7 TABLE_NAME +--replace_column 1 DEADLOCK_ID 2 TIMESTAMP 3 TRANSACTION_ID 5 WAITING_KEY 7 INDEX_NAME 8 TABLE_NAME select * from information_schema.rocksdb_deadlock; set global rocksdb_max_latest_deadlocks = 0; --echo # Clears deadlock buffer of any existent deadlocks. diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 3645f7770e16..0565730f7ec4 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -25,6 +25,7 @@ /* C++ standard header files */ #include +#include #include #include #include @@ -3429,6 +3430,7 @@ class Rdb_snapshot_status : public Rdb_tx_list_walker { if (!path_entry.path.empty() && !path_entry.limit_exceeded) { const auto& deadlocking_txn = *(path_entry.path.end() - 1); deadlock_info.victim_trx_id = deadlocking_txn.m_txn_id; + deadlock_info.deadlock_time = path_entry.deadlock_time; } return deadlock_info; } diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index a316e4334934..332c97446800 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -109,6 +109,7 @@ struct Rdb_deadlock_info { std::string table_name; }; std::vector path; + int64_t deadlock_time; ulonglong victim_trx_id; }; diff --git a/storage/rocksdb/rdb_i_s.cc b/storage/rocksdb/rdb_i_s.cc index dd5764987592..afd2bc935cd7 100644 --- a/storage/rocksdb/rdb_i_s.cc +++ b/storage/rocksdb/rdb_i_s.cc @@ -1551,19 +1551,21 @@ static int rdb_i_s_trx_info_init(void *const p) { namespace RDB_DEADLOCK_FIELD { enum { DEADLOCK_ID = 0, + TIMESTAMP, TRANSACTION_ID, CF_NAME, WAITING_KEY, LOCK_TYPE, INDEX_NAME, TABLE_NAME, - ROLLED_BACK + ROLLED_BACK, }; } // namespace RDB_TRX_FIELD static ST_FIELD_INFO rdb_i_s_deadlock_info_fields_info[] = { ROCKSDB_FIELD_INFO("DEADLOCK_ID", sizeof(ulonglong), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("TIMESTAMP", sizeof(ulonglong), MYSQL_TYPE_LONGLONG, 0), ROCKSDB_FIELD_INFO("TRANSACTION_ID", sizeof(ulonglong), MYSQL_TYPE_LONGLONG, 0), ROCKSDB_FIELD_INFO("CF_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), @@ -1608,8 +1610,11 @@ static int rdb_i_s_deadlock_info_fill_table( ulonglong id = 0; for (const auto &info : all_dl_info) { + auto deadlock_time = info.deadlock_time; for (const auto &trx_info : info.path) { tables->table->field[RDB_DEADLOCK_FIELD::DEADLOCK_ID]->store(id, true); + tables->table->field[RDB_DEADLOCK_FIELD::TIMESTAMP]->store(deadlock_time, + true); tables->table->field[RDB_DEADLOCK_FIELD::TRANSACTION_ID]->store( trx_info.trx_id, true); tables->table->field[RDB_DEADLOCK_FIELD::CF_NAME]->store( From f038e8085a97b3669b7347750e4c8118eb656fb5 Mon Sep 17 00:00:00 2001 From: Yoshinori Matsunobu Date: Fri, 13 Jul 2018 04:47:17 -0700 Subject: [PATCH 153/214] Adding information_schema.rocksdb_sst_props Upstream commit ID : fb-mysql-5.6.35/60ab18528d63709cc82364d5b9b81ecbfe8d86e8 PS-5217 : Merge fb-prod201803 Summary: This diff adds a new MyRocks information_schema table rocksdb_sst_props. This table basically returns what sst_dump --show_properties gives. With the rocksdb_sst_props table, you can query/filter/aggregate SST info more easily -- for example, getting total index block and bloom filter size can be done by just one query. Reviewed By: asandryh Differential Revision: D8833724 fbshipit-source-id: 341d5ca --- mysql-test/include/plugin.defs | 2 +- .../suite/rocksdb/r/i_s_sst_props.result | 21 +++ mysql-test/suite/rocksdb/t/i_s_sst_props.test | 7 + storage/rocksdb/ha_rocksdb.cc | 5 +- storage/rocksdb/rdb_i_s.cc | 168 ++++++++++++++++++ storage/rocksdb/rdb_i_s.h | 1 + 6 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/rocksdb/r/i_s_sst_props.result create mode 100644 mysql-test/suite/rocksdb/t/i_s_sst_props.test diff --git a/mysql-test/include/plugin.defs b/mysql-test/include/plugin.defs index d7f7be10468e..846b0d045353 100644 --- a/mysql-test/include/plugin.defs +++ b/mysql-test/include/plugin.defs @@ -93,4 +93,4 @@ audit_log plugin/audit_log AUDIT_LOG audit_log query_response_time plugin/query_response_time PLUGIN_QUERY_RESPONSE_TIME QUERY_RESPONSE_TIME_AUDIT,QUERY_RESPONSE_TIME,QUERY_RESPONSE_TIME_READ,QUERY_RESPONSE_TIME_WRITE ha_tokudb storage/tokudb TOKUDB tokudb,tokudb_trx,tokudb_locks,tokudb_lock_waits,tokudb_fractal_tree_info,tokudb_background_job_status,tokudb_file_map tokudb_backup plugin/tokudb-backup-plugin TOKUDB_BACKUP tokudb_backup -ha_rocksdb storage/rocksdb ROCKSDB rocksdb,rocksdb_cfstats,rocksdb_dbstats,rocksdb_perf_context,rocksdb_perf_context_global,rocksdb_cf_options,rocksdb_compaction_stats,rocksdb_global_info,rocksdb_ddl,rocksdb_index_file_map,rocksdb_locks,rocksdb_trx,rocksdb_deadlock +ha_rocksdb storage/rocksdb ROCKSDB rocksdb,rocksdb_cfstats,rocksdb_dbstats,rocksdb_perf_context,rocksdb_perf_context_global,rocksdb_cf_options,rocksdb_compaction_stats,rocksdb_global_info,rocksdb_ddl,rocksdb_index_file_map,rocksdb_locks,rocksdb_trx,rocksdb_deadlock,rocksdb_sst_props diff --git a/mysql-test/suite/rocksdb/r/i_s_sst_props.result b/mysql-test/suite/rocksdb/r/i_s_sst_props.result new file mode 100644 index 000000000000..8d9f74c2344f --- /dev/null +++ b/mysql-test/suite/rocksdb/r/i_s_sst_props.result @@ -0,0 +1,21 @@ +show create table information_schema.rocksdb_sst_props; +Table Create Table +ROCKSDB_SST_PROPS CREATE TEMPORARY TABLE `ROCKSDB_SST_PROPS` ( + `SST_NAME` varchar(193) NOT NULL DEFAULT '', + `COLUMN_FAMILY` int(4) NOT NULL DEFAULT '0', + `DATA_BLOCKS` bigint(8) NOT NULL DEFAULT '0', + `ENTRIES` bigint(8) NOT NULL DEFAULT '0', + `RAW_KEY_SIZE` bigint(8) NOT NULL DEFAULT '0', + `RAW_VALUE_SIZE` bigint(8) NOT NULL DEFAULT '0', + `DATA_BLOCK_SIZE` bigint(8) NOT NULL DEFAULT '0', + `INDEX_BLOCK_SIZE` bigint(8) NOT NULL DEFAULT '0', + `INDEX_PARTITIONS` int(4) NOT NULL DEFAULT '0', + `TOP_LEVEL_INDEX_SIZE` bigint(8) NOT NULL DEFAULT '0', + `FILTER_BLOCK_SIZE` bigint(8) NOT NULL DEFAULT '0', + `COMPRESSION_ALGO` varchar(193) NOT NULL DEFAULT '', + `CREATION_TIME` bigint(8) NOT NULL DEFAULT '0' +) ENGINE=MEMORY DEFAULT CHARSET=utf8 +uninstall plugin rocksdb; +select * from information_schema.rocksdb_sst_props; +ERROR HY000: Plugin 'ROCKSDB' is not loaded +# restart diff --git a/mysql-test/suite/rocksdb/t/i_s_sst_props.test b/mysql-test/suite/rocksdb/t/i_s_sst_props.test new file mode 100644 index 000000000000..5af548d90d05 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/i_s_sst_props.test @@ -0,0 +1,7 @@ +--source include/have_rocksdb.inc + +# +# Information Schema SST Properties +# +--let i_s_plugin=rocksdb_sst_props +--source suite/rocksdb/include/i_s_basic.inc diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 0565730f7ec4..b58b99b5e2e6 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -12962,5 +12962,6 @@ mysql_declare_plugin(rocksdb_se){ myrocks::rdb_i_s_perf_context, myrocks::rdb_i_s_perf_context_global, myrocks::rdb_i_s_cfoptions, myrocks::rdb_i_s_compact_stats, myrocks::rdb_i_s_global_info, myrocks::rdb_i_s_ddl, - myrocks::rdb_i_s_index_file_map, myrocks::rdb_i_s_lock_info, - myrocks::rdb_i_s_trx_info, myrocks::rdb_i_s_deadlock_info mysql_declare_plugin_end; + myrocks::rdb_i_s_sst_props, myrocks::rdb_i_s_index_file_map, + myrocks::rdb_i_s_lock_info, myrocks::rdb_i_s_trx_info, + myrocks::rdb_i_s_deadlock_info mysql_declare_plugin_end; diff --git a/storage/rocksdb/rdb_i_s.cc b/storage/rocksdb/rdb_i_s.cc index afd2bc935cd7..4eed6ffaebe0 100644 --- a/storage/rocksdb/rdb_i_s.cc +++ b/storage/rocksdb/rdb_i_s.cc @@ -1144,6 +1144,158 @@ static std::string rdb_filename_without_path(const std::string &path) { return path.substr(pos + 1); } +/* + Support for INFORMATION_SCHEMA.ROCKSDB_SST_PROPS dynamic table + */ +namespace RDB_SST_PROPS_FIELD { +enum { + SST_NAME = 0, + COLUMN_FAMILY, + DATA_BLOCKS, + ENTRIES, + RAW_KEY_SIZE, + RAW_VALUE_SIZE, + DATA_BLOCK_SIZE, + INDEX_BLOCK_SIZE, + INDEX_PARTITIONS, + TOP_LEVEL_INDEX_SIZE, + FILTER_BLOCK_SIZE, + COMPRESSION_ALGO, + CREATION_TIME +}; +} // namespace RDB_SST_PROPS_FIELD + +static ST_FIELD_INFO rdb_i_s_sst_props_fields_info[] = { + ROCKSDB_FIELD_INFO("SST_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("COLUMN_FAMILY", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("DATA_BLOCKS", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("ENTRIES", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("RAW_KEY_SIZE", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("RAW_VALUE_SIZE", sizeof(int64_t), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO("DATA_BLOCK_SIZE", sizeof(int64_t), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO("INDEX_BLOCK_SIZE", sizeof(int64_t), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO("INDEX_PARTITIONS", sizeof(uint32_t), MYSQL_TYPE_LONG, + 0), + ROCKSDB_FIELD_INFO("TOP_LEVEL_INDEX_SIZE", sizeof(int64_t), + MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("FILTER_BLOCK_SIZE", sizeof(int64_t), + MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("COMPRESSION_ALGO", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("CREATION_TIME", sizeof(int64_t), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO_END}; + +static int rdb_i_s_sst_props_fill_table( + my_core::THD *const thd, my_core::TABLE_LIST *const tables, + my_core::Item *const cond MY_ATTRIBUTE((__unused__))) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(tables != nullptr); + DBUG_ASSERT(tables->table != nullptr); + + int ret = 0; + Rdb_hton_init_state::Scoped_lock state_lock(*rdb_get_hton_init_state(), + false); + if (!rdb_get_hton_init_state()->initialized()) { + ret = ER_PLUGIN_IS_NOT_LOADED; + my_error(ret, MYF(0), rocksdb_hton_name); + DBUG_RETURN(ret); + } + + Field **field = tables->table->field; + DBUG_ASSERT(field != nullptr); + + /* Iterate over all the column families */ + rocksdb::DB *const rdb = rdb_get_rocksdb_db(); + + if (!rdb) { + DBUG_RETURN(ret); + } + + const Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); + + for (const auto &cf_handle : cf_manager.get_all_cf()) { + /* Grab the the properties of all the tables in the column family */ + rocksdb::TablePropertiesCollection table_props_collection; + const rocksdb::Status s = + rdb->GetPropertiesOfAllTables(cf_handle, &table_props_collection); + + if (!s.ok()) { + continue; + } + + /* Iterate over all the items in the collection, each of which contains a + * name and the actual properties */ + for (const auto &props : table_props_collection) { + /* Add the SST name into the output */ + const std::string sst_name = rdb_filename_without_path(props.first); + + field[RDB_SST_PROPS_FIELD::SST_NAME]->store( + sst_name.data(), sst_name.size(), system_charset_info); + + field[RDB_SST_PROPS_FIELD::COLUMN_FAMILY]->store( + props.second->column_family_id, true); + field[RDB_SST_PROPS_FIELD::DATA_BLOCKS]->store( + props.second->num_data_blocks, true); + field[RDB_SST_PROPS_FIELD::ENTRIES]->store(props.second->num_entries, + true); + field[RDB_SST_PROPS_FIELD::RAW_KEY_SIZE]->store( + props.second->raw_key_size, true); + field[RDB_SST_PROPS_FIELD::RAW_VALUE_SIZE]->store( + props.second->raw_value_size, true); + field[RDB_SST_PROPS_FIELD::DATA_BLOCK_SIZE]->store( + props.second->data_size, true); + field[RDB_SST_PROPS_FIELD::INDEX_BLOCK_SIZE]->store( + props.second->index_size, true); + field[RDB_SST_PROPS_FIELD::INDEX_PARTITIONS]->store( + props.second->index_partitions, true); + field[RDB_SST_PROPS_FIELD::TOP_LEVEL_INDEX_SIZE]->store( + props.second->top_level_index_size, true); + field[RDB_SST_PROPS_FIELD::FILTER_BLOCK_SIZE]->store( + props.second->filter_size, true); + if (props.second->compression_name.empty()) { + field[RDB_SST_PROPS_FIELD::COMPRESSION_ALGO]->set_null(); + } else { + field[RDB_SST_PROPS_FIELD::COMPRESSION_ALGO]->store( + props.second->compression_name.c_str(), + props.second->compression_name.size(), system_charset_info); + } + field[RDB_SST_PROPS_FIELD::CREATION_TIME]->store( + props.second->creation_time, true); + + /* Tell MySQL about this row in the virtual table */ + ret = static_cast( + my_core::schema_table_store_record(thd, tables->table)); + + if (ret != 0) { + DBUG_RETURN(ret); + } + } + } + + DBUG_RETURN(ret); +} + +/* Initialize the information_schema.rocksdb_sst_props virtual table */ +static int rdb_i_s_sst_props_init(void *const p) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(p != nullptr); + + my_core::ST_SCHEMA_TABLE *schema; + + schema = (my_core::ST_SCHEMA_TABLE *)p; + + schema->fields_info = rdb_i_s_sst_props_fields_info; + schema->fill_table = rdb_i_s_sst_props_fill_table; + + DBUG_RETURN(0); +} + /* Support for INFORMATION_SCHEMA.ROCKSDB_INDEX_FILE_MAP dynamic table */ @@ -1805,6 +1957,22 @@ struct st_mysql_plugin rdb_i_s_ddl = { 0, /* flags */ }; +struct st_mysql_plugin rdb_i_s_sst_props = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_SST_PROPS", + "Facebook", + "RocksDB SST Properties", + PLUGIN_LICENSE_GPL, + rdb_i_s_sst_props_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ +}; + struct st_mysql_plugin rdb_i_s_index_file_map = { MYSQL_INFORMATION_SCHEMA_PLUGIN, &rdb_i_s_info, diff --git a/storage/rocksdb/rdb_i_s.h b/storage/rocksdb/rdb_i_s.h index 4e72a1e1d038..dd9f4a93457c 100644 --- a/storage/rocksdb/rdb_i_s.h +++ b/storage/rocksdb/rdb_i_s.h @@ -29,6 +29,7 @@ extern struct st_mysql_plugin rdb_i_s_cfoptions; extern struct st_mysql_plugin rdb_i_s_compact_stats; extern struct st_mysql_plugin rdb_i_s_global_info; extern struct st_mysql_plugin rdb_i_s_ddl; +extern struct st_mysql_plugin rdb_i_s_sst_props; extern struct st_mysql_plugin rdb_i_s_index_file_map; extern struct st_mysql_plugin rdb_i_s_lock_info; extern struct st_mysql_plugin rdb_i_s_trx_info; From 34aee243c784b4f9acb002ee1db27724d03e3103 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Mon, 13 Nov 2017 20:34:19 -0800 Subject: [PATCH 154/214] Fix bug 1704195 / 87065 / TDB-83 (Stop ANALYZE TABLE from flushing table definition cache) Upstream commit ID : fb-mysql-5.6.35/75aa2e639388293f77e79dabff4cf5903020c8d3 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Change already applied to source tree through another patch. From d77c5faf4881738b54944269b05a9aafee7f913e Mon Sep 17 00:00:00 2001 From: Herman Lee Date: Wed, 18 Jul 2018 16:37:15 -0700 Subject: [PATCH 155/214] Fix transaction_lock_timeout value Upstream commit ID : fb-mysql-5.6.35/179a0cfb0bf249e55f9cb377e9d7776a906c172a PS-5217 : Merge fb-prod201803 Summary: RocksDB expects milliseconds, MyRocks treated it as seconds, so change it to milliseconds. Reviewed By: lth Differential Revision: D8906891 fbshipit-source-id: 1f39c4359cb --- storage/rocksdb/ha_rocksdb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index b58b99b5e2e6..bf132c8c83c8 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -4188,7 +4188,7 @@ static int rocksdb_init_func(void *const p) { cf_options_map->get_defaults()); rocksdb::TransactionDBOptions tx_db_options; - tx_db_options.transaction_lock_timeout = 2; // 2 seconds + tx_db_options.transaction_lock_timeout = 2000; // 2 seconds tx_db_options.custom_mutex_factory = std::make_shared(); tx_db_options.write_policy = static_cast(rocksdb_write_policy); From 54cb08276ac1bc909f49c8a2fdad5dc37562d99a Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 23 Jul 2018 11:07:06 -0700 Subject: [PATCH 156/214] Issue#857: MyRocks: Incorrect behavior when miltiple statements fail inside a transaction (#858) Upstream commit ID : fb-mysql-5.6.35/1775ed264c06793dff108ceec2f7945f8ca9b30a PS-5217 : Merge fb-prod201803 Summary: rollback_to_stmt_savepoint() calls do_rollback_to_savepoint(). This removes the changes made by this statement, and also removes the last set savepoint. Before we start processing the next statement, we need to set the new savepoint, so we will have something to rollback to if the next statement fails. Since rollback_to_stmt_savepoint always sets a new savepoint now, m_n_savepoints is now redundant and is removed. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/858 Differential Revision: D8848229 Pulled By: yoshinorim fbshipit-source-id: 9917838ca2a --- mysql-test/suite/rocksdb/r/transaction.result | 17 ++++++++++++++ mysql-test/suite/rocksdb/t/transaction.test | 23 +++++++++++++++++++ storage/rocksdb/ha_rocksdb.cc | 16 ++++++------- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/rocksdb/r/transaction.result b/mysql-test/suite/rocksdb/r/transaction.result index 28950b46666c..84118e80d7cb 100644 --- a/mysql-test/suite/rocksdb/r/transaction.result +++ b/mysql-test/suite/rocksdb/r/transaction.result @@ -1602,3 +1602,20 @@ a rollback; drop function func; drop table t1,t2,t3; +# +# MDEV-16710: Slave SQL: Could not execute Update_rows_v1 event with RocksDB and triggers +# Issue#857: MyRocks: Incorrect behavior when multiple statements fail inside a transaction +# +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=RocksDB; +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=RocksDB; +CREATE TRIGGER tr AFTER INSERT ON t2 FOR EACH ROW INSERT INTO non_existing_table VALUES (NULL); +BEGIN; +DELETE FROM t1; +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (2); +# Must return empty result: +SELECT * FROM t1; +a +COMMIT; +drop table t1,t2; diff --git a/mysql-test/suite/rocksdb/t/transaction.test b/mysql-test/suite/rocksdb/t/transaction.test index 2c36a0828b77..1c1200e135da 100644 --- a/mysql-test/suite/rocksdb/t/transaction.test +++ b/mysql-test/suite/rocksdb/t/transaction.test @@ -254,3 +254,26 @@ select * from t3; rollback; drop function func; drop table t1,t2,t3; + +--echo # +--echo # MDEV-16710: Slave SQL: Could not execute Update_rows_v1 event with RocksDB and triggers +--echo # Issue#857: MyRocks: Incorrect behavior when multiple statements fail inside a transaction +--echo # +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=RocksDB; +INSERT INTO t1 VALUES (1); + +CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=RocksDB; + +CREATE TRIGGER tr AFTER INSERT ON t2 FOR EACH ROW INSERT INTO non_existing_table VALUES (NULL); + +BEGIN; +DELETE FROM t1; +--error 0,ER_NO_SUCH_TABLE +INSERT INTO t2 VALUES (1); +--error 0,ER_NO_SUCH_TABLE +INSERT INTO t2 VALUES (2); +--echo # Must return empty result: +SELECT * FROM t1; +COMMIT; + +drop table t1,t2; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index bf132c8c83c8..918a705b2675 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -1778,8 +1778,6 @@ class Rdb_transaction { bool m_is_delayed_snapshot = false; private: - /* Number of RockDB savepoints taken */ - int m_n_savepoints; /* Number of write operations this transaction had when we took the last savepoint (the idea is not to take another savepoint if we haven't made @@ -2301,7 +2299,6 @@ class Rdb_transaction { entire transaction. */ do_set_savepoint(); - m_n_savepoints = 1; m_writes_at_last_savepoint = m_write_count; } @@ -2317,7 +2314,6 @@ class Rdb_transaction { if (m_writes_at_last_savepoint != m_write_count) { do_set_savepoint(); m_writes_at_last_savepoint = m_write_count; - m_n_savepoints++; } } @@ -2327,10 +2323,14 @@ class Rdb_transaction { void rollback_to_stmt_savepoint() { if (m_writes_at_last_savepoint != m_write_count) { do_rollback_to_savepoint(); - if (!--m_n_savepoints) { - do_set_savepoint(); - m_n_savepoints = 1; - } + /* + RollbackToSavePoint "removes the most recent SetSavePoint()", so + we need to set it again so that next statement can roll back to this + stage. + It's ok to do it here at statement end (instead of doing it at next + statement start) because setting a savepoint is cheap. + */ + do_set_savepoint(); m_writes_at_last_savepoint = m_write_count; } } From 0eaf4824e7011101d6745ab6d26bd406ecefe1f4 Mon Sep 17 00:00:00 2001 From: Sergei Glushchenko Date: Tue, 1 Jan 2019 23:53:25 +0700 Subject: [PATCH 157/214] PS-4949: Bad select+order by+limit performance in 5.7 Optimizer choosing ref-access when range access is more optimal. This is related to upstream bug #26727773 (commit ddd9d614a32). This bug was fixed differently in 5.7 and 8.0. 5.7 fix doesn't work for this query and 8.0 looks more robust. It is choosing range access over ref access if ref access using more keyparts. Fixed by taking fix and test cases from 8.0. Take 8.0 version of fix for #26727773 fix/re-record some test cases --- mysql-test/include/range.inc | 4 +- mysql-test/r/opt_hints.result | 40 +-- mysql-test/r/range_all.result | 7 +- mysql-test/r/range_icp.result | 11 +- mysql-test/r/range_icp_mrr.result | 7 +- mysql-test/r/range_mrr.result | 7 +- mysql-test/r/range_mrr_cost.result | 11 +- mysql-test/r/range_none.result | 11 +- mysql-test/r/range_with_memory_limit.result | 7 +- mysql-test/suite/opt_trace/include/bugs.inc | 32 +- .../suite/opt_trace/r/bugs_no_prot_all.result | 43 ++- .../opt_trace/r/bugs_no_prot_none.result | 43 ++- .../suite/opt_trace/r/bugs_ps_prot_all.result | 43 ++- .../opt_trace/r/bugs_ps_prot_none.result | 43 ++- .../opt_trace/r/eq_range_statistics.result | 66 +--- .../suite/opt_trace/r/range_no_prot.result | 324 ++---------------- mysql-test/t/opt_hints.test | 20 +- sql/sql_planner.cc | 9 +- 18 files changed, 238 insertions(+), 490 deletions(-) diff --git a/mysql-test/include/range.inc b/mysql-test/include/range.inc index 1ff33c0aa2b6..06f2fee8377f 100644 --- a/mysql-test/include/range.inc +++ b/mysql-test/include/range.inc @@ -1048,7 +1048,8 @@ alter table t2 add index (a,b); # 500 rows, 1 row -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; +--echo Access method can be range/ALL with #rows >= 500. +--echo Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; drop table t1, t2; @@ -2534,6 +2535,7 @@ UPDATE mysql.innodb_table_stats SET n_rows=3001 WHERE TABLE_name='transactions'; FLUSH TABLE transactions; --enable_query_log +--replace_column 10 # 11 # eval EXPLAIN $query1; SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/opt_hints.result b/mysql-test/r/opt_hints.result index 8047acffcffa..9b6b95038247 100644 --- a/mysql-test/r/opt_hints.result +++ b/mysql-test/r/opt_hints.result @@ -99,44 +99,44 @@ Note 1003 /* select#1 */ select /*+ NO_RANGE_OPTIMIZATION(`t3`@`select#1` `PRIMA # NO_ICP hint testing set optimizer_switch='index_condition_pushdown=on'; EXPLAIN SELECT f2 FROM -(SELECT f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD -WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; +(SELECT f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD +WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using index condition +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) +Note 1003 /* select#1 */ select `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) EXPLAIN SELECT /*+ NO_ICP(t3@qb1 f3_idx) */ f2 FROM -(SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD -WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; +(SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD +WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where Warnings: -Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1` `f3_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) +Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1` `f3_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) EXPLAIN SELECT /*+ NO_ICP(t3@qb1) */ f2 FROM -(SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD -WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; +(SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD +WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where Warnings: -Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) +Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) # Expected warning for f1_idx key, unresolved name. EXPLAIN SELECT f2 FROM -(SELECT /*+ NO_ICP(t3 f3_idx, f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD -WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; +(SELECT /*+ NO_ICP(t3 f3_idx, f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD +WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where Warnings: Warning 3128 Unresolved name `t3`@`select#2` `f1_idx` for NO_ICP hint -Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f3_idx`) NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) +Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f3_idx`) NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) # ICP should still be used. EXPLAIN SELECT f2 FROM -(SELECT /*+ NO_ICP(t3 f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD -WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; +(SELECT /*+ NO_ICP(t3 f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD +WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using index condition +1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where Warnings: Warning 3128 Unresolved name `t3`@`select#2` `f1_idx` for NO_ICP hint -Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 2) and (`test`.`t3`.`f1` > 2)) +Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) # BKA & NO_BKA hint testing set optimizer_switch=default; set optimizer_switch='batched_key_access=off,mrr_cost_based=off'; diff --git a/mysql-test/r/range_all.result b/mysql-test/r/range_all.result index c68ee9b54066..73530453ce8c 100644 --- a/mysql-test/r/range_all.result +++ b/mysql-test/r/range_all.result @@ -1356,9 +1356,8 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using index condition; Using MRR @@ -3669,7 +3668,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 8 NULL 1 100.00 Using index condition; Using where; Using MRR; Using filesort +1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx created_idx 4 NULL # # Using index condition; Using where; Using MRR; Using filesort Warnings: Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/range_icp.result b/mysql-test/r/range_icp.result index 58d55e7dc221..f078e19af858 100644 --- a/mysql-test/r/range_icp.result +++ b/mysql-test/r/range_icp.result @@ -1356,12 +1356,11 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using index condition +1 SIMPLE t2 NULL ALL a NULL NULL NULL 1000 50.20 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3621,7 +3620,7 @@ WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272, 70923271, 68066180) AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE giant_table NULL range PRIMARY,some_other_id some_other_id 8 NULL 20 100.00 Using index condition; Using where +1 SIMPLE giant_table NULL range PRIMARY,some_other_id PRIMARY 4 NULL 20 0.36 Using where Warnings: Note 1003 /* select#1 */ select `test`.`giant_table`.`id` AS `id`,`test`.`giant_table`.`something` AS `something`,`test`.`giant_table`.`comment` AS `comment`,`test`.`giant_table`.`time_created` AS `time_created`,`test`.`giant_table`.`one_id` AS `one_id`,`test`.`giant_table`.`other_id` AS `other_id`,`test`.`giant_table`.`some_other_id` AS `some_other_id`,`test`.`giant_table`.`flags` AS `flags` from `test`.`giant_table` where ((`test`.`giant_table`.`some_other_id` = 0) and (`test`.`giant_table`.`id` in (66136539,68983258,89628210,77869520,82543198,67538272,84673401,61069031,68214385,77282865,76991297,64569216,89481638,74534074,70396537,80076375,63308530,77908270,70923271,68066180)) and ((`test`.`giant_table`.`flags` & 0x01) = 0)) DROP PROCEDURE p; @@ -3669,7 +3668,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 8 NULL 1 100.00 Using index condition; Using where; Using filesort +1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx created_idx 4 NULL # # Using index condition; Using where; Using filesort Warnings: Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/range_icp_mrr.result b/mysql-test/r/range_icp_mrr.result index 6ce7f6c981d4..8119b64b300e 100644 --- a/mysql-test/r/range_icp_mrr.result +++ b/mysql-test/r/range_icp_mrr.result @@ -1356,9 +1356,8 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using index condition; Using MRR @@ -3669,7 +3668,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 8 NULL 1 100.00 Using index condition; Using where; Using MRR; Using filesort +1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx created_idx 4 NULL # # Using index condition; Using where; Using MRR; Using filesort Warnings: Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/range_mrr.result b/mysql-test/r/range_mrr.result index daecc0d27858..a2c51a1967e1 100644 --- a/mysql-test/r/range_mrr.result +++ b/mysql-test/r/range_mrr.result @@ -1356,9 +1356,8 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using where; Using MRR @@ -3669,7 +3668,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 8 NULL 1 100.00 Using where; Using MRR; Using filesort +1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx created_idx 4 NULL # # Using where; Using MRR; Using filesort Warnings: Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/range_mrr_cost.result b/mysql-test/r/range_mrr_cost.result index de3d0e46d7c0..931ff5909749 100644 --- a/mysql-test/r/range_mrr_cost.result +++ b/mysql-test/r/range_mrr_cost.result @@ -1356,12 +1356,11 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using where +1 SIMPLE t2 NULL ALL a NULL NULL NULL 1000 50.20 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3621,7 +3620,7 @@ WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272, 70923271, 68066180) AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE giant_table NULL range PRIMARY,some_other_id some_other_id 8 NULL 20 100.00 Using where +1 SIMPLE giant_table NULL range PRIMARY,some_other_id PRIMARY 4 NULL 20 0.36 Using where Warnings: Note 1003 /* select#1 */ select `test`.`giant_table`.`id` AS `id`,`test`.`giant_table`.`something` AS `something`,`test`.`giant_table`.`comment` AS `comment`,`test`.`giant_table`.`time_created` AS `time_created`,`test`.`giant_table`.`one_id` AS `one_id`,`test`.`giant_table`.`other_id` AS `other_id`,`test`.`giant_table`.`some_other_id` AS `some_other_id`,`test`.`giant_table`.`flags` AS `flags` from `test`.`giant_table` where ((`test`.`giant_table`.`some_other_id` = 0) and (`test`.`giant_table`.`id` in (66136539,68983258,89628210,77869520,82543198,67538272,84673401,61069031,68214385,77282865,76991297,64569216,89481638,74534074,70396537,80076375,63308530,77908270,70923271,68066180)) and ((`test`.`giant_table`.`flags` & 0x01) = 0)) DROP PROCEDURE p; @@ -3669,7 +3668,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 8 NULL 1 100.00 Using where; Using filesort +1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx created_idx 4 NULL # # Using where; Using filesort Warnings: Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/range_none.result b/mysql-test/r/range_none.result index 047effcc3b6c..257a96479895 100644 --- a/mysql-test/r/range_none.result +++ b/mysql-test/r/range_none.result @@ -1355,12 +1355,11 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using where +1 SIMPLE t2 NULL ALL a NULL NULL NULL 1000 50.20 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3620,7 +3619,7 @@ WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272, 70923271, 68066180) AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE giant_table NULL range PRIMARY,some_other_id some_other_id 8 NULL 20 100.00 Using where +1 SIMPLE giant_table NULL range PRIMARY,some_other_id PRIMARY 4 NULL 20 0.36 Using where Warnings: Note 1003 /* select#1 */ select `test`.`giant_table`.`id` AS `id`,`test`.`giant_table`.`something` AS `something`,`test`.`giant_table`.`comment` AS `comment`,`test`.`giant_table`.`time_created` AS `time_created`,`test`.`giant_table`.`one_id` AS `one_id`,`test`.`giant_table`.`other_id` AS `other_id`,`test`.`giant_table`.`some_other_id` AS `some_other_id`,`test`.`giant_table`.`flags` AS `flags` from `test`.`giant_table` where ((`test`.`giant_table`.`some_other_id` = 0) and (`test`.`giant_table`.`id` in (66136539,68983258,89628210,77869520,82543198,67538272,84673401,61069031,68214385,77282865,76991297,64569216,89481638,74534074,70396537,80076375,63308530,77908270,70923271,68066180)) and ((`test`.`giant_table`.`flags` & 0x01) = 0)) DROP PROCEDURE p; @@ -3668,7 +3667,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 8 NULL 1 100.00 Using where; Using filesort +1 SIMPLE transactions NULL range tbl_id_idx,created_idx,trans_type_created_idx created_idx 4 NULL # # Using where; Using filesort Warnings: Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` SET optimizer_trace="enabled=on"; diff --git a/mysql-test/r/range_with_memory_limit.result b/mysql-test/r/range_with_memory_limit.result index 455cd2dc91a4..6e79a92fab5c 100644 --- a/mysql-test/r/range_with_memory_limit.result +++ b/mysql-test/r/range_with_memory_limit.result @@ -1564,9 +1564,8 @@ insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; insert into t2 select 1000, b, 'filler' from t2; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref or range, #rows~=500 (and not 2) +Access method can be range/ALL with #rows >= 500. +Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 NULL ref a a 5 const 2 33.33 Using index condition @@ -4185,7 +4184,7 @@ FROM transactions WHERE created > '2017-10-23 01:01:01' AND tbl = 1 AND trans_type in (3) GROUP BY '2017-10-23 01:01:01', HOUR(created), source_lvl1, source_lvl2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE transactions NULL ref tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 4 const 1 33.33 Using index condition; Using where; Using filesort +1 SIMPLE transactions NULL ref tbl_id_idx,created_idx,trans_type_created_idx trans_type_created_idx 4 const # # Using index condition; Using where; Using filesort Warnings: Warning 3170 Memory capacity of 50 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query. Note 1003 /* select#1 */ select '2017-10-23 01:01:01' AS `2017-10-23 01:01:01`,hour(`test`.`transactions`.`created`) AS `HOUR(created)`,`test`.`transactions`.`source_lvl1` AS `source_lvl1`,`test`.`transactions`.`source_lvl2` AS `source_lvl2`,count(distinct `test`.`transactions`.`app_trans_id`) AS `COUNT(DISTINCT(app_trans_id))` from `test`.`transactions` where ((`test`.`transactions`.`trans_type` = 3) and (`test`.`transactions`.`tbl` = 1) and (`test`.`transactions`.`created` > '2017-10-23 01:01:01')) group by '2017-10-23 01:01:01',hour(`test`.`transactions`.`created`),`test`.`transactions`.`source_lvl1`,`test`.`transactions`.`source_lvl2` diff --git a/mysql-test/suite/opt_trace/include/bugs.inc b/mysql-test/suite/opt_trace/include/bugs.inc index 83ae8710c776..ae619ba43307 100644 --- a/mysql-test/suite/opt_trace/include/bugs.inc +++ b/mysql-test/suite/opt_trace/include/bugs.inc @@ -480,25 +480,29 @@ DROP TABLE B,C,CC; CREATE TABLE t1 ( a TINYTEXT NOT NULL, b TINYINT(3) UNSIGNED NOT NULL, - PRIMARY KEY (a(32),b), - KEY b_idx(b) -) ENGINE=INNODB; -INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); -ANALYZE TABLE t1; + PRIMARY KEY (a(32),b) +) ENGINE=MyISAM, CHARSET utf8mb4; +CREATE TABLE t2 ( + a TINYTEXT NOT NULL, + b TINYINT(3) UNSIGNED NOT NULL, + PRIMARY KEY (a(32),b) +) ENGINE=INNODB, CHARSET utf8mb4; -SET @optimizer_switch_saved=@@session.optimizer_switch; -SET @@session.optimizer_switch=default; +INSERT INTO t1 VALUES ('a',1),('a',2); +INSERT INTO t2 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); +ANALYZE TABLE t1; +ANALYZE TABLE t2; -SELECT COUNT(*) FROM t1; -# Uses "access_type_changed" to use range over ref despite b_idx not being the -# cheapest in range. -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; +# range uses more keyparts than ref, so range is chosen. +EXPLAIN SELECT * FROM t1 WHERE a='a' AND b in (1,2); SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; +SELECT @trace RLIKE "range_uses_more_keyparts"; -SET @@session.optimizer_switch=@optimizer_switch_saved; +EXPLAIN SELECT * FROM t2 WHERE a='a' AND b in (1,2); +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "range_uses_more_keyparts"; -DROP TABLE t1; +DROP TABLE t1, t2; --echo # --echo # Bug #23227428: SQL PLAN IS NOT ACCORDING WITH OPTIMIZER_TRACE diff --git a/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result b/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result index 776110fad3ec..ecc18e07c967 100644 --- a/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result +++ b/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result @@ -3490,29 +3490,40 @@ DROP TABLE B,C,CC; CREATE TABLE t1 ( a TINYTEXT NOT NULL, b TINYINT(3) UNSIGNED NOT NULL, -PRIMARY KEY (a(32),b), -KEY b_idx(b) -) ENGINE=INNODB; -INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); +PRIMARY KEY (a(32),b) +) ENGINE=MyISAM, CHARSET utf8mb4; +CREATE TABLE t2 ( +a TINYTEXT NOT NULL, +b TINYINT(3) UNSIGNED NOT NULL, +PRIMARY KEY (a(32),b) +) ENGINE=INNODB, CHARSET utf8mb4; +INSERT INTO t1 VALUES ('a',1),('a',2); +INSERT INTO t2 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK -SET @optimizer_switch_saved=@@session.optimizer_switch; -SET @@session.optimizer_switch=default; -SELECT COUNT(*) FROM t1; -COUNT(*) -7 -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a='a' AND b in (1,2); id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,b_idx b_idx 35 NULL 2 100.00 Using index condition; Using where +1 SIMPLE t1 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 2) and (`test`.`t1`.`a` in ('a','b'))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`b` in (1,2))) SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; -@trace RLIKE "rerunning_range_optimizer_for_single_index" +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" 1 -SET @@session.optimizer_switch=@optimizer_switch_saved; -DROP TABLE t1; +EXPLAIN SELECT * FROM t2 WHERE a='a' AND b in (1,2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`a` = 'a') and (`test`.`t2`.`b` in (1,2))) +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" +1 +DROP TABLE t1, t2; # # Bug #23227428: SQL PLAN IS NOT ACCORDING WITH OPTIMIZER_TRACE # diff --git a/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result b/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result index b26ce54a8eee..020a83f7b72d 100644 --- a/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result +++ b/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result @@ -2651,29 +2651,40 @@ DROP TABLE B,C,CC; CREATE TABLE t1 ( a TINYTEXT NOT NULL, b TINYINT(3) UNSIGNED NOT NULL, -PRIMARY KEY (a(32),b), -KEY b_idx(b) -) ENGINE=INNODB; -INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); +PRIMARY KEY (a(32),b) +) ENGINE=MyISAM, CHARSET utf8mb4; +CREATE TABLE t2 ( +a TINYTEXT NOT NULL, +b TINYINT(3) UNSIGNED NOT NULL, +PRIMARY KEY (a(32),b) +) ENGINE=INNODB, CHARSET utf8mb4; +INSERT INTO t1 VALUES ('a',1),('a',2); +INSERT INTO t2 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK -SET @optimizer_switch_saved=@@session.optimizer_switch; -SET @@session.optimizer_switch=default; -SELECT COUNT(*) FROM t1; -COUNT(*) -7 -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a='a' AND b in (1,2); id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,b_idx b_idx 35 NULL 2 100.00 Using index condition; Using where +1 SIMPLE t1 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 2) and (`test`.`t1`.`a` in ('a','b'))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`b` in (1,2))) SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; -@trace RLIKE "rerunning_range_optimizer_for_single_index" +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" 1 -SET @@session.optimizer_switch=@optimizer_switch_saved; -DROP TABLE t1; +EXPLAIN SELECT * FROM t2 WHERE a='a' AND b in (1,2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`a` = 'a') and (`test`.`t2`.`b` in (1,2))) +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" +1 +DROP TABLE t1, t2; # # Bug #23227428: SQL PLAN IS NOT ACCORDING WITH OPTIMIZER_TRACE # diff --git a/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result b/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result index d066b990f89a..9f8f5c262a4e 100644 --- a/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result +++ b/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result @@ -3331,29 +3331,40 @@ DROP TABLE B,C,CC; CREATE TABLE t1 ( a TINYTEXT NOT NULL, b TINYINT(3) UNSIGNED NOT NULL, -PRIMARY KEY (a(32),b), -KEY b_idx(b) -) ENGINE=INNODB; -INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); +PRIMARY KEY (a(32),b) +) ENGINE=MyISAM, CHARSET utf8mb4; +CREATE TABLE t2 ( +a TINYTEXT NOT NULL, +b TINYINT(3) UNSIGNED NOT NULL, +PRIMARY KEY (a(32),b) +) ENGINE=INNODB, CHARSET utf8mb4; +INSERT INTO t1 VALUES ('a',1),('a',2); +INSERT INTO t2 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK -SET @optimizer_switch_saved=@@session.optimizer_switch; -SET @@session.optimizer_switch=default; -SELECT COUNT(*) FROM t1; -COUNT(*) -7 -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a='a' AND b in (1,2); id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,b_idx b_idx 35 NULL 2 100.00 Using index condition; Using where +1 SIMPLE t1 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 2) and (`test`.`t1`.`a` in ('a','b'))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`b` in (1,2))) SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; -@trace RLIKE "rerunning_range_optimizer_for_single_index" +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" 1 -SET @@session.optimizer_switch=@optimizer_switch_saved; -DROP TABLE t1; +EXPLAIN SELECT * FROM t2 WHERE a='a' AND b in (1,2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`a` = 'a') and (`test`.`t2`.`b` in (1,2))) +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" +1 +DROP TABLE t1, t2; # # Bug #23227428: SQL PLAN IS NOT ACCORDING WITH OPTIMIZER_TRACE # diff --git a/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result b/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result index 62d69e09860a..b6a193c28d95 100644 --- a/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result +++ b/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result @@ -2532,29 +2532,40 @@ DROP TABLE B,C,CC; CREATE TABLE t1 ( a TINYTEXT NOT NULL, b TINYINT(3) UNSIGNED NOT NULL, -PRIMARY KEY (a(32),b), -KEY b_idx(b) -) ENGINE=INNODB; -INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); +PRIMARY KEY (a(32),b) +) ENGINE=MyISAM, CHARSET utf8mb4; +CREATE TABLE t2 ( +a TINYTEXT NOT NULL, +b TINYINT(3) UNSIGNED NOT NULL, +PRIMARY KEY (a(32),b) +) ENGINE=INNODB, CHARSET utf8mb4; +INSERT INTO t1 VALUES ('a',1),('a',2); +INSERT INTO t2 VALUES ('a',1),('a',2),('a',3),('b',1),('c',1),('c',4),('e',2); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK -SET @optimizer_switch_saved=@@session.optimizer_switch; -SET @@session.optimizer_switch=default; -SELECT COUNT(*) FROM t1; -COUNT(*) -7 -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a='a' AND b in (1,2); id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,b_idx b_idx 35 NULL 2 100.00 Using index condition; Using where +1 SIMPLE t1 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = 2) and (`test`.`t1`.`a` in ('a','b'))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (`test`.`t1`.`b` in (1,2))) SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; -@trace RLIKE "rerunning_range_optimizer_for_single_index" +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" 1 -SET @@session.optimizer_switch=@optimizer_switch_saved; -DROP TABLE t1; +EXPLAIN SELECT * FROM t2 WHERE a='a' AND b in (1,2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range PRIMARY PRIMARY 131 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`a` = 'a') and (`test`.`t2`.`b` in (1,2))) +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "range_uses_more_keyparts"; +@trace RLIKE "range_uses_more_keyparts" +1 +DROP TABLE t1, t2; # # Bug #23227428: SQL PLAN IS NOT ACCORDING WITH OPTIMIZER_TRACE # diff --git a/mysql-test/suite/opt_trace/r/eq_range_statistics.result b/mysql-test/suite/opt_trace/r/eq_range_statistics.result index bb1751a1cb80..26faee7bb4b0 100644 --- a/mysql-test/suite/opt_trace/r/eq_range_statistics.result +++ b/mysql-test/suite/opt_trace/r/eq_range_statistics.result @@ -605,9 +605,8 @@ EXPLAIN SELECT * FROM t1 WHERE a=5 AND (b=2 OR b=3 OR b=4) { { "access_type": "ref", "index": "a", - "rows": 3, - "cost": 1.6039, - "chosen": true + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "rows_to_scan": 3, @@ -617,26 +616,17 @@ EXPLAIN SELECT * FROM t1 WHERE a=5 AND (b=2 OR b=3 OR b=4) { } /* range_details */, "resulting_rows": 3, "cost": 2.2139, - "chosen": false + "chosen": true } ] /* considered_access_paths */ } /* best_access_path */, - "condition_filtering_pct": 29.767, - "rows_for_plan": 0.893, - "cost_for_plan": 1.6039, + "condition_filtering_pct": 100, + "rows_for_plan": 3, + "cost_for_plan": 2.2139, "chosen": true } ] /* considered_execution_plans */ }, - { - "access_type_changed": { - "table": "`t1`", - "index": "a", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`a` = 5) and ((`t1`.`b` = 2) or (`t1`.`b` = 3) or (`t1`.`b` = 4)))", @@ -823,9 +813,8 @@ EXPLAIN SELECT * FROM t1 WHERE a=5 AND (b=2 OR b=3 OR b>4) { { "access_type": "ref", "index": "a", - "rows": 3, - "cost": 1.6039, - "chosen": true + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "rows_to_scan": 3, @@ -835,26 +824,17 @@ EXPLAIN SELECT * FROM t1 WHERE a=5 AND (b=2 OR b=3 OR b>4) { } /* range_details */, "resulting_rows": 3, "cost": 2.2139, - "chosen": false + "chosen": true } ] /* considered_access_paths */ } /* best_access_path */, - "condition_filtering_pct": 47.322, - "rows_for_plan": 1.4197, - "cost_for_plan": 1.6039, + "condition_filtering_pct": 100, + "rows_for_plan": 3, + "cost_for_plan": 2.2139, "chosen": true } ] /* considered_execution_plans */ }, - { - "access_type_changed": { - "table": "`t1`", - "index": "a", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`a` = 5) and ((`t1`.`b` = 2) or (`t1`.`b` = 3) or (`t1`.`b` > 4)))", @@ -1040,9 +1020,8 @@ EXPLAIN SELECT * FROM t1 WHERE a=5 AND (b=2 OR b=3 OR b IS NULL) { { "access_type": "ref", "index": "a", - "rows": 3, - "cost": 1.6039, - "chosen": true + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "rows_to_scan": 3, @@ -1052,26 +1031,17 @@ EXPLAIN SELECT * FROM t1 WHERE a=5 AND (b=2 OR b=3 OR b IS NULL) { } /* range_details */, "resulting_rows": 3, "cost": 2.2139, - "chosen": false + "chosen": true } ] /* considered_access_paths */ } /* best_access_path */, - "condition_filtering_pct": 29.767, - "rows_for_plan": 0.893, - "cost_for_plan": 1.6039, + "condition_filtering_pct": 100, + "rows_for_plan": 3, + "cost_for_plan": 2.2139, "chosen": true } ] /* considered_execution_plans */ }, - { - "access_type_changed": { - "table": "`t1`", - "index": "a", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`a` = 5) and ((`t1`.`b` = 2) or (`t1`.`b` = 3) or isnull(`t1`.`b`)))", diff --git a/mysql-test/suite/opt_trace/r/range_no_prot.result b/mysql-test/suite/opt_trace/r/range_no_prot.result index 972e20257fb7..578849826dd4 100644 --- a/mysql-test/suite/opt_trace/r/range_no_prot.result +++ b/mysql-test/suite/opt_trace/r/range_no_prot.result @@ -5164,7 +5164,7 @@ INSERT INTO t1 VALUES (1, 1, 9,'a'), (2, 2, 8,'b'), (3, 3, 7,'c'), # Covering ROR intersect not chosen: only one scan used EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL ref PRIMARY,i1_idx,v_idx i1_idx 5 const 1 20.00 Using index condition; Using where +1 SIMPLE t1 NULL range PRIMARY,i1_idx,v_idx v_idx 13 NULL 1 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where ((`test`.`t1`.`v` = 'a') and (`test`.`t1`.`i1` = 1) and (`test`.`t1`.`pk` < 3)) @@ -5383,16 +5383,14 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { { "access_type": "ref", "index": "i1_idx", - "rows": 1, - "cost": 1.2, - "chosen": true + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "access_type": "ref", "index": "v_idx", - "rows": 1, - "cost": 1.2, - "chosen": false + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "rows_to_scan": 1, @@ -5402,80 +5400,17 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { } /* range_details */, "resulting_rows": 1, "cost": 1.41, - "chosen": false + "chosen": true } ] /* considered_access_paths */ } /* best_access_path */, - "condition_filtering_pct": 20, - "rows_for_plan": 0.2, - "cost_for_plan": 1.2, + "condition_filtering_pct": 100, + "rows_for_plan": 1, + "cost_for_plan": 1.41, "chosen": true } ] /* considered_execution_plans */ }, - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "i1_idx", - "usable": true, - "key_parts": [ - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "v_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "v_idx", - "cost": 2.0063, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "i1_idx", - "ranges": [ - "1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`v` = 'a') and (`t1`.`i1` = 1) and (`t1`.`pk` < 3))", @@ -5484,7 +5419,7 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { "attached_conditions_summary": [ { "table": "`t1`", - "attached": "((`t1`.`v` = 'a') and (`t1`.`pk` < 3))" + "attached": "((`t1`.`v` = 'a') and (`t1`.`i1` = 1) and (`t1`.`pk` < 3))" } ] /* attached_conditions_summary */ } /* attaching_conditions_to_tables */ @@ -5492,9 +5427,7 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { { "refine_plan": [ { - "table": "`t1`", - "pushed_index_condition": "(`t1`.`pk` < 3)", - "table_condition_attached": "(`t1`.`v` = 'a')" + "table": "`t1`" } ] /* refine_plan */ } @@ -5519,7 +5452,7 @@ test.t1 analyze status OK # Covering ROR intersect not chosen: Index with more keyparts found. EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,v_idx,i1_i2_idx v_idx 13 NULL 1 20.00 Using index condition; Using where +1 SIMPLE t1 NULL index_merge PRIMARY,v_idx,i1_i2_idx v_idx,PRIMARY 13,4 NULL 1 20.00 Using intersect(v_idx,PRIMARY); Using where Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where ((`test`.`t1`.`v` = 'a') and (`test`.`t1`.`i2` = 1) and (`test`.`t1`.`i1` = 1) and (`test`.`t1`.`pk` < 3)) @@ -5765,16 +5698,14 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3 { { "access_type": "ref", "index": "v_idx", - "rows": 1, - "cost": 1.2, - "chosen": true + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "access_type": "ref", "index": "i1_i2_idx", - "rows": 1, - "cost": 1.2, - "chosen": false + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "rows_to_scan": 1, @@ -5784,97 +5715,17 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3 { } /* range_details */, "resulting_rows": 0.2, "cost": 1.3, - "chosen": false + "chosen": true } ] /* considered_access_paths */ } /* best_access_path */, - "condition_filtering_pct": 20, + "condition_filtering_pct": 100, "rows_for_plan": 0.2, - "cost_for_plan": 1.2, + "cost_for_plan": 1.3, "chosen": true } ] /* considered_execution_plans */ }, - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "v_idx", - "usable": true, - "key_parts": [ - "v", - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "i1_i2_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "v_idx", - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "v_idx", - "rows": 1, - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 1, - "cost_for_plan": 2.21, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "v_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`v` = 'a') and (`t1`.`i2` = 1) and (`t1`.`i1` = 1) and (`t1`.`pk` < 3))", @@ -5891,9 +5742,7 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3 { { "refine_plan": [ { - "table": "`t1`", - "pushed_index_condition": "((`t1`.`v` = 'a') and (`t1`.`i1` = 1) and (`t1`.`pk` < 3))", - "table_condition_attached": "(`t1`.`i2` = 1)" + "table": "`t1`" } ] /* refine_plan */ } @@ -5917,7 +5766,7 @@ INSERT INTO t1 VALUES (1,1),(1,2),(1,0),(1,3); # Test trace for "access_type_changed 'ref' to 'range'" EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,b PRIMARY 8 NULL 2 100.00 Using where; Using index for group-by +1 SIMPLE t1 NULL range PRIMARY,b b 4 NULL 2 25.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select max(`test`.`t1`.`b`) AS `MAX(b)`,`test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 1) and (`test`.`t1`.`b` < 2)) group by `test`.`t1`.`a` @@ -6118,9 +5967,8 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { { "access_type": "ref", "index": "PRIMARY", - "rows": 2, - "cost": 1.4019, - "chosen": true + "chosen": false, + "cause": "range_uses_more_keyparts" }, { "rows_to_scan": 2, @@ -6130,132 +5978,20 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { } /* range_details */, "resulting_rows": 0.5, "cost": 1.8115, - "chosen": false + "chosen": true, + "use_tmp_table": true } ] /* considered_access_paths */ } /* best_access_path */, - "condition_filtering_pct": 50, - "rows_for_plan": 1, - "cost_for_plan": 1.4019, + "condition_filtering_pct": 100, + "rows_for_plan": 0.5, + "cost_for_plan": 1.8115, + "sort_cost": 0.5, + "new_cost_for_plan": 2.3115, "chosen": true } ] /* considered_execution_plans */ }, - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 4, - "cost": 3.9 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "b", - "cost": 1.8044, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "potential_group_range_indexes": [ - { - "index": "PRIMARY", - "covering": true, - "index_dives_for_eq_ranges": true, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "rows": 2, - "cost": 1.6 - } - ] /* potential_group_range_indexes */ - } /* group_index_range */, - "best_group_range_summary": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "chosen": true - } /* best_group_range_summary */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2, - "cost": 2.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 1.6, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "PRIMARY", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, { "attaching_conditions_to_tables": { "original_condition": "((`t1`.`a` = 1) and (`t1`.`b` < 2))", diff --git a/mysql-test/t/opt_hints.test b/mysql-test/t/opt_hints.test index 6eb3f6b4c2d3..f02ebb50283d 100644 --- a/mysql-test/t/opt_hints.test +++ b/mysql-test/t/opt_hints.test @@ -62,26 +62,26 @@ EXPLAIN SELECT /*+ NO_RANGE_OPTIMIZATION(t3 PRIMARY) NO_RANGE_OPTIMIZATION(t3 f2 set optimizer_switch='index_condition_pushdown=on'; EXPLAIN SELECT f2 FROM - (SELECT f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD - WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; + (SELECT f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD + WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; EXPLAIN SELECT /*+ NO_ICP(t3@qb1 f3_idx) */ f2 FROM - (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD - WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; + (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD + WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; EXPLAIN SELECT /*+ NO_ICP(t3@qb1) */ f2 FROM - (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD - WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; + (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD + WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; --echo # Expected warning for f1_idx key, unresolved name. EXPLAIN SELECT f2 FROM - (SELECT /*+ NO_ICP(t3 f3_idx, f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD - WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; + (SELECT /*+ NO_ICP(t3 f3_idx, f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD + WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; --echo # ICP should still be used. EXPLAIN SELECT f2 FROM - (SELECT /*+ NO_ICP(t3 f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 2 AND f3 = 'poiu') AS TD - WHERE TD.f1 > 2 AND TD.f3 = 'poiu'; + (SELECT /*+ NO_ICP(t3 f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD + WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; --echo # BKA & NO_BKA hint testing set optimizer_switch=default; diff --git a/sql/sql_planner.cc b/sql/sql_planner.cc index 2bb437a2b8ac..bf4ec247f13a 100644 --- a/sql/sql_planner.cc +++ b/sql/sql_planner.cc @@ -498,8 +498,6 @@ Key_use* Optimize_table_order::find_best_ref(JOIN_TAB *tab, on the same index, (2) and that quick select uses more keyparts (i.e. it will scan equal/smaller interval then this ref(const)) - (3) and E(#rows) for quick select is higher then our - estimate, Then use E(#rows) from quick select. One observation is that when there are multiple @@ -515,11 +513,12 @@ Key_use* Optimize_table_order::find_best_ref(JOIN_TAB *tab, TODO: figure this out and adjust the plan choice if needed. */ if (!table_deps && table->quick_keys.is_set(key) && // (1) - table->quick_key_parts[key] > cur_used_keyparts && // (2) - cur_fanout <= (double)table->quick_rows[key]) // (3) + table->quick_key_parts[key] > cur_used_keyparts) // (2) { - cur_fanout= (double)table->quick_rows[key]; + trace_access_idx.add("chosen", false) + .add_alnum("cause", "range_uses_more_keyparts"); is_dodgy= true; + continue; } tmp_fanout= cur_fanout; From 513277c58bb494113bc0a3bead81db20fa498d3c Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Fri, 4 Jan 2019 11:57:46 +0200 Subject: [PATCH 158/214] Fix PS-5270 (xtradb_compressed_columns_consistency_barracuda_compressed_set2 still too big under ASan) mysqltest keeps in memory all the processed lines, with loops unrolled. For a testcase with multiple nested loops this results in big memory usage. Fix by rewriting the testcase logic as server-side stored procedures, completely eliminating mysqltest memory concerns, and making the testcase more efficient overall. --- .../xtradb_compressed_columns_check_type.inc | 136 -------- ...radb_compressed_columns_check_type_set.inc | 105 ------- ...compressed_columns_check_type_superset.inc | 108 ------- ...radb_compressed_columns_consistency.result | 243 +++++++++++++++ ...s_consistency_antelope_compact_set1.result | 22 -- ...s_consistency_antelope_compact_set2.result | 10 - ...s_consistency_antelope_compact_set3.result | 10 - ...consistency_antelope_redundant_set1.result | 22 -- ...consistency_antelope_redundant_set2.result | 10 - ...consistency_antelope_redundant_set3.result | 10 - ..._consistency_barracuda_compact_set1.result | 22 -- ..._consistency_barracuda_compact_set2.result | 10 - ..._consistency_barracuda_compact_set3.result | 10 - ...nsistency_barracuda_compressed_set1.result | 22 -- ...nsistency_barracuda_compressed_set2.result | 10 - ...nsistency_barracuda_compressed_set3.result | 10 - ..._consistency_barracuda_dynamic_set1.result | 22 -- ..._consistency_barracuda_dynamic_set2.result | 10 - ..._consistency_barracuda_dynamic_set3.result | 10 - ...onsistency_barracuda_redundant_set1.result | 22 -- ...onsistency_barracuda_redundant_set2.result | 10 - ...onsistency_barracuda_redundant_set3.result | 10 - ...xtradb_compressed_columns_consistency.test | 290 ++++++++++++++++++ ...mns_consistency_antelope_compact_set1.test | 7 - ...mns_consistency_antelope_compact_set2.test | 7 - ...mns_consistency_antelope_compact_set3.test | 8 - ...s_consistency_antelope_redundant_set1.test | 7 - ...s_consistency_antelope_redundant_set2.test | 7 - ...s_consistency_antelope_redundant_set3.test | 8 - ...ns_consistency_barracuda_compact_set1.test | 7 - ...ns_consistency_barracuda_compact_set2.test | 7 - ...ns_consistency_barracuda_compact_set3.test | 8 - ...consistency_barracuda_compressed_set1.test | 7 - ...consistency_barracuda_compressed_set2.test | 7 - ...consistency_barracuda_compressed_set3.test | 8 - ...ns_consistency_barracuda_dynamic_set1.test | 7 - ...ns_consistency_barracuda_dynamic_set2.test | 7 - ...ns_consistency_barracuda_dynamic_set3.test | 8 - ..._consistency_barracuda_redundant_set1.test | 7 - ..._consistency_barracuda_redundant_set2.test | 7 - ..._consistency_barracuda_redundant_set3.test | 8 - 41 files changed, 533 insertions(+), 733 deletions(-) delete mode 100644 mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type.inc delete mode 100644 mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_set.inc delete mode 100644 mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc create mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set1.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set2.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set3.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set1.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set2.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set3.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set1.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set2.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set3.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set1.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set2.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set3.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set1.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set2.result delete mode 100644 mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set3.result create mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set1.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set2.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set3.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set1.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set2.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set3.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set1.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set2.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set3.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set1.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set2.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set3.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set1.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set2.test delete mode 100644 mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set3.test diff --git a/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type.inc b/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type.inc deleted file mode 100644 index 413da66145e6..000000000000 --- a/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type.inc +++ /dev/null @@ -1,136 +0,0 @@ -# the following variables must be defined: -# - $row_format - DYNAMIC | COMPRESSED | REDUNDANT | COMPACT -# - $compressed_attribute - COLUMN_FORMAT COMPRESSED | COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY | empty string -# - define either $full_field_type and $type_length_limit or $base_field_type and $field_length -# for instance, -# ($full_field_type = BLOB and $type_length_limit = 65535) means BLOB (with lax length 65535) -# or -# ($base_field_type = VARCHAR and $field_length = 128) means VARCHAR(128) - -if(!$full_field_type) -{ - --let $local_full_field_type= $base_field_type($field_length) $compressed_attribute - - # NATIONAL VARCHAR(N) where N >= 32766 is silently converted - # to TEXT - adjusting $local_type_length_limit correspondingly - if($base_field_type != 'NATIONAL VARCHAR') - { - --let $local_type_length_limit= $field_length - } - if($base_field_type == 'NATIONAL VARCHAR') - { - if($field_length >= 32766) - { - --let $local_type_length_limit= 65535 - } - if($field_length < 32766) - { - --let $local_type_length_limit= $field_length - } - } -} -if($full_field_type) -{ - --let $local_full_field_type= $full_field_type $compressed_attribute - --let $local_type_length_limit= $type_length_limit -} - ---disable_query_log - -SET @saved_max_allowed_packet = @@global.max_allowed_packet; -eval SET GLOBAL max_allowed_packet = GREATEST((($field_length + 1023) DIV 1024) * 1024, 1048576); - ---source include/count_sessions.inc ---connect (comp_con,localhost,root,,,,,COMPRESS) - -eval CREATE TABLE t1( - a $local_full_field_type -) ROW_FORMAT = $row_format ENGINE=InnoDB; - -if(!$full_field_type) -{ - --let $current_value_length= `SELECT IF($field_length > 3, $field_length - 3, 1)` - --let $max_value_length= `SELECT $field_length + 3` -} -if($full_field_type) -{ - --let $current_value_length= `SELECT IF($field_length > 0, $field_length, 1)` - --let $max_value_length= $field_length -} - ---let $number_of_selects = 1 -if($check_buffer_pool_evict) -{ - --let $number_of_selects = 2 -} - -INSERT INTO t1 VALUES(NULL); ---let $i = 0 -while($i < $number_of_selects) -{ - if($i == 1) - { - SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; - } - --let $include_silent= 1 - --let $assert_text= null value must match ($local_full_field_type, ROW_RORMAT = $row_format, length = $field_length) - --let $assert_cond= [SELECT COUNT(*) FROM t1 WHERE a IS NULL] = 1 - --source include/assert.inc - --let $include_silent= 0 - - --inc $i -} -DELETE FROM t1; - -INSERT INTO t1 VALUES(''); ---let $i = 0 -while($i < $number_of_selects) -{ - if($i == 1) - { - SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; - } - --let $include_silent= 1 - --let $assert_text= empty value must match ($local_full_field_type, ROW_RORMAT = $row_format, length = $field_length) - --let $assert_cond= [SELECT COUNT(*) FROM t1 WHERE a = ""] = 1 - --source include/assert.inc - --let $include_silent= 0 - - --inc $i -} -DELETE FROM t1; - -while($current_value_length <= $max_value_length) -{ - eval SET @inserted_value = REPEAT('z', $current_value_length); - --disable_warnings - INSERT INTO t1 VALUES(@inserted_value); - --enable_warnings - --let $i = 0 - while($i < $number_of_selects) - { - if($i == 1) - { - SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; - } - --let $include_silent= 1 - --let $assert_text= value of $current_value_length byte(s) must match ($local_full_field_type, ROW_RORMAT = $row_format, length = $field_length, current = $current_value_length) - --let $assert_cond= [SELECT COUNT(*) FROM t1 WHERE a = LEFT(@inserted_value, $local_type_length_limit)] = 1 - --source include/assert.inc - --let $include_silent= 0 - - --inc $i - } - DELETE FROM t1; - --inc $current_value_length -} - -DROP TABLE t1; - ---connection default ---disconnect comp_con ---source include/wait_until_count_sessions.inc - -SET GLOBAL max_allowed_packet = @saved_max_allowed_packet; - ---enable_query_log diff --git a/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_set.inc b/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_set.inc deleted file mode 100644 index 68011d895e03..000000000000 --- a/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_set.inc +++ /dev/null @@ -1,105 +0,0 @@ -# test for inserting and reading back strings of various lengths -# (2^N +/- 2 bytes) - ---let $field_length= 0 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc - ---let $field_length= 126 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 127 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 128 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 129 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 130 - ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 254 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 255 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 256 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 257 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 258 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc - ---let $field_length= 8190 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 8191 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 8192 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 8193 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 8194 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc - ---let $field_length= 16382 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 16383 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 16384 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 16385 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 16386 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc - ---let $field_length= 32766 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 32767 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 32768 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 32769 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc ---let $field_length= 32770 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc - -# this is the max size for VARCHAR columns ---let $field_length= 65532 ---source suite/innodb/include/xtradb_compressed_columns_check_type.inc - -# include checks for larger values only in case of BLOBs / TEXTs -if($full_field_type) -{ - --let $field_length= 65534 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 65535 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 65536 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 65537 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 65538 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - - --let $field_length= 16777214 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 16777215 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 16777216 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 16777217 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 16777218 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - - --let $field_length= 33554430 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 33554431 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 33554432 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 33554433 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc - --let $field_length= 33554434 - --source suite/innodb/include/xtradb_compressed_columns_check_type.inc -} diff --git a/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc b/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc deleted file mode 100644 index 285a41ad780c..000000000000 --- a/mysql-test/suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc +++ /dev/null @@ -1,108 +0,0 @@ -# set $file_format to either 'Barracuda' or 'Antelope' -# ('Barracuda' is required to use DYNAMIC and COMPRESSED row formats) -# set $compressed_attribute to either 'COLUMN_FORMAT COMPRESSED' or an empty string -# set $row_format to one of the following values: -# - DEFAULT (equivalent to COMPACT) -# - DYNAMIC (long fields stored externally) -# - FIXED (not supported, will be silently transformed into COMPACT) -# - COMPRESSED (row level compression) -# - REDUNDANT (old format) -# - COMPACT (default, primary format) -# set $datatype_set to one of the following values: -# - 1 (VARCHAR, NATIONAL VARCHAR, VARBINARY) -# - 2 (TINYBLOB, TINYTEXT, BLOB, TEXT) -# - 3 (MEDIUMBLOB, MEDIUMTEXT, LONGBLOB, LONGTEXT) - -# suppressing warnings caused by changing 'innodb-log-file-size' -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); - -# restarting server with bigger 'innodb-log-file-size' and 'max-allowed-packet' -# required for inserting long (~16MB) strings ---let $restart_parameters= restart:--innodb-log-file-size=192M ---source include/restart_mysqld.inc - -if($row_format == 'COMPRESSED') -{ - --let $check_buffer_pool_evict = `SELECT version() LIKE '%debug%'` -} - -# saving global variables -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; - -eval SET GLOBAL innodb_file_format = $file_format; - -# setting zip level to 0 means skipping compressing for all values -# (compressed column header will still be added) -SET GLOBAL innodb_compressed_columns_zip_level = 0; - -# test the following column types: -# - VARCHAR -# - NATIONAL VARCHAR -# - VARBINARY -# - TINYBLOB -# - TINYTEXT -# - BLOB -# - TEXT -# - MEDIUMBLOB -# - MEDIUMTEXT -# - LONGBLOB -# - LONGTEXT - -if($datatype_set == 1) -{ - --let $base_field_type= VARCHAR - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $base_field_type= NATIONAL VARCHAR - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $base_field_type= VARBINARY - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc -} - -if($datatype_set == 2) -{ - --let $type_length_limit= 255 - --let $full_field_type= TINYTEXT - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $full_field_type= TINYBLOB - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $type_length_limit= 65535 - --let $full_field_type= TEXT - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $full_field_type= BLOB - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc -} - -if($datatype_set == 3) -{ - --let $type_length_limit= 16777215 - --let $full_field_type= MEDIUMTEXT - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $full_field_type= MEDIUMBLOB - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $type_length_limit= 4294967295 - --let $full_field_type= LONGTEXT - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc - - --let $full_field_type= LONGBLOB - --source suite/innodb/include/xtradb_compressed_columns_check_type_set.inc -} - - -# restoring moddified global variables -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; - -# restarting the server with original options ---let $restart_parameters= ---source include/restart_mysqld.inc diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency.result new file mode 100644 index 000000000000..e9da6892e7a5 --- /dev/null +++ b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency.result @@ -0,0 +1,243 @@ +CREATE TABLE file_and_row_formats(file_format VARCHAR(20) NOT NULL, +row_format VARCHAR(40) NOT NULL); +INSERT INTO file_and_row_formats VALUES ('Antelope', 'COMPACT'); +INSERT INTO file_and_row_formats VALUES ('Antelope', 'REDUNDANT'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'DYNAMIC'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'REDUNDANT'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'COMPACT'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'COMPRESSED'); +CREATE TABLE data_types(type_name VARCHAR(40) NOT NULL PRIMARY KEY, +length_limit INT UNSIGNED DEFAULT NULL, +base_or_full ENUM ('base', 'full')); +INSERT INTO data_types VALUES ('VARCHAR', NULL, 'base'); +INSERT INTO data_types VALUES ('NATIONAL VARCHAR', NULL, 'base'); +INSERT INTO data_types VALUES ('VARBINARY', NULL, 'base'); +INSERT INTO data_types VALUES ('TINYTEXT', 255, 'full'); +INSERT INTO data_types VALUES ('TINYBLOB', 255, 'full'); +INSERT INTO data_types VALUES ('TEXT', 65535, 'full'); +INSERT INTO data_types VALUES ('BLOB', 65535, 'full'); +INSERT INTO data_types VALUES ('MEDIUMTEXT', 16777215, 'full'); +INSERT INTO data_types VALUES ('MEDIUMBLOB', 16777215, 'full'); +INSERT INTO data_types VALUES ('LONGTEXT', 4294967295, 'full'); +INSERT INTO data_types VALUES ('LONGBLOB', 4294967295, 'full'); +CREATE TABLE short_field_lengths(field_length INT UNSIGNED NOT NULL PRIMARY KEY); +INSERT INTO short_field_lengths VALUES (0),(1),(2); +INSERT INTO short_field_lengths VALUES (126),(127),(128),(129),(130); +INSERT INTO short_field_lengths VALUES (254),(255),(256),(257),(258); +INSERT INTO short_field_lengths VALUES (8190),(8191),(8192),(8193),(8194); +INSERT INTO short_field_lengths VALUES (16382),(16383),(16384),(16385),(16386); +INSERT INTO short_field_lengths VALUES (32766),(32767),(32768),(32769),(32770); +INSERT INTO short_field_lengths VALUES (65532); +CREATE TABLE full_field_lengths(field_length INT UNSIGNED NOT NULL PRIMARY KEY); +INSERT INTO full_field_lengths VALUES (65534),(65535),(65536),(65537),(65538); +INSERT INTO full_field_lengths VALUES (16777214),(16777215),(16777216),(16777217),(16777218); +INSERT INTO full_field_lengths VALUES (33554430),(33554431),(33554432),(33554433),(33554434); +SELECT MAX(field_length) INTO @max_field_length FROM full_field_lengths; +CREATE PROCEDURE diagnose_test_error(IN code CHAR(1), IN data_type VARCHAR(40), +IN length_limit INT UNSIGNED, +IN base_or_full ENUM ('base', 'full'), +IN field_length INT UNSIGNED, +IN local_type_length_limit INT UNSIGNED) +BEGIN +# message_text is VARCHAR(100), so we dump somewhat random set of vars depending on what +# was last debugged and instead of a proper location we only output a single-char location +# "code" + SET @test_error = CONCAT(code, ': data_type = ', data_type, ', length_limit = ', length_limit, +', base_or_full = ', base_or_full, ', field_length = ', field_length, +', actual limit = ', local_type_length_limit); +SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = @test_error; +END| +CREATE PROCEDURE test_null(IN code CHAR(1), IN data_type VARCHAR(40), +IN length_limit INT UNSIGNED, +IN base_or_full ENUM ('base', 'full'), +IN field_length INT UNSIGNED, +IN local_type_length_limit INT UNSIGNED) +BEGIN +DECLARE num_of_matches INT; +SELECT COUNT(*) INTO num_of_matches FROM t1 WHERE a IS NULL; +IF num_of_matches != 1 THEN +CALL diagnose_test_error(code, data_type, length_limit, +base_or_full, field_length, local_type_length_limit); +END IF; +END| +CREATE PROCEDURE test_empty_string(IN code CHAR(1), IN data_type VARCHAR(40), +IN length_limit INT UNSIGNED, +IN base_or_full ENUM ('base', 'full'), +IN field_length INT UNSIGNED, +IN local_type_length_limit INT UNSIGNED) +BEGIN +DECLARE num_of_matches INT; +SELECT COUNT(*) INTO num_of_matches FROM t1 WHERE a = ''; +IF num_of_matches != 1 THEN +CALL diagnose_test_error(code, data_type, length_limit, +base_or_full, field_length, local_type_length_limit); +END IF; +END| +CREATE PROCEDURE test_string_prefix(IN code CHAR(1), IN data_type VARCHAR(40), +IN length_limit INT UNSIGNED, +IN base_or_full ENUM ('base', 'full'), +IN field_length INT UNSIGNED, +IN local_type_length_limit INT UNSIGNED) +BEGIN +DECLARE num_of_matches INT; +SELECT COUNT(*) INTO num_of_matches FROM t1 WHERE a = LEFT(@inserted_value, local_type_length_limit); +IF num_of_matches != 1 THEN +CALL diagnose_test_error(code, data_type, length_limit, +base_or_full, field_length, local_type_length_limit); +END IF; +END| +CREATE PROCEDURE test_data_type_with_field_length(IN file_format VARCHAR(20), +IN row_format VARCHAR(40), +IN data_type VARCHAR(40), +IN length_limit INT UNSIGNED, +IN base_or_full ENUM ('base', 'full'), +IN field_length INT UNSIGNED) +BEGIN +DECLARE field_def VARCHAR(70); +DECLARE current_value_length INT UNSIGNED; +DECLARE max_value_length INT UNSIGNED; +DECLARE local_type_length_limit INT UNSIGNED; +DECLARE check_buffer_pool_evict INT DEFAULT 0; +IF row_format LIKE 'COMPRESSED' THEN +SELECT version() LIKE '%debug%' INTO check_buffer_pool_evict; +END IF; +IF check_buffer_pool_evict THEN +PREPARE evict_unzip_bp_stmt FROM "SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'"; +END IF; +IF base_or_full = 'base' THEN +SET field_def = CONCAT(data_type, '(', field_length, ') COLUMN_FORMAT COMPRESSED'); +# NATIONAL VARCHAR(N) where N >= 32766 is silently converted +# to TEXT - adjusting $local_type_length_limit correspondingly +IF data_type LIKE 'NATIONAL VARCHAR' THEN +IF field_length >= 32766 THEN +SET local_type_length_limit = 65535; +ELSE +SET local_type_length_limit = field_length; +END IF; +ELSE +SET local_type_length_limit = field_length; +END IF; +ELSE +SET field_def = CONCAT(data_type, ' COLUMN_FORMAT COMPRESSED'); +SET local_type_length_limit = length_limit; +END IF; +SET @set_file_format_query = CONCAT('SET GLOBAL innodb_file_format = ', file_format); +PREPARE set_file_format_stmt FROM @set_file_format_query; +EXECUTE set_file_format_stmt; +DEALLOCATE PREPARE set_file_format_stmt; +SET @create_table_query = CONCAT('CREATE TABLE t1(a ', field_def, ') ROW_FORMAT=', row_format, ' ENGINE=InnoDB'); +PREPARE create_table_stmt FROM @create_table_query; +EXECUTE create_table_stmt; +DEALLOCATE PREPARE create_table_stmt; +INSERT INTO t1 VALUES(NULL); +CALL test_null('1', data_type, length_limit, base_or_full, field_length, local_type_length_limit); +IF check_buffer_pool_evict THEN +EXECUTE evict_unzip_bp_stmt; +CALL test_null('2', data_type, length_limit, base_or_full, field_length, local_type_length_limit); +END IF; +DELETE FROM t1; +INSERT INTO t1 VALUES(''); +CALL test_empty_string('3', data_type, length_limit, base_or_full, field_length, local_type_length_limit); +IF check_buffer_pool_evict THEN +EXECUTE evict_unzip_bp_stmt; +CALL test_empty_string('4', data_type, length_limit, base_or_full, field_length, local_type_length_limit); +END IF; +DELETE FROM t1; +IF base_or_full = 'base' THEN +SET current_value_length = IF(field_length > 3, field_length - 3, 1); +SET max_value_length = field_length + 3; +ELSE +SET current_value_length = IF(field_length > 0, field_length, 1); +SET max_value_length = field_length; +END IF; +WHILE (current_value_length <= max_value_length) DO +SET @inserted_value = REPEAT('z', current_value_length); +INSERT INTO t1 VALUES(@inserted_value); +CALL test_string_prefix('5', data_type, length_limit, base_or_full, field_length, local_type_length_limit); +IF check_buffer_pool_evict THEN +EXECUTE evict_unzip_bp_stmt; +CALL test_string_prefix('6', data_type, length_limit, base_or_full, field_length, local_type_length_limit); +END IF; +DELETE FROM t1; +SET current_value_length = current_value_length + 1; +END WHILE; +IF check_buffer_pool_evict THEN +DEALLOCATE PREPARE evict_unzip_bp_stmt; +END IF; +DROP TABLE t1; +END| +CREATE PROCEDURE test_data_type(IN file_format VARCHAR(20), IN row_format VARCHAR(40), +IN data_type VARCHAR(40), IN length_limit INT UNSIGNED, +IN base_or_full ENUM ('base', 'full')) +BEGIN +DECLARE done INT DEFAULT FALSE; +DECLARE data_field_length INT UNSIGNED; +DECLARE field_lengths_cur CURSOR FOR SELECT field_length FROM field_lengths; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; +CREATE TEMPORARY TABLE field_lengths SELECT * FROM short_field_lengths; +IF base_or_full = 'full' THEN +INSERT INTO field_lengths SELECT * FROM full_field_lengths; +END IF; +OPEN field_lengths_cur; +field_lengths_loop: LOOP +FETCH field_lengths_cur INTO data_field_length; +IF done THEN +LEAVE field_lengths_loop; +END IF; +CALL test_data_type_with_field_length(file_format, row_format, data_type, +length_limit, base_or_full, +data_field_length); +END LOOP; +CLOSE field_lengths_cur; +DROP TEMPORARY TABLE field_lengths; +END| +CREATE PROCEDURE test_data_types(IN file_format VARCHAR(20), IN row_format VARCHAR(40)) +BEGIN +DECLARE done INT DEFAULT FALSE; +DECLARE data_type VARCHAR(40); +DECLARE type_length_limit INT UNSIGNED; +DECLARE type_base_or_full ENUM('base', 'full'); +DECLARE data_type_cur CURSOR FOR SELECT type_name, length_limit, base_or_full FROM data_types; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; +OPEN data_type_cur; +data_type_loop: LOOP +FETCH data_type_cur INTO data_type, type_length_limit, type_base_or_full; +IF done THEN +LEAVE data_type_loop; +END IF; +CALL test_data_type(file_format, row_format, data_type, type_length_limit, type_base_or_full); +END LOOP; +CLOSE data_type_cur; +END| +CREATE PROCEDURE test_file_and_row_formats() +BEGIN +DECLARE done int DEFAULT FALSE; +DECLARE innodb_row_format VARCHAR(40); +DECLARE innodb_file_format VARCHAR(20); +DECLARE row_format_cur CURSOR FOR SELECT file_format, row_format FROM file_and_row_formats; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; +OPEN row_format_cur; +row_format_loop: LOOP +FETCH row_format_cur INTO innodb_file_format, innodb_row_format; +IF done THEN +LEAVE row_format_loop; +END IF; +CALL test_data_types(innodb_file_format, innodb_row_format); +END LOOP; +CLOSE row_format_cur; +END| +SET @saved_innodb_file_format = @@GLOBAL.innodb_file_format; +SET @saved_max_allowed_packet = @@GLOBAL.max_allowed_packet; +SET GLOBAL max_allowed_packet = GREATEST(((@max_field_length + 1023) DIV 1024) * 1024, 1048576); +CALL test_file_and_row_formats; +SET GLOBAL max_allowed_packet = @saved_max_allowed_packet; +SET GLOBAL innodb_file_format = @saved_innodb_file_format; +DROP PROCEDURE test_file_and_row_formats; +DROP PROCEDURE test_data_types; +DROP PROCEDURE test_data_type; +DROP PROCEDURE test_data_type_with_field_length; +DROP PROCEDURE test_string_prefix; +DROP PROCEDURE test_empty_string; +DROP PROCEDURE test_null; +DROP PROCEDURE diagnose_test_error; +DROP TABLE data_types, short_field_lengths, full_field_lengths, file_and_row_formats; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set1.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set1.result deleted file mode 100644 index 3b0e6ab3fbb1..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set1.result +++ /dev/null @@ -1,22 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Antelope; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set2.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set2.result deleted file mode 100644 index 31ccc1f42131..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set2.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Antelope; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set3.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set3.result deleted file mode 100644 index 31ccc1f42131..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_compact_set3.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Antelope; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set1.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set1.result deleted file mode 100644 index 3b0e6ab3fbb1..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set1.result +++ /dev/null @@ -1,22 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Antelope; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set2.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set2.result deleted file mode 100644 index 31ccc1f42131..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set2.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Antelope; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set3.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set3.result deleted file mode 100644 index 31ccc1f42131..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_antelope_redundant_set3.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Antelope; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set1.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set1.result deleted file mode 100644 index 7261a4a07570..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set1.result +++ /dev/null @@ -1,22 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set2.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set2.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set2.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set3.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set3.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compact_set3.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set1.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set1.result deleted file mode 100644 index 7261a4a07570..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set1.result +++ /dev/null @@ -1,22 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set2.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set2.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set2.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set3.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set3.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_compressed_set3.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.result deleted file mode 100644 index 7261a4a07570..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.result +++ /dev/null @@ -1,22 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set1.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set1.result deleted file mode 100644 index 7261a4a07570..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set1.result +++ /dev/null @@ -1,22 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -Warnings: -Note 1246 Converting column 'a' from VARCHAR to TEXT -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set2.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set2.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set2.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set3.result b/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set3.result deleted file mode 100644 index 457868f54f1b..000000000000 --- a/mysql-test/suite/innodb/r/xtradb_compressed_columns_consistency_barracuda_redundant_set3.result +++ /dev/null @@ -1,10 +0,0 @@ -call mtr.add_suppression("InnoDB: Resizing redo log"); -call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files"); -call mtr.add_suppression("InnoDB: New log files created"); -call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles"); -SET @saved_innodb_file_format = @@global.innodb_file_format; -SET @saved_innodb_compressed_columns_zip_level = @@global.innodb_compressed_columns_zip_level; -SET GLOBAL innodb_file_format = Barracuda; -SET GLOBAL innodb_compressed_columns_zip_level = 0; -SET GLOBAL innodb_file_format = @saved_innodb_file_format; -SET GLOBAL innodb_compressed_columns_zip_level = @saved_innodb_compressed_columns_zip_level; diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency.test new file mode 100644 index 000000000000..dc7c841b0807 --- /dev/null +++ b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency.test @@ -0,0 +1,290 @@ +--source include/have_innodb.inc + +CREATE TABLE file_and_row_formats(file_format VARCHAR(20) NOT NULL, + row_format VARCHAR(40) NOT NULL); +INSERT INTO file_and_row_formats VALUES ('Antelope', 'COMPACT'); +INSERT INTO file_and_row_formats VALUES ('Antelope', 'REDUNDANT'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'DYNAMIC'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'REDUNDANT'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'COMPACT'); +INSERT INTO file_and_row_formats VALUES ('Barracuda', 'COMPRESSED'); + +CREATE TABLE data_types(type_name VARCHAR(40) NOT NULL PRIMARY KEY, + length_limit INT UNSIGNED DEFAULT NULL, + base_or_full ENUM ('base', 'full')); + +INSERT INTO data_types VALUES ('VARCHAR', NULL, 'base'); +INSERT INTO data_types VALUES ('NATIONAL VARCHAR', NULL, 'base'); +INSERT INTO data_types VALUES ('VARBINARY', NULL, 'base'); +INSERT INTO data_types VALUES ('TINYTEXT', 255, 'full'); +INSERT INTO data_types VALUES ('TINYBLOB', 255, 'full'); +INSERT INTO data_types VALUES ('TEXT', 65535, 'full'); +INSERT INTO data_types VALUES ('BLOB', 65535, 'full'); +INSERT INTO data_types VALUES ('MEDIUMTEXT', 16777215, 'full'); +INSERT INTO data_types VALUES ('MEDIUMBLOB', 16777215, 'full'); +INSERT INTO data_types VALUES ('LONGTEXT', 4294967295, 'full'); +INSERT INTO data_types VALUES ('LONGBLOB', 4294967295, 'full'); + +CREATE TABLE short_field_lengths(field_length INT UNSIGNED NOT NULL PRIMARY KEY); +INSERT INTO short_field_lengths VALUES (0),(1),(2); +INSERT INTO short_field_lengths VALUES (126),(127),(128),(129),(130); +INSERT INTO short_field_lengths VALUES (254),(255),(256),(257),(258); +INSERT INTO short_field_lengths VALUES (8190),(8191),(8192),(8193),(8194); +INSERT INTO short_field_lengths VALUES (16382),(16383),(16384),(16385),(16386); +INSERT INTO short_field_lengths VALUES (32766),(32767),(32768),(32769),(32770); +INSERT INTO short_field_lengths VALUES (65532); + +CREATE TABLE full_field_lengths(field_length INT UNSIGNED NOT NULL PRIMARY KEY); +INSERT INTO full_field_lengths VALUES (65534),(65535),(65536),(65537),(65538); +INSERT INTO full_field_lengths VALUES (16777214),(16777215),(16777216),(16777217),(16777218); +INSERT INTO full_field_lengths VALUES (33554430),(33554431),(33554432),(33554433),(33554434); + +SELECT MAX(field_length) INTO @max_field_length FROM full_field_lengths; + +delimiter |; +CREATE PROCEDURE diagnose_test_error(IN code CHAR(1), IN data_type VARCHAR(40), + IN length_limit INT UNSIGNED, + IN base_or_full ENUM ('base', 'full'), + IN field_length INT UNSIGNED, + IN local_type_length_limit INT UNSIGNED) +BEGIN + # message_text is VARCHAR(100), so we dump somewhat random set of vars depending on what + # was last debugged and instead of a proper location we only output a single-char location + # "code" + SET @test_error = CONCAT(code, ': data_type = ', data_type, ', length_limit = ', length_limit, + ', base_or_full = ', base_or_full, ', field_length = ', field_length, + ', actual limit = ', local_type_length_limit); + SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = @test_error; +END| + +CREATE PROCEDURE test_null(IN code CHAR(1), IN data_type VARCHAR(40), + IN length_limit INT UNSIGNED, + IN base_or_full ENUM ('base', 'full'), + IN field_length INT UNSIGNED, + IN local_type_length_limit INT UNSIGNED) +BEGIN + DECLARE num_of_matches INT; + SELECT COUNT(*) INTO num_of_matches FROM t1 WHERE a IS NULL; + IF num_of_matches != 1 THEN + CALL diagnose_test_error(code, data_type, length_limit, + base_or_full, field_length, local_type_length_limit); + END IF; +END| + +CREATE PROCEDURE test_empty_string(IN code CHAR(1), IN data_type VARCHAR(40), + IN length_limit INT UNSIGNED, + IN base_or_full ENUM ('base', 'full'), + IN field_length INT UNSIGNED, + IN local_type_length_limit INT UNSIGNED) +BEGIN + DECLARE num_of_matches INT; + SELECT COUNT(*) INTO num_of_matches FROM t1 WHERE a = ''; + IF num_of_matches != 1 THEN + CALL diagnose_test_error(code, data_type, length_limit, + base_or_full, field_length, local_type_length_limit); + END IF; +END| + +CREATE PROCEDURE test_string_prefix(IN code CHAR(1), IN data_type VARCHAR(40), + IN length_limit INT UNSIGNED, + IN base_or_full ENUM ('base', 'full'), + IN field_length INT UNSIGNED, + IN local_type_length_limit INT UNSIGNED) +BEGIN + DECLARE num_of_matches INT; + SELECT COUNT(*) INTO num_of_matches FROM t1 WHERE a = LEFT(@inserted_value, local_type_length_limit); + IF num_of_matches != 1 THEN + CALL diagnose_test_error(code, data_type, length_limit, + base_or_full, field_length, local_type_length_limit); + END IF; +END| + +CREATE PROCEDURE test_data_type_with_field_length(IN file_format VARCHAR(20), + IN row_format VARCHAR(40), + IN data_type VARCHAR(40), + IN length_limit INT UNSIGNED, + IN base_or_full ENUM ('base', 'full'), + IN field_length INT UNSIGNED) +BEGIN + DECLARE field_def VARCHAR(70); + DECLARE current_value_length INT UNSIGNED; + DECLARE max_value_length INT UNSIGNED; + DECLARE local_type_length_limit INT UNSIGNED; + DECLARE check_buffer_pool_evict INT DEFAULT 0; + + IF row_format LIKE 'COMPRESSED' THEN + SELECT version() LIKE '%debug%' INTO check_buffer_pool_evict; + END IF; + + IF check_buffer_pool_evict THEN + PREPARE evict_unzip_bp_stmt FROM "SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'"; + END IF; + + IF base_or_full = 'base' THEN + SET field_def = CONCAT(data_type, '(', field_length, ') COLUMN_FORMAT COMPRESSED'); + # NATIONAL VARCHAR(N) where N >= 32766 is silently converted + # to TEXT - adjusting $local_type_length_limit correspondingly + IF data_type LIKE 'NATIONAL VARCHAR' THEN + IF field_length >= 32766 THEN + SET local_type_length_limit = 65535; + ELSE + SET local_type_length_limit = field_length; + END IF; + ELSE + SET local_type_length_limit = field_length; + END IF; + ELSE + SET field_def = CONCAT(data_type, ' COLUMN_FORMAT COMPRESSED'); + SET local_type_length_limit = length_limit; + END IF; + + SET @set_file_format_query = CONCAT('SET GLOBAL innodb_file_format = ', file_format); + PREPARE set_file_format_stmt FROM @set_file_format_query; + EXECUTE set_file_format_stmt; + DEALLOCATE PREPARE set_file_format_stmt; + + SET @create_table_query = CONCAT('CREATE TABLE t1(a ', field_def, ') ROW_FORMAT=', row_format, ' ENGINE=InnoDB'); + PREPARE create_table_stmt FROM @create_table_query; + EXECUTE create_table_stmt; + DEALLOCATE PREPARE create_table_stmt; + + INSERT INTO t1 VALUES(NULL); + CALL test_null('1', data_type, length_limit, base_or_full, field_length, local_type_length_limit); + IF check_buffer_pool_evict THEN + EXECUTE evict_unzip_bp_stmt; + CALL test_null('2', data_type, length_limit, base_or_full, field_length, local_type_length_limit); + END IF; + DELETE FROM t1; + + INSERT INTO t1 VALUES(''); + CALL test_empty_string('3', data_type, length_limit, base_or_full, field_length, local_type_length_limit); + IF check_buffer_pool_evict THEN + EXECUTE evict_unzip_bp_stmt; + CALL test_empty_string('4', data_type, length_limit, base_or_full, field_length, local_type_length_limit); + END IF; + DELETE FROM t1; + + IF base_or_full = 'base' THEN + SET current_value_length = IF(field_length > 3, field_length - 3, 1); + SET max_value_length = field_length + 3; + ELSE + SET current_value_length = IF(field_length > 0, field_length, 1); + SET max_value_length = field_length; + END IF; + + WHILE (current_value_length <= max_value_length) DO + SET @inserted_value = REPEAT('z', current_value_length); + INSERT INTO t1 VALUES(@inserted_value); + CALL test_string_prefix('5', data_type, length_limit, base_or_full, field_length, local_type_length_limit); + IF check_buffer_pool_evict THEN + EXECUTE evict_unzip_bp_stmt; + CALL test_string_prefix('6', data_type, length_limit, base_or_full, field_length, local_type_length_limit); + END IF; + DELETE FROM t1; + SET current_value_length = current_value_length + 1; + END WHILE; + + IF check_buffer_pool_evict THEN + DEALLOCATE PREPARE evict_unzip_bp_stmt; + END IF; + + DROP TABLE t1; +END| + +CREATE PROCEDURE test_data_type(IN file_format VARCHAR(20), IN row_format VARCHAR(40), + IN data_type VARCHAR(40), IN length_limit INT UNSIGNED, + IN base_or_full ENUM ('base', 'full')) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE data_field_length INT UNSIGNED; + DECLARE field_lengths_cur CURSOR FOR SELECT field_length FROM field_lengths; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + CREATE TEMPORARY TABLE field_lengths SELECT * FROM short_field_lengths; + IF base_or_full = 'full' THEN + INSERT INTO field_lengths SELECT * FROM full_field_lengths; + END IF; + + OPEN field_lengths_cur; + field_lengths_loop: LOOP + FETCH field_lengths_cur INTO data_field_length; + IF done THEN + LEAVE field_lengths_loop; + END IF; + CALL test_data_type_with_field_length(file_format, row_format, data_type, + length_limit, base_or_full, + data_field_length); + END LOOP; + CLOSE field_lengths_cur; + + DROP TEMPORARY TABLE field_lengths; +END| + +CREATE PROCEDURE test_data_types(IN file_format VARCHAR(20), IN row_format VARCHAR(40)) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE data_type VARCHAR(40); + DECLARE type_length_limit INT UNSIGNED; + DECLARE type_base_or_full ENUM('base', 'full'); + DECLARE data_type_cur CURSOR FOR SELECT type_name, length_limit, base_or_full FROM data_types; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + OPEN data_type_cur; + data_type_loop: LOOP + FETCH data_type_cur INTO data_type, type_length_limit, type_base_or_full; + IF done THEN + LEAVE data_type_loop; + END IF; + CALL test_data_type(file_format, row_format, data_type, type_length_limit, type_base_or_full); + END LOOP; + CLOSE data_type_cur; +END| + +CREATE PROCEDURE test_file_and_row_formats() +BEGIN + DECLARE done int DEFAULT FALSE; + DECLARE innodb_row_format VARCHAR(40); + DECLARE innodb_file_format VARCHAR(20); + DECLARE row_format_cur CURSOR FOR SELECT file_format, row_format FROM file_and_row_formats; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + OPEN row_format_cur; + row_format_loop: LOOP + FETCH row_format_cur INTO innodb_file_format, innodb_row_format; + IF done THEN + LEAVE row_format_loop; + END IF; + CALL test_data_types(innodb_file_format, innodb_row_format); + END LOOP; + CLOSE row_format_cur; +END| + +delimiter ;| + +SET @saved_innodb_file_format = @@GLOBAL.innodb_file_format; +SET @saved_max_allowed_packet = @@GLOBAL.max_allowed_packet; +SET GLOBAL max_allowed_packet = GREATEST(((@max_field_length + 1023) DIV 1024) * 1024, 1048576); + +--source include/count_sessions.inc + +--connect (con1,localhost,root) + +CALL test_file_and_row_formats; + +--disconnect con1 +--connection default + +SET GLOBAL max_allowed_packet = @saved_max_allowed_packet; +SET GLOBAL innodb_file_format = @saved_innodb_file_format; + +DROP PROCEDURE test_file_and_row_formats; +DROP PROCEDURE test_data_types; +DROP PROCEDURE test_data_type; +DROP PROCEDURE test_data_type_with_field_length; +DROP PROCEDURE test_string_prefix; +DROP PROCEDURE test_empty_string; +DROP PROCEDURE test_null; +DROP PROCEDURE diagnose_test_error; +DROP TABLE data_types, short_field_lengths, full_field_lengths, file_and_row_formats; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set1.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set1.test deleted file mode 100644 index 38e5e7810ebd..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set1.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Antelope ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPACT ---let $datatype_set= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set2.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set2.test deleted file mode 100644 index c7402690b1da..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set2.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Antelope ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPACT ---let $datatype_set= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set3.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set3.test deleted file mode 100644 index c4183f1b8dd1..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_compact_set3.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/big_test.inc ---source include/have_innodb.inc - ---let $file_format= Antelope ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPACT ---let $datatype_set= 3 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set1.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set1.test deleted file mode 100644 index 5515741ada9a..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set1.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Antelope ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= REDUNDANT ---let $datatype_set= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set2.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set2.test deleted file mode 100644 index 65fa043bd74c..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set2.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Antelope ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= REDUNDANT ---let $datatype_set= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set3.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set3.test deleted file mode 100644 index 60b4a8f41c8c..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_antelope_redundant_set3.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/big_test.inc ---source include/have_innodb.inc - ---let $file_format= Antelope ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= REDUNDANT ---let $datatype_set= 3 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set1.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set1.test deleted file mode 100644 index 177f429080ac..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set1.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPACT ---let $datatype_set= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set2.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set2.test deleted file mode 100644 index b27ae87493c0..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set2.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPACT ---let $datatype_set= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set3.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set3.test deleted file mode 100644 index ba4e94e185a7..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compact_set3.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/big_test.inc ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPACT ---let $datatype_set= 3 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set1.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set1.test deleted file mode 100644 index 5ddc830ff05b..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set1.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPRESSED ---let $datatype_set= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set2.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set2.test deleted file mode 100644 index b2db91aca627..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set2.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPRESSED ---let $datatype_set= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set3.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set3.test deleted file mode 100644 index 9ed00882d1d0..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_compressed_set3.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/big_test.inc ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= COMPRESSED ---let $datatype_set= 3 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.test deleted file mode 100644 index 85723c23d0a2..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set1.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= DYNAMIC ---let $datatype_set= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.test deleted file mode 100644 index d9a13f1f7150..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set2.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= DYNAMIC ---let $datatype_set= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.test deleted file mode 100644 index efe617793deb..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_dynamic_set3.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/big_test.inc ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= DYNAMIC ---let $datatype_set= 3 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set1.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set1.test deleted file mode 100644 index 5c0fde50d175..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set1.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= REDUNDANT ---let $datatype_set= 1 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set2.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set2.test deleted file mode 100644 index a1022325f9a7..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set2.test +++ /dev/null @@ -1,7 +0,0 @@ ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= REDUNDANT ---let $datatype_set= 2 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc diff --git a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set3.test b/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set3.test deleted file mode 100644 index f5a8c9fa2556..000000000000 --- a/mysql-test/suite/innodb/t/xtradb_compressed_columns_consistency_barracuda_redundant_set3.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/big_test.inc ---source include/have_innodb.inc - ---let $file_format= Barracuda ---let $compressed_attribute= COLUMN_FORMAT COMPRESSED ---let $row_format= REDUNDANT ---let $datatype_set= 3 ---source suite/innodb/include/xtradb_compressed_columns_check_type_superset.inc From b776632456afa668cb6dac0c2eb49cc2813d67de Mon Sep 17 00:00:00 2001 From: Sergei Glushchenko Date: Thu, 10 Jan 2019 01:10:31 +0700 Subject: [PATCH 159/214] PS-4640: FTS query with limit and mecab in file fts0que.cc line 3560 Upstream commit 2cd0ebf97e1 introduced the fix for FTS query result cache overflow issue. It has couple of issues, for example, it only counts docs added from fts_query_filter_doc_ids, while docs can also be added from fts_query_search_phrase. This problem was partly mitigated by commit 48e07ec3935, but not fully resolved. This patch reverts 48e07ec3935 and applies the patch attached to upstream bug 87518. --- storage/innobase/fts/fts0ast.cc | 6 +++--- storage/innobase/fts/fts0que.cc | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/storage/innobase/fts/fts0ast.cc b/storage/innobase/fts/fts0ast.cc index a68eb22a8005..e3ae89265d00 100644 --- a/storage/innobase/fts/fts0ast.cc +++ b/storage/innobase/fts/fts0ast.cc @@ -549,8 +549,7 @@ fts_ast_node_check_union( fts_ast_node_t* node) { if (node->type == FTS_AST_LIST - || node->type == FTS_AST_SUBEXP_LIST - || node->type == FTS_AST_PARSER_PHRASE_LIST) { + || node->type == FTS_AST_SUBEXP_LIST) { for (node = node->list.head; node; node = node->next) { if (!fts_ast_node_check_union(node)) { @@ -563,7 +562,8 @@ fts_ast_node_check_union( || node->oper == FTS_EXIST)) { return(false); - } else if (node->type == FTS_AST_TEXT) { + } else if (node->type == FTS_AST_TEXT + || node->type == FTS_AST_PARSER_PHRASE_LIST) { /* Distance or phrase search query. */ return(false); } diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index 2f5fb93a4600..7fafcf6a63b3 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -746,6 +746,10 @@ fts_query_union_doc_id( query->total_size += SIZEOF_RBT_NODE_ADD + sizeof(fts_ranking_t) + RANKING_WORDS_INIT_LEN; + + if (query->limit != ULONG_UNDEFINED) { + query->n_docs++; + } } } @@ -3345,7 +3349,7 @@ fts_query_filter_doc_ids( } if (query->limit != ULONG_UNDEFINED - && query->limit <= ++query->n_docs) { + && query->n_docs >= query->limit) { goto func_exit; } } @@ -3357,7 +3361,6 @@ fts_query_filter_doc_ids( if (query->total_size > fts_result_cache_limit) { return(DB_FTS_EXCEED_RESULT_CACHE_LIMIT); } else { - query->n_docs = 0; return(DB_SUCCESS); } } @@ -3955,6 +3958,10 @@ fts_query_can_optimize( return; } + if (query->limit != ULONG_UNDEFINED) { + return; + } + /* Check if it has only a term without oper */ ut_ad(node->type == FTS_AST_LIST); node = node->list.head; From b70db6c8b8b1605f9ae77e49f18bfb79f4596149 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Thu, 10 Jan 2019 18:08:03 +0200 Subject: [PATCH 160/214] ENG-53: Set correct path in installation procedure --- doc/source/installation/apt_repo.rst | 8 ++++---- doc/source/installation/yum_repo.rst | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/source/installation/apt_repo.rst b/doc/source/installation/apt_repo.rst index 86c582f288de..b681836f9b8f 100644 --- a/doc/source/installation/apt_repo.rst +++ b/doc/source/installation/apt_repo.rst @@ -53,13 +53,13 @@ Installing |Percona Server| from Percona ``apt`` repository .. code-block:: bash - wget https://repo.percona.com/apt/percona-release_0.1-6.$(lsb_release -sc)_all.deb + $ wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb 2. Install the downloaded package with :program:`dpkg`. To do that, run the following commands as root or with :program:`sudo`: .. code-block:: bash - dpkg -i percona-release_0.1-6.$(lsb_release -sc)_all.deb + $ sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb Once you install this package the Percona repositories should be added. You can check the repository setup in the :file:`/etc/apt/sources.list.d/percona-release.list` file. @@ -67,13 +67,13 @@ Installing |Percona Server| from Percona ``apt`` repository .. code-block:: bash - $ sudo apt-get update + $ sudo apt-get update 4. After that you can install the server package: .. code-block:: bash - $ sudo apt-get install percona-server-server-5.6 + $ sudo apt-get install percona-server-server-5.6 Percona ``apt`` Testing repository diff --git a/doc/source/installation/yum_repo.rst b/doc/source/installation/yum_repo.rst index 9c70020fe3eb..006040350fcb 100644 --- a/doc/source/installation/yum_repo.rst +++ b/doc/source/installation/yum_repo.rst @@ -51,13 +51,13 @@ Installing |Percona Server| from Percona ``yum`` repository .. code-block:: bash - yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm + yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm You should see some output such as the following: .. code-block:: bash - Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm + Retrieving https://repo.percona.com/yum/percona-release-latest.noarch.rpm Preparing... ########################################### [100%] 1:percona-release ########################################### [100%] @@ -66,10 +66,9 @@ Installing |Percona Server| from Percona ``yum`` repository *RHEL*/*Centos* 5 doesn't support installing the packages directly from the remote location so you'll need to download the package first and install it manually with :program:`rpm`: .. code-block:: bash - - wget http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm - rpm -ivH percona-release-0.1-6.noarch.rpm - + + wget https://repo.percona.com/yum/percona-release-latest.noarch.rpm + rpm -ivH percona-release-latest.noarch.rpm 2. Testing the repository From a5d6a11d5d3427be9feeee809206298ef744134f Mon Sep 17 00:00:00 2001 From: Yoshinori Matsunobu Date: Mon, 23 Jul 2018 08:19:02 -0700 Subject: [PATCH 161/214] Introducing a dedicated thread for handling manual compactions in MyRocks Upstream commit ID : fb-mysql-5.6.35/566b7f095eb1d62a6379c33c911f36d7434898e7 PS-5217 : Merge fb-prod201803 Summary: SET GLOBAL rocksdb_compact_cf='cf_name' is a command to trigger a manual compaction. Manual compaction may take a long time, depending on target column family size. Prior to this diff, when running manual compaction with SET GLOBAL, clean mysqld shutdown was blocked until the manual compaction finished. This was because shutdown path had no way to terminate a user thread calling CompactRange. This diff changes how to handle manual compactions. Changes are as follows. - Introducing a dedicated MyRocks thread to handle manual compactions (via SET GLOBAL rocksdb_compact_cf). Inside RocksDB, only one manual compaction can be running at a time so concurrency does not change. - Adding a system variable (rocksdb_max_manual_compactions), a debug system variable, and a session variable (rocksdb_manual_compaction_threads), and a few status variables to track manual compaction progress. With this diff, normal shutdown no longer waits for manual compaction to finish. Also, you can change the number of manual compaction threads based on each compaction. For example, you can increase compaction threads to 16 for large CFs, and uses 1 thread for small CFs. A user thread calling SET GLOBAL rocksdb_compact_cf checks the manual compaction thread activities, as well as its own thd state. If its manual compaction finishes, or its own thd is killed, the user thread proceeds. As a result, mysqld normal shutdown is no longer blocked by long running manual compactions. Manual compaction thread does not persist any state. This diff does not change OPTIMIZE TABLE behavior. It will be covered by future diffs. Reviewed By: lth Differential Revision: D8874346 fbshipit-source-id: 396f787ff78 Percona Server: - Fixed issue with debug delay variable where code depended on specific expected behavior of my_sleep w.r.t. shutdown is different in PS 5.7. - Moved testing into its own eplicit test file and fixed test to use proper mtr idioms. - Slightly touched up commit comment formatting. --- ...debug_manual_compaction_delay_basic.result | 46 +++ ...sdb_manual_compaction_threads_basic.result | 93 ++++++ ...ocksdb_max_manual_compactions_basic.result | 57 ++++ ...b_debug_manual_compaction_delay_basic.test | 16 + ...cksdb_manual_compaction_threads_basic.test | 17 + .../rocksdb_max_manual_compactions_basic.test | 17 + .../r-native-partitioning/rocksdb.result | 11 +- .../r/non_blocking_manual_compaction.result | 18 ++ mysql-test/suite/rocksdb/r/rocksdb.result | 9 + .../non_blocking_manual_compaction-master.opt | 2 + .../t/non_blocking_manual_compaction.test | 48 +++ storage/rocksdb/ha_rocksdb.cc | 294 ++++++++++++++++-- storage/rocksdb/ha_rocksdb.h | 5 + storage/rocksdb/rdb_psi.cc | 15 +- storage/rocksdb/rdb_psi.h | 10 +- storage/rocksdb/rdb_threads.h | 27 ++ 16 files changed, 648 insertions(+), 37 deletions(-) create mode 100644 mysql-test/suite/rocksdb.sys_vars/r/rocksdb_debug_manual_compaction_delay_basic.result create mode 100644 mysql-test/suite/rocksdb.sys_vars/r/rocksdb_manual_compaction_threads_basic.result create mode 100644 mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manual_compactions_basic.result create mode 100644 mysql-test/suite/rocksdb.sys_vars/t/rocksdb_debug_manual_compaction_delay_basic.test create mode 100644 mysql-test/suite/rocksdb.sys_vars/t/rocksdb_manual_compaction_threads_basic.test create mode 100644 mysql-test/suite/rocksdb.sys_vars/t/rocksdb_max_manual_compactions_basic.test create mode 100644 mysql-test/suite/rocksdb/r/non_blocking_manual_compaction.result create mode 100644 mysql-test/suite/rocksdb/t/non_blocking_manual_compaction-master.opt create mode 100644 mysql-test/suite/rocksdb/t/non_blocking_manual_compaction.test diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_debug_manual_compaction_delay_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_debug_manual_compaction_delay_basic.result new file mode 100644 index 000000000000..6c5db01533bf --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_debug_manual_compaction_delay_basic.result @@ -0,0 +1,46 @@ +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(2400); +INSERT INTO valid_values VALUES(100000); +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); +SET @start_global_value = @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +SELECT @start_global_value; +@start_global_value +0 +'# Setting to valid values in global scope#' +"Trying to set variable @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY to 2400" +SET @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = 2400; +SELECT @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +@@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +2400 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = DEFAULT; +SELECT @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +@@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +0 +"Trying to set variable @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY to 100000" +SET @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = 100000; +SELECT @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +@@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +100000 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = DEFAULT; +SELECT @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +@@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +0 +"Trying to set variable @@session.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY to 444. It should fail because it is not session." +SET @@session.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = 444; +ERROR HY000: Variable 'rocksdb_debug_manual_compaction_delay' is a GLOBAL variable and should be set with SET GLOBAL +'# Testing with invalid values in global scope #' +"Trying to set variable @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY to 'aaa'" +SET @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = 'aaa'; +Got one of the listed errors +SELECT @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +@@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +0 +SET @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY = @start_global_value; +SELECT @@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY; +@@global.ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +0 +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_manual_compaction_threads_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_manual_compaction_threads_basic.result new file mode 100644 index 000000000000..3d599e1768ed --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_manual_compaction_threads_basic.result @@ -0,0 +1,93 @@ +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(0); +INSERT INTO valid_values VALUES(1); +INSERT INTO valid_values VALUES(99); +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); +SET @start_global_value = @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +SELECT @start_global_value; +@start_global_value +0 +SET @start_session_value = @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +SELECT @start_session_value; +@start_session_value +0 +'# Setting to valid values in global scope#' +"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_THREADS to 0" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = 0; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = DEFAULT; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_THREADS to 1" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = 1; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +1 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = DEFAULT; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_THREADS to 99" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = 99; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +99 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = DEFAULT; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +'# Setting to valid values in session scope#' +"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_THREADS to 0" +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = 0; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +"Setting the session scope variable back to default" +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = DEFAULT; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_THREADS to 1" +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = 1; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +1 +"Setting the session scope variable back to default" +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = DEFAULT; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +"Trying to set variable @@session.ROCKSDB_MANUAL_COMPACTION_THREADS to 99" +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = 99; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +99 +"Setting the session scope variable back to default" +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = DEFAULT; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +'# Testing with invalid values in global scope #' +"Trying to set variable @@global.ROCKSDB_MANUAL_COMPACTION_THREADS to 'aaa'" +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = 'aaa'; +Got one of the listed errors +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +SET @@global.ROCKSDB_MANUAL_COMPACTION_THREADS = @start_global_value; +SELECT @@global.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@global.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +SET @@session.ROCKSDB_MANUAL_COMPACTION_THREADS = @start_session_value; +SELECT @@session.ROCKSDB_MANUAL_COMPACTION_THREADS; +@@session.ROCKSDB_MANUAL_COMPACTION_THREADS +0 +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manual_compactions_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manual_compactions_basic.result new file mode 100644 index 000000000000..815506ccac8c --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_max_manual_compactions_basic.result @@ -0,0 +1,57 @@ +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(1); +INSERT INTO valid_values VALUES(1024); +INSERT INTO valid_values VALUES(512*1024*1024); +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); +SET @start_global_value = @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +SELECT @start_global_value; +@start_global_value +10 +'# Setting to valid values in global scope#' +"Trying to set variable @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS to 1" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = 1; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +1 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = DEFAULT; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +10 +"Trying to set variable @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS to 1024" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = 1024; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +1024 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = DEFAULT; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +10 +"Trying to set variable @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS to 536870912" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = 536870912; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +536870912 +"Setting the global scope variable back to default" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = DEFAULT; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +10 +"Trying to set variable @@session.ROCKSDB_MAX_MANUAL_COMPACTIONS to 444. It should fail because it is not session." +SET @@session.ROCKSDB_MAX_MANUAL_COMPACTIONS = 444; +ERROR HY000: Variable 'rocksdb_max_manual_compactions' is a GLOBAL variable and should be set with SET GLOBAL +'# Testing with invalid values in global scope #' +"Trying to set variable @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS to 'aaa'" +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = 'aaa'; +Got one of the listed errors +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +10 +SET @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS = @start_global_value; +SELECT @@global.ROCKSDB_MAX_MANUAL_COMPACTIONS; +@@global.ROCKSDB_MAX_MANUAL_COMPACTIONS +10 +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_debug_manual_compaction_delay_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_debug_manual_compaction_delay_basic.test new file mode 100644 index 000000000000..518c284c0cf8 --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_debug_manual_compaction_delay_basic.test @@ -0,0 +1,16 @@ +--source include/have_rocksdb.inc + +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(2400); +INSERT INTO valid_values VALUES(100000); + +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); + +--let $sys_var=ROCKSDB_DEBUG_MANUAL_COMPACTION_DELAY +--let $read_only=0 +--let $session=0 +--source ../include/rocksdb_sys_var.inc + +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_manual_compaction_threads_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_manual_compaction_threads_basic.test new file mode 100644 index 000000000000..4f166a9ca8ed --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_manual_compaction_threads_basic.test @@ -0,0 +1,17 @@ +--source include/have_rocksdb.inc + +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(0); +INSERT INTO valid_values VALUES(1); +INSERT INTO valid_values VALUES(99); + +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); + +--let $sys_var=ROCKSDB_MANUAL_COMPACTION_THREADS +--let $read_only=0 +--let $session=1 +--source ../include/rocksdb_sys_var.inc + +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_max_manual_compactions_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_max_manual_compactions_basic.test new file mode 100644 index 000000000000..1c66316858b8 --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_max_manual_compactions_basic.test @@ -0,0 +1,17 @@ +--source include/have_rocksdb.inc + +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(1); +INSERT INTO valid_values VALUES(1024); +INSERT INTO valid_values VALUES(512*1024*1024); + +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); + +--let $sys_var=ROCKSDB_MAX_MANUAL_COMPACTIONS +--let $read_only=0 +--let $session=0 +--source ../include/rocksdb_sys_var.inc + +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result b/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result index ecbd1b3095f6..560b72ef016a 100644 --- a/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result +++ b/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result @@ -920,6 +920,7 @@ rocksdb_datadir ./.rocksdb rocksdb_db_write_buffer_size 0 rocksdb_deadlock_detect OFF rocksdb_deadlock_detect_depth 50 +rocksdb_debug_manual_compaction_delay 0 rocksdb_debug_optimizer_no_zero_cardinality ON rocksdb_debug_ttl_ignore_pk OFF rocksdb_debug_ttl_read_filter_ts 0 @@ -953,11 +954,13 @@ rocksdb_lock_scanned_rows OFF rocksdb_lock_wait_timeout 1 rocksdb_log_file_time_to_roll 0 rocksdb_manifest_preallocation_size 4194304 +rocksdb_manual_compaction_threads 0 rocksdb_manual_wal_flush ON rocksdb_max_background_jobs 2 rocksdb_max_latest_deadlocks 5 rocksdb_max_log_file_size 0 -rocksdb_max_manifest_file_size 18446744073709551615 +rocksdb_max_manifest_file_size 1073741824 +rocksdb_max_manual_compactions 10 rocksdb_max_row_locks 1048576 rocksdb_max_subcompactions 1 rocksdb_max_total_wal_size 0 @@ -1560,6 +1563,8 @@ rocksdb_get_hit_l1 # rocksdb_get_hit_l2_and_up # rocksdb_get_updates_since_calls # rocksdb_iter_bytes_read # +rocksdb_manual_compactions_processed # +rocksdb_manual_compactions_running # rocksdb_memtable_hit # rocksdb_memtable_miss # rocksdb_no_file_closes # @@ -1668,6 +1673,8 @@ rocksdb_get_hit_l1 rocksdb_get_hit_l2_and_up rocksdb_get_updates_since_calls rocksdb_iter_bytes_read +rocksdb_manual_compactions_processed +rocksdb_manual_compactions_running rocksdb_memtable_hit rocksdb_memtable_miss rocksdb_no_file_closes @@ -1778,6 +1785,8 @@ rocksdb_get_hit_l1 rocksdb_get_hit_l2_and_up rocksdb_get_updates_since_calls rocksdb_iter_bytes_read +rocksdb_manual_compactions_processed +rocksdb_manual_compactions_running rocksdb_memtable_hit rocksdb_memtable_miss rocksdb_no_file_closes diff --git a/mysql-test/suite/rocksdb/r/non_blocking_manual_compaction.result b/mysql-test/suite/rocksdb/r/non_blocking_manual_compaction.result new file mode 100644 index 000000000000..00392a13606d --- /dev/null +++ b/mysql-test/suite/rocksdb/r/non_blocking_manual_compaction.result @@ -0,0 +1,18 @@ +CREATE TABLE t1 ( +a int not null, +b int not null, +primary key (a,b) comment 'cf1', +key (b) comment 'rev:cf2' +) ENGINE=ROCKSDB; +DELETE FROM t1; +SET GLOBAL rocksdb_max_manual_compactions = 2; +SET GLOBAL rocksdb_debug_manual_compaction_delay = 3600; +SET GLOBAL rocksdb_compact_cf='cf1'; +SET GLOBAL rocksdb_compact_cf='rev:cf2'; +Timeout in wait_condition.inc for select variable_value > 1 from performance_schema.global_status where variable_name='rocksdb_manual_compactions_running' +SET GLOBAL rocksdb_compact_cf='cf1'; +ERROR HY000: Internal error: Can't schedule more manual compactions. Increase rocksdb_max_manual_compactions or stop issuing more manual compactions. +SET GLOBAL rocksdb_compact_cf='rev:cf2'; +ERROR HY000: Internal error: Can't schedule more manual compactions. Increase rocksdb_max_manual_compactions or stop issuing more manual compactions. +DROP TABLE t1; +# restart diff --git a/mysql-test/suite/rocksdb/r/rocksdb.result b/mysql-test/suite/rocksdb/r/rocksdb.result index fddc959ca4fc..8d95f6061d35 100644 --- a/mysql-test/suite/rocksdb/r/rocksdb.result +++ b/mysql-test/suite/rocksdb/r/rocksdb.result @@ -922,6 +922,7 @@ rocksdb_datadir ./.rocksdb rocksdb_db_write_buffer_size 0 rocksdb_deadlock_detect OFF rocksdb_deadlock_detect_depth 50 +rocksdb_debug_manual_compaction_delay 0 rocksdb_debug_optimizer_no_zero_cardinality ON rocksdb_debug_ttl_ignore_pk OFF rocksdb_debug_ttl_read_filter_ts 0 @@ -955,11 +956,13 @@ rocksdb_lock_scanned_rows OFF rocksdb_lock_wait_timeout 1 rocksdb_log_file_time_to_roll 0 rocksdb_manifest_preallocation_size 4194304 +rocksdb_manual_compaction_threads 0 rocksdb_manual_wal_flush ON rocksdb_max_background_jobs 2 rocksdb_max_latest_deadlocks 5 rocksdb_max_log_file_size 0 rocksdb_max_manifest_file_size 1073741824 +rocksdb_max_manual_compactions 10 rocksdb_max_row_locks 1048576 rocksdb_max_subcompactions 1 rocksdb_max_total_wal_size 0 @@ -1562,6 +1565,8 @@ rocksdb_get_hit_l1 # rocksdb_get_hit_l2_and_up # rocksdb_get_updates_since_calls # rocksdb_iter_bytes_read # +rocksdb_manual_compactions_processed # +rocksdb_manual_compactions_running # rocksdb_memtable_hit # rocksdb_memtable_miss # rocksdb_no_file_closes # @@ -1670,6 +1675,8 @@ rocksdb_get_hit_l1 rocksdb_get_hit_l2_and_up rocksdb_get_updates_since_calls rocksdb_iter_bytes_read +rocksdb_manual_compactions_processed +rocksdb_manual_compactions_running rocksdb_memtable_hit rocksdb_memtable_miss rocksdb_no_file_closes @@ -1780,6 +1787,8 @@ rocksdb_get_hit_l1 rocksdb_get_hit_l2_and_up rocksdb_get_updates_since_calls rocksdb_iter_bytes_read +rocksdb_manual_compactions_processed +rocksdb_manual_compactions_running rocksdb_memtable_hit rocksdb_memtable_miss rocksdb_no_file_closes diff --git a/mysql-test/suite/rocksdb/t/non_blocking_manual_compaction-master.opt b/mysql-test/suite/rocksdb/t/non_blocking_manual_compaction-master.opt new file mode 100644 index 000000000000..3016407cd346 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/non_blocking_manual_compaction-master.opt @@ -0,0 +1,2 @@ +--loose-rocksdb_max_subcompactions=1 +--loose-rocksdb_default_cf_options=write_buffer_size=512k;target_file_size_base=512k;level0_file_num_compaction_trigger=2;level0_slowdown_writes_trigger=-1;level0_stop_writes_trigger=1000;max_bytes_for_level_base=1m diff --git a/mysql-test/suite/rocksdb/t/non_blocking_manual_compaction.test b/mysql-test/suite/rocksdb/t/non_blocking_manual_compaction.test new file mode 100644 index 000000000000..35420e1e75f3 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/non_blocking_manual_compaction.test @@ -0,0 +1,48 @@ +--source include/have_rocksdb.inc +--source include/count_sessions.inc + +CREATE TABLE t1 ( + a int not null, + b int not null, + primary key (a,b) comment 'cf1', + key (b) comment 'rev:cf2' +) ENGINE=ROCKSDB; + +# Populate tables +let $max = 1000; +let $table = t1; +--source suite/rocksdb/include/drop_table_repopulate_table.inc + +# Run manual compaction, then restarting mysqld +# and confirming it is not blocked. +SET GLOBAL rocksdb_max_manual_compactions = 2; +SET GLOBAL rocksdb_debug_manual_compaction_delay = 3600; +connect (con1, localhost, root,,); +connect (con2, localhost, root,,); +connect (con3, localhost, root,,); +connection con1; +send SET GLOBAL rocksdb_compact_cf='cf1'; +connection con2; +send SET GLOBAL rocksdb_compact_cf='rev:cf2'; +connection default; +let $wait_condition = select count(*) = 2 from information_schema.processlist where info like 'SET GLOBAL rocksdb_compact_cf%'; +--source include/wait_condition.inc + +let $wait_condition = select variable_value > 1 from performance_schema.global_status where variable_name='rocksdb_manual_compactions_running'; +--source include/wait_condition.inc + +connection con3; +--error ER_INTERNAL_ERROR +SET GLOBAL rocksdb_compact_cf='cf1'; +--error ER_INTERNAL_ERROR +SET GLOBAL rocksdb_compact_cf='rev:cf2'; + +connection default; +disconnect con1; +disconnect con2; +disconnect con3; + +DROP TABLE t1; + +--source include/restart_mysqld.inc +--source include/wait_until_count_sessions.inc diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 918a705b2675..83d48b1bc1e3 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -123,11 +123,15 @@ static handler *rocksdb_create_handler(my_core::handlerton *hton, my_core::TABLE_SHARE *table_arg, my_core::MEM_ROOT *mem_root); -static rocksdb::CompactRangeOptions getCompactRangeOptions() { +static rocksdb::CompactRangeOptions +getCompactRangeOptions(int concurrency = 0) { rocksdb::CompactRangeOptions compact_range_options; compact_range_options.bottommost_level_compaction = rocksdb::BottommostLevelCompaction::kForce; compact_range_options.exclusive_manual_compaction = false; + if (concurrency > 0) { + compact_range_options.max_subcompactions = concurrency; + } return compact_range_options; } @@ -162,6 +166,8 @@ Rdb_hton_init_state hton_init_state; static Rdb_background_thread rdb_bg_thread; +static Rdb_manual_compaction_thread rdb_mc_thread; + // List of table names (using regex) that are exceptions to the strict // collation check requirement. Regex *rdb_collation_exceptions; @@ -175,30 +181,6 @@ static void rocksdb_flush_all_memtables() { } } -static void rocksdb_compact_column_family_stub( - THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr, - const void *const save) {} - -static int rocksdb_compact_column_family(THD *const thd, - struct st_mysql_sys_var *const var, - void *const var_ptr, - struct st_mysql_value *const value) { - char buff[STRING_BUFFER_USUAL_SIZE]; - int len = sizeof(buff); - - DBUG_ASSERT(value != nullptr); - - if (const char *const cf = value->val_str(value, buff, &len)) { - auto cfh = cf_manager.get_cf(cf); - if (cfh != nullptr && rdb != nullptr) { - sql_print_information("RocksDB: Manual compaction of column family: %s\n", - cf); - rdb->CompactRange(getCompactRangeOptions(), cfh, nullptr, nullptr); - } - } - return HA_EXIT_SUCCESS; -} - /////////////////////////////////////////////////////////// // Hash map: table name => open table handler /////////////////////////////////////////////////////////// @@ -310,7 +292,7 @@ static int rocksdb_force_flush_memtable_and_lzero_now( DBUG_ASSERT(metadata.levels[0].level == 0); std::vector file_names; - for (auto &file : metadata.levels[0].files) { + for (const auto &file : metadata.levels[0].files) { file_names.emplace_back(file.db_path + file.name); } @@ -504,11 +486,15 @@ static uint64_t rocksdb_write_policy = static my_bool rocksdb_error_on_suboptimal_collation = FALSE; static uint32_t rocksdb_stats_recalc_rate = 0; static my_bool rocksdb_no_create_column_family = FALSE; +static uint32_t rocksdb_debug_manual_compaction_delay = 0; +static uint32_t rocksdb_max_manual_compactions = 0; std::atomic rocksdb_row_lock_deadlocks(0); std::atomic rocksdb_row_lock_wait_timeouts(0); std::atomic rocksdb_snapshot_conflict_errors(0); std::atomic rocksdb_wal_group_syncs(0); +std::atomic rocksdb_manual_compactions_processed(0); +std::atomic rocksdb_manual_compactions_running(0); static std::unique_ptr rdb_init_rocksdb_db_options(void) { auto o = std::unique_ptr(new rocksdb::DBOptions()); @@ -614,6 +600,14 @@ static int rocksdb_validate_flush_log_at_trx_commit( *static_cast(var_ptr) = static_cast(new_value); return HA_EXIT_SUCCESS; } +static void rocksdb_compact_column_family_stub( + THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr, + const void *const save) {} + +static int rocksdb_compact_column_family(THD *const thd, + struct st_mysql_sys_var *const var, + void *const var_ptr, + struct st_mysql_value *const value); static const char *index_type_names[] = {"kBinarySearch", "kHashSearch", NullS}; @@ -754,6 +748,12 @@ static MYSQL_THDVAR_ULONGLONG( /* min (0ms) */ RDB_MIN_MERGE_TMP_FILE_REMOVAL_DELAY, /* max */ SIZE_T_MAX, 1); +static MYSQL_THDVAR_INT( + manual_compaction_threads, PLUGIN_VAR_RQCMDARG, + "How many rocksdb threads to run for manual compactions", nullptr, nullptr, + /* default rocksdb.dboption max_subcompactions */ 0, + /* min */ 0, /* max */ 128, 0); + static MYSQL_SYSVAR_BOOL( create_if_missing, *reinterpret_cast(&rocksdb_db_options->create_if_missing), @@ -1361,6 +1361,18 @@ static MYSQL_SYSVAR_BOOL( "on PK TTL data. This variable is a no-op in non-debug builds.", nullptr, nullptr, false); +static MYSQL_SYSVAR_UINT( + max_manual_compactions, rocksdb_max_manual_compactions, PLUGIN_VAR_RQCMDARG, + "Maximum number of pending + ongoing number of manual compactions.", + nullptr, nullptr, /* default */ 10, /* min */ 0, /* max */ UINT_MAX, 0); + +static MYSQL_SYSVAR_UINT( + debug_manual_compaction_delay, rocksdb_debug_manual_compaction_delay, + PLUGIN_VAR_RQCMDARG, + "For debugging purposes only. Sleeping specified seconds " + "for simulating long running compactions.", + nullptr, nullptr, 0, /* min */ 0, /* max */ UINT_MAX, 0); + static MYSQL_SYSVAR_BOOL( reset_stats, rocksdb_reset_stats, PLUGIN_VAR_RQCMDARG, "Reset the RocksDB internal statistics without restarting the DB.", nullptr, @@ -1685,6 +1697,9 @@ static struct st_mysql_sys_var *rocksdb_system_variables[] = { MYSQL_SYSVAR(error_on_suboptimal_collation), MYSQL_SYSVAR(no_create_column_family), MYSQL_SYSVAR(stats_recalc_rate), + MYSQL_SYSVAR(debug_manual_compaction_delay), + MYSQL_SYSVAR(max_manual_compactions), + MYSQL_SYSVAR(manual_compaction_threads), nullptr}; static rocksdb::WriteOptions @@ -1699,6 +1714,50 @@ rdb_get_rocksdb_write_options(my_core::THD *const thd) { return opt; } +static int rocksdb_compact_column_family(THD *const thd, + struct st_mysql_sys_var *const var, + void *const var_ptr, + struct st_mysql_value *const value) { + char buff[STRING_BUFFER_USUAL_SIZE]; + int len = sizeof(buff); + + DBUG_ASSERT(value != nullptr); + + if (const char *const cf = value->val_str(value, buff, &len)) { + auto cfh = cf_manager.get_cf(cf); + if (cfh != nullptr && rdb != nullptr) { + int mc_id = rdb_mc_thread.request_manual_compaction( + cfh, nullptr, nullptr, THDVAR(thd, manual_compaction_threads)); + if (mc_id == -1) { + my_error(ER_INTERNAL_ERROR, MYF(0), + "Can't schedule more manual compactions. " + "Increase rocksdb_max_manual_compactions or stop issuing " + "more manual compactions."); + return HA_EXIT_FAILURE; + } else if (mc_id < 0) { + return HA_EXIT_FAILURE; + } + // NO_LINT_DEBUG + sql_print_information("RocksDB: Manual compaction of column family: %s\n", + cf); + // Checking thd state every short cycle (100ms). This is for allowing to + // exiting this function without waiting for CompactRange to finish. + do { + my_sleep(100000); + } while (!thd->killed && + !rdb_mc_thread.is_manual_compaction_finished(mc_id)); + + if (thd->killed) { + // This cancels if requested compaction state is INITED. + // TODO(yoshinorim): Cancel running compaction as well once + // it is supported in RocksDB. + rdb_mc_thread.clear_manual_compaction_request(mc_id, true); + } + } + } + return HA_EXIT_SUCCESS; +} + /* Drop index thread's control */ @@ -3915,9 +3974,11 @@ static int rocksdb_init_func(void *const p) { rdb_bg_thread.init(rdb_signal_bg_psi_mutex_key, rdb_signal_bg_psi_cond_key); rdb_drop_idx_thread.init(rdb_signal_drop_idx_psi_mutex_key, rdb_signal_drop_idx_psi_cond_key); + rdb_mc_thread.init(rdb_signal_mc_psi_mutex_key, rdb_signal_mc_psi_cond_key); #else rdb_bg_thread.init(); rdb_drop_idx_thread.init(); + rdb_mc_thread.init(); #endif mysql_mutex_init(rdb_collation_data_mutex_key, &rdb_collation_data_mutex, MY_MUTEX_INIT_FAST); @@ -4284,6 +4345,20 @@ static int rocksdb_init_func(void *const p) { DBUG_RETURN(HA_EXIT_FAILURE); } + err = rdb_mc_thread.create_thread(MANUAL_COMPACTION_THREAD_NAME +#ifdef HAVE_PSI_INTERFACE + , + rdb_mc_psi_thread_key +#endif + ); + if (err != 0) { + // NO_LINT_DEBUG + sql_print_error( + "RocksDB: Couldn't start the manual compaction thread: (errno=%d)", + err); + DBUG_RETURN(HA_EXIT_FAILURE); + } + rdb_set_collation_exception_list(rocksdb_strict_collation_exceptions); if (rocksdb_pause_background_work) { @@ -4357,6 +4432,16 @@ static int rocksdb_done_func(void *const p) { sql_print_error("RocksDB: Couldn't stop the index thread: (errno=%d)", err); } + // signal the manual compaction thread to stop + rdb_mc_thread.signal(true); + // Wait for the manual compaction thread to finish. + err = rdb_mc_thread.join(); + if (err != 0) { + // NO_LINT_DEBUG + sql_print_error( + "RocksDB: Couldn't stop the manual compaction thread: (errno=%d)", err); + } + if (rdb_open_tables.m_hash.size()) { // Looks like we are getting unloaded and yet we have some open tables // left behind. @@ -12061,6 +12146,10 @@ static SHOW_VAR rocksdb_status_vars[] = { &rocksdb_snapshot_conflict_errors, SHOW_LONGLONG), DEF_STATUS_VAR_PTR("wal_group_syncs", &rocksdb_wal_group_syncs, SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("manual_compactions_processed", + &rocksdb_manual_compactions_processed, SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("manual_compactions_running", + &rocksdb_manual_compactions_running, SHOW_LONGLONG), DEF_STATUS_VAR_PTR("number_sst_entry_put", &rocksdb_num_sst_entry_put, SHOW_LONGLONG), DEF_STATUS_VAR_PTR("number_sst_entry_delete", &rocksdb_num_sst_entry_delete, @@ -12181,6 +12270,159 @@ void Rdb_background_thread::run() { ddl_manager.persist_stats(); } +/* + A background thread to handle manual compactions, + except for dropping indexes/tables. Every second, it checks + pending manual compactions, and it calls CompactRange if there is. +*/ +void Rdb_manual_compaction_thread::run() { + mysql_mutex_init(0, &m_mc_mutex, MY_MUTEX_INIT_FAST); + RDB_MUTEX_LOCK_CHECK(m_signal_mutex); + for (;;) { + if (m_stop) { + break; + } + timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; + + const auto ret MY_ATTRIBUTE((__unused__)) = + mysql_cond_timedwait(&m_signal_cond, &m_signal_mutex, &ts); + if (m_stop) { + break; + } + // make sure, no program error is returned + DBUG_ASSERT(ret == 0 || ret == ETIMEDOUT); + RDB_MUTEX_UNLOCK_CHECK(m_signal_mutex); + + RDB_MUTEX_LOCK_CHECK(m_mc_mutex); + // Grab the first item and proceed, if not empty. + if (m_requests.empty()) { + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); + RDB_MUTEX_LOCK_CHECK(m_signal_mutex); + continue; + } + Manual_compaction_request &mcr = m_requests.begin()->second; + DBUG_ASSERT(mcr.cf != nullptr); + DBUG_ASSERT(mcr.state == Manual_compaction_request::INITED); + mcr.state = Manual_compaction_request::RUNNING; + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); + + DBUG_ASSERT(mcr.state == Manual_compaction_request::RUNNING); + // NO_LINT_DEBUG + sql_print_information("Manual Compaction id %d cf %s started.", mcr.mc_id, + mcr.cf->GetName().c_str()); + rocksdb_manual_compactions_running++; + if (rocksdb_debug_manual_compaction_delay > 0) { + // In Facebook MySQL 5.6.35, my_sleep breaks the sleep when the server + // gets a shutdown signal and this code depended on that behavior. + // In 5.7, for whatever reason, this is not the case. my_sleep will + // continue to sleep until the sleep time has elapsed. For the purpose + // of this variable and the accompanying test case, we need to break this + // down into a loop that sleeps and checks to see if the thread was + // signalled with the stop flag. It is ugly, but without having DBUG_SYNC + // available in background threads, it is good enough for the test. + for (uint32_t sleeps = 0; sleeps < rocksdb_debug_manual_compaction_delay; + sleeps++) { + RDB_MUTEX_LOCK_CHECK(m_signal_mutex); + const bool local_stop = m_stop; + RDB_MUTEX_UNLOCK_CHECK(m_signal_mutex); + if (local_stop) + break; + my_sleep(1000000); + } + } + // CompactRange may take a very long time. On clean shutdown, + // it is cancelled by CancelAllBackgroundWork, then status is + // set to shutdownInProgress. + const rocksdb::Status s = rdb->CompactRange( + getCompactRangeOptions(mcr.concurrency), mcr.cf, mcr.start, mcr.limit); + rocksdb_manual_compactions_running--; + if (s.ok()) { + // NO_LINT_DEBUG + sql_print_information("Manual Compaction id %d cf %s ended.", mcr.mc_id, + mcr.cf->GetName().c_str()); + } else { + // NO_LINT_DEBUG + sql_print_information("Manual Compaction id %d cf %s aborted. %s", + mcr.mc_id, mcr.cf->GetName().c_str(), s.getState()); + if (!s.IsShutdownInProgress()) { + rdb_handle_io_error(s, RDB_IO_ERROR_BG_THREAD); + } else { + DBUG_ASSERT(m_requests.size() == 1); + } + } + rocksdb_manual_compactions_processed++; + clear_manual_compaction_request(mcr.mc_id, false); + RDB_MUTEX_LOCK_CHECK(m_signal_mutex); + } + clear_all_manual_compaction_requests(); + DBUG_ASSERT(m_requests.empty()); + RDB_MUTEX_UNLOCK_CHECK(m_signal_mutex); + mysql_mutex_destroy(&m_mc_mutex); +} + +void Rdb_manual_compaction_thread::clear_all_manual_compaction_requests() { + RDB_MUTEX_LOCK_CHECK(m_mc_mutex); + m_requests.clear(); + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); +} + +void Rdb_manual_compaction_thread::clear_manual_compaction_request( + int mc_id, bool init_only) { + bool erase = true; + RDB_MUTEX_LOCK_CHECK(m_mc_mutex); + auto it = m_requests.find(mc_id); + if (it != m_requests.end()) { + if (init_only) { + Manual_compaction_request mcr = it->second; + if (mcr.state != Manual_compaction_request::INITED) { + erase = false; + } + } + if (erase) { + m_requests.erase(it); + } + } else { + // Current code path guarantees that erasing by the same mc_id happens + // at most once. INITED state may be erased by a thread that requested + // the compaction. RUNNING state is erased by mc thread only. + DBUG_ASSERT(0); + } + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); +} + +int Rdb_manual_compaction_thread::request_manual_compaction( + rocksdb::ColumnFamilyHandle *cf, rocksdb::Slice *start, + rocksdb::Slice *limit, int concurrency) { + int mc_id = -1; + RDB_MUTEX_LOCK_CHECK(m_mc_mutex); + if (m_requests.size() >= rocksdb_max_manual_compactions) { + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); + return mc_id; + } + Manual_compaction_request mcr; + mc_id = mcr.mc_id = ++m_latest_mc_id; + mcr.state = Manual_compaction_request::INITED; + mcr.cf = cf; + mcr.start = start; + mcr.limit = limit; + mcr.concurrency = concurrency; + m_requests.insert(std::make_pair(mcr.mc_id, mcr)); + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); + return mc_id; +} + +bool Rdb_manual_compaction_thread::is_manual_compaction_finished(int mc_id) { + bool finished = false; + RDB_MUTEX_LOCK_CHECK(m_mc_mutex); + if (m_requests.count(mc_id) == 0) { + finished = true; + } + RDB_MUTEX_UNLOCK_CHECK(m_mc_mutex); + return finished; +} + bool ha_rocksdb::check_bloom_and_set_bounds( THD *thd, const Rdb_key_def &kd, const rocksdb::Slice &eq_cond, const bool use_all_keys, size_t bound_len, uchar *const lower_bound, diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 332c97446800..765a7a95a917 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -150,6 +150,11 @@ const char *const BG_THREAD_NAME = "myrocks-bg"; */ const char *const INDEX_THREAD_NAME = "myrocks-index"; +/* + Name for the manual compaction thread. +*/ +static const char constexpr MANUAL_COMPACTION_THREAD_NAME[] = "myrocks-mc"; + /* Separator between partition name and the qualifier. Sample usage: diff --git a/storage/rocksdb/rdb_psi.cc b/storage/rocksdb/rdb_psi.cc index 4cfdec920fb1..4239d2688ba6 100644 --- a/storage/rocksdb/rdb_psi.cc +++ b/storage/rocksdb/rdb_psi.cc @@ -35,22 +35,25 @@ my_core::PSI_stage_info stage_waiting_on_row_lock = {0, "Waiting for row lock", my_core::PSI_stage_info *all_rocksdb_stages[] = {&stage_waiting_on_row_lock}; my_core::PSI_thread_key rdb_background_psi_thread_key, - rdb_drop_idx_psi_thread_key; + rdb_drop_idx_psi_thread_key, rdb_mc_psi_thread_key; my_core::PSI_thread_info all_rocksdb_threads[] = { {&rdb_background_psi_thread_key, "background", PSI_FLAG_GLOBAL}, {&rdb_drop_idx_psi_thread_key, "drop index", PSI_FLAG_GLOBAL}, + {&rdb_mc_psi_thread_key, "manual compaction", PSI_FLAG_GLOBAL}, }; my_core::PSI_mutex_key rdb_psi_open_tbls_mutex_key, rdb_signal_bg_psi_mutex_key, - rdb_signal_drop_idx_psi_mutex_key, rdb_collation_data_mutex_key, - rdb_mem_cmp_space_mutex_key, key_mutex_tx_list, rdb_sysvars_psi_mutex_key, - rdb_cfm_mutex_key, rdb_sst_commit_key, rdb_block_cache_resize_mutex_key; + rdb_signal_drop_idx_psi_mutex_key, rdb_signal_mc_psi_mutex_key, + rdb_collation_data_mutex_key, rdb_mem_cmp_space_mutex_key, + key_mutex_tx_list, rdb_sysvars_psi_mutex_key, rdb_cfm_mutex_key, + rdb_sst_commit_key, rdb_block_cache_resize_mutex_key; my_core::PSI_mutex_info all_rocksdb_mutexes[] = { {&rdb_psi_open_tbls_mutex_key, "open tables", PSI_FLAG_GLOBAL}, {&rdb_signal_bg_psi_mutex_key, "stop background", PSI_FLAG_GLOBAL}, {&rdb_signal_drop_idx_psi_mutex_key, "signal drop index", PSI_FLAG_GLOBAL}, + {&rdb_signal_mc_psi_mutex_key, "signal manual compaction", PSI_FLAG_GLOBAL}, {&rdb_collation_data_mutex_key, "collation data init", PSI_FLAG_GLOBAL}, {&rdb_mem_cmp_space_mutex_key, "collation space char data init", PSI_FLAG_GLOBAL}, @@ -74,12 +77,14 @@ my_core::PSI_rwlock_info all_rocksdb_rwlocks[] = { }; my_core::PSI_cond_key rdb_signal_bg_psi_cond_key, - rdb_signal_drop_idx_psi_cond_key; + rdb_signal_drop_idx_psi_cond_key, rdb_signal_mc_psi_cond_key; my_core::PSI_cond_info all_rocksdb_conds[] = { {&rdb_signal_bg_psi_cond_key, "cond signal background", PSI_FLAG_GLOBAL}, {&rdb_signal_drop_idx_psi_cond_key, "cond signal drop index", PSI_FLAG_GLOBAL}, + {&rdb_signal_mc_psi_cond_key, "cond signal manual compaction", + PSI_FLAG_GLOBAL}, }; my_core::PSI_memory_key rdb_datadic_memory_key, rdb_open_tables_memory_key, diff --git a/storage/rocksdb/rdb_psi.h b/storage/rocksdb/rdb_psi.h index 691068ae27df..9b2407d1dbe4 100644 --- a/storage/rocksdb/rdb_psi.h +++ b/storage/rocksdb/rdb_psi.h @@ -37,19 +37,19 @@ extern my_core::PSI_stage_info stage_waiting_on_row_lock; #ifdef HAVE_PSI_INTERFACE extern my_core::PSI_thread_key rdb_background_psi_thread_key, - rdb_drop_idx_psi_thread_key; + rdb_drop_idx_psi_thread_key, rdb_mc_psi_thread_key; extern my_core::PSI_mutex_key rdb_psi_open_tbls_mutex_key, rdb_signal_bg_psi_mutex_key, rdb_signal_drop_idx_psi_mutex_key, - rdb_collation_data_mutex_key, rdb_mem_cmp_space_mutex_key, - key_mutex_tx_list, rdb_sysvars_psi_mutex_key, rdb_cfm_mutex_key, - rdb_sst_commit_key, rdb_block_cache_resize_mutex_key; + rdb_signal_mc_psi_mutex_key, rdb_collation_data_mutex_key, + rdb_mem_cmp_space_mutex_key, key_mutex_tx_list, rdb_sysvars_psi_mutex_key, + rdb_cfm_mutex_key, rdb_sst_commit_key, rdb_block_cache_resize_mutex_key; extern my_core::PSI_rwlock_key key_rwlock_collation_exception_list, key_rwlock_read_free_rpl_tables, key_rwlock_skip_unique_check_tables; extern my_core::PSI_cond_key rdb_signal_bg_psi_cond_key, - rdb_signal_drop_idx_psi_cond_key; + rdb_signal_drop_idx_psi_cond_key, rdb_signal_mc_psi_cond_key; extern my_core::PSI_memory_key rdb_datadic_memory_key, rdb_open_tables_memory_key, rdb_handler_memory_key; diff --git a/storage/rocksdb/rdb_threads.h b/storage/rocksdb/rdb_threads.h index eb1eae1ec0b5..297b274d0596 100644 --- a/storage/rocksdb/rdb_threads.h +++ b/storage/rocksdb/rdb_threads.h @@ -18,6 +18,7 @@ /* C++ standard header files */ #include +#include #include /* MySQL includes */ @@ -28,6 +29,7 @@ /* MyRocks header files */ #include "./rdb_utils.h" +#include "rocksdb/db.h" namespace myrocks { @@ -102,6 +104,31 @@ class Rdb_background_thread : public Rdb_thread { } }; +class Rdb_manual_compaction_thread : public Rdb_thread { + private: + struct Manual_compaction_request { + int mc_id; + enum mc_state { INITED = 0, RUNNING } state; + rocksdb::ColumnFamilyHandle *cf; + rocksdb::Slice *start; + rocksdb::Slice *limit; + int concurrency = 0; + }; + + int m_latest_mc_id; + mysql_mutex_t m_mc_mutex; + std::map m_requests; + + public: + virtual void run() override; + int request_manual_compaction(rocksdb::ColumnFamilyHandle *cf, + rocksdb::Slice *start, rocksdb::Slice *limit, + int concurrency = 0); + bool is_manual_compaction_finished(int mc_id); + void clear_manual_compaction_request(int mc_id, bool init_only = false); + void clear_all_manual_compaction_requests(); +}; + /* Drop index thread control */ From 1b3803e1570e33288fd4f339b5f78936e8316bbd Mon Sep 17 00:00:00 2001 From: Manuel Ung Date: Tue, 31 Jul 2018 11:47:24 -0700 Subject: [PATCH 162/214] Add LOCK TABLES as a supported command for high priority ddl Upstream commit ID : fb-mysql-5.6.35/b145f26c86e670830f17e4b51bed88f0af535763 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. From dff4301c3991634f3a599cfaaae03197f45d82fe Mon Sep 17 00:00:00 2001 From: Abhinav Sharma Date: Fri, 3 Aug 2018 10:31:27 -0700 Subject: [PATCH 163/214] Fix behavior when explicit snapshot statements are combined Upstream commit ID : fb-mysql-5.6.35/801facfd048701e183d0b469125249d9c31120b4 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. From 159d4ecf923779f34207a5b12885e467bf422f1e Mon Sep 17 00:00:00 2001 From: Aliaksei Sandryhaila Date: Thu, 2 Aug 2018 11:47:00 -0700 Subject: [PATCH 164/214] Check MySQL version when printing rocksdb_bulk_load session variables in mysqldump Upstream commit ID : fb-mysql-5.6.35/ca31a6bb780c03d2b5429def83f81aab834754df PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. From bf17ee2d298a5927da2151ffb38e9061a3f9372f Mon Sep 17 00:00:00 2001 From: Ming Lin Date: Thu, 16 Aug 2018 09:04:32 -0700 Subject: [PATCH 165/214] Update AUTO_INCREMENT in the UPDATE statement (#868) Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057 PS-5217 : Merge fb-prod201803 Summary: Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement. For example, CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB; INSERT INTO t1 (a) VALUES (1); UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4. Without this fix, it hits the Assertion `dd_val >= last_val' failed in myrocks::ha_rocksdb::load_auto_incr_value_from_index. Please see detail at: https://jira.mariadb.org/browse/MDEV-16703 Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/868 Differential Revision: D9360242 Pulled By: lth fbshipit-source-id: 70ee31cb90f --- mysql-test/suite/rocksdb/r/autoinc_vars.result | 8 ++++++++ mysql-test/suite/rocksdb/t/autoinc_vars.test | 10 ++++++++++ storage/rocksdb/ha_rocksdb.cc | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rocksdb/r/autoinc_vars.result b/mysql-test/suite/rocksdb/r/autoinc_vars.result index 90db03356c7b..92e4ebfa3532 100644 --- a/mysql-test/suite/rocksdb/r/autoinc_vars.result +++ b/mysql-test/suite/rocksdb/r/autoinc_vars.result @@ -159,3 +159,11 @@ CREATE TABLE t0(c0 BLOB) ENGINE=ROCKSDB; INSERT INTO t0 VALUES(0); ALTER TABLE t0 AUTO_INCREMENT=0; DROP TABLE t0; +#---------------------------------- +# Issue #869 Crash in autoincrement +#---------------------------------- +CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB; +INSERT INTO t1 (a) VALUES (1); +UPDATE t1 SET pk = 3; +ALTER TABLE t1 AUTO_INCREMENT 2; +DROP TABLE t1; diff --git a/mysql-test/suite/rocksdb/t/autoinc_vars.test b/mysql-test/suite/rocksdb/t/autoinc_vars.test index 8a030ff1dbea..1b48501c542a 100644 --- a/mysql-test/suite/rocksdb/t/autoinc_vars.test +++ b/mysql-test/suite/rocksdb/t/autoinc_vars.test @@ -119,3 +119,13 @@ CREATE TABLE t0(c0 BLOB) ENGINE=ROCKSDB; INSERT INTO t0 VALUES(0); ALTER TABLE t0 AUTO_INCREMENT=0; DROP TABLE t0; + +--echo #---------------------------------- +--echo # Issue #869 Crash in autoincrement +--echo #---------------------------------- + +CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB; +INSERT INTO t1 (a) VALUES (1); +UPDATE t1 SET pk = 3; +ALTER TABLE t1 AUTO_INCREMENT 2; +DROP TABLE t1; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 83d48b1bc1e3..75fb0e194b49 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8959,7 +8959,7 @@ int ha_rocksdb::update_pk(const Rdb_key_def &kd, } } - if (table->next_number_field) { + if (table->found_next_number_field) { update_auto_incr_val_from_field(); } From 562536822239f31bb89ec9a4c7a1d924fc47bf00 Mon Sep 17 00:00:00 2001 From: Abhinav Sharma Date: Fri, 17 Aug 2018 19:37:47 -0700 Subject: [PATCH 166/214] Worker threads should respond to kill command in any state Upstream commit ID : fb-mysql-5.6.35/32462fb5c0d2fbbbad219ef15066af9dc3e31db1 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. From 52feaca826daa9ac8c72776bad2a7e76f4e24969 Mon Sep 17 00:00:00 2001 From: Ming Lin Date: Wed, 22 Aug 2018 09:09:43 -0700 Subject: [PATCH 167/214] Ignore setting m_lock_rows if lock_type == TL_IGNORE (#871) Upstream commit ID : fb-mysql-5.6.35/8cb1dc836b68f1f13e8b2655b2b8cb2d57f400b3 PS-5217 : Merge fb-prod201803 Summary: Original report: https://jira.mariadb.org/browse/MDEV-15816 To reproduce this bug just following below steps, client 1: USE test; CREATE TABLE t1 (i INT) ENGINE=MyISAM; HANDLER t1 OPEN h; CREATE TABLE t2 (i INT) ENGINE=RocksDB; LOCK TABLES t2 WRITE; client 2: FLUSH TABLES WITH READ LOCK; client 1: INSERT INTO t2 VALUES (1); So client 1 acquired the lock and set m_lock_rows = RDB_LOCK_WRITE. Then client 2 calls store_lock(TL_IGNORE) and m_lock_rows was wrongly set to RDB_LOCK_NONE, as below ``` #0 myrocks::ha_rocksdb::store_lock (this=0x7fffbc03c7c8, thd=0x7fffc0000ba0, to=0x7fffc0011220, lock_type=TL_IGNORE) #1 get_lock_data (thd=0x7fffc0000ba0, table_ptr=0x7fffe84b7d20, count=1, flags=2) #2 mysql_lock_abort_for_thread (thd=0x7fffc0000ba0, table=0x7fffbc03bbc0) #3 THD::notify_shared_lock (this=0x7fffc0000ba0, ctx_in_use=0x7fffbc000bd8, needs_thr_lock_abort=true) #4 MDL_lock::notify_conflicting_locks (this=0x555557a82380, ctx=0x7fffc0000cc8) #5 MDL_context::acquire_lock (this=0x7fffc0000cc8, mdl_request=0x7fffe84b8350, lock_wait_timeout=2) #6 Global_read_lock::lock_global_read_lock (this=0x7fffc0003fe0, thd=0x7fffc0000ba0) ``` Finally, client 1 "INSERT INTO..." hits the Assertion 'm_lock_rows == RDB_LOCK_WRITE' failed in myrocks::ha_rocksdb::write_row() Fix this bug by not setting m_locks_rows if lock_type == TL_IGNORE. Closes https://github.com/facebook/mysql-5.6/issues/838 Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/871 Differential Revision: D9417382 Pulled By: lth fbshipit-source-id: c36c164e06c --- mysql-test/suite/rocksdb/r/lock.result | 15 +++++++++++++++ mysql-test/suite/rocksdb/t/lock.test | 22 ++++++++++++++++++++++ storage/rocksdb/ha_rocksdb.cc | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rocksdb/r/lock.result b/mysql-test/suite/rocksdb/r/lock.result index 3f811b2ef698..1a707131c105 100644 --- a/mysql-test/suite/rocksdb/r/lock.result +++ b/mysql-test/suite/rocksdb/r/lock.result @@ -114,3 +114,18 @@ SELECT a,b FROM t1; a b UNLOCK TABLES; DROP TABLE t1, t2; +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +HANDLER t1 OPEN h; +CREATE TABLE t2 (i INT) ENGINE=RocksDB; +LOCK TABLES t2 WRITE; +connect con1,localhost,root,,test; +connection con1; +FLUSH TABLES WITH READ LOCK; +connection default; +INSERT INTO t2 VALUES (1); +UNLOCK TABLES; +HANDLER h CLOSE; +connection con1; +disconnect con1; +connection default; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/rocksdb/t/lock.test b/mysql-test/suite/rocksdb/t/lock.test index 32f35c8676e5..2de1317ccb0c 100644 --- a/mysql-test/suite/rocksdb/t/lock.test +++ b/mysql-test/suite/rocksdb/t/lock.test @@ -210,6 +210,28 @@ SELECT a,b FROM t1; UNLOCK TABLES; DROP TABLE t1, t2; +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +HANDLER t1 OPEN h; +CREATE TABLE t2 (i INT) ENGINE=RocksDB; +LOCK TABLES t2 WRITE; + +--connect (con1,localhost,root,,test) +--connection con1 +--send +FLUSH TABLES WITH READ LOCK; + +--connection default +INSERT INTO t2 VALUES (1); +UNLOCK TABLES; +HANDLER h CLOSE; + +--connection con1 +--reap +--disconnect con1 + +--connection default +DROP TABLE t1, t2; + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 75fb0e194b49..7e6e2d23b254 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -9918,7 +9918,7 @@ THR_LOCK_DATA **ha_rocksdb::store_lock(THD *const thd, THR_LOCK_DATA **to, m_lock_rows = RDB_LOCK_WRITE; } else if (lock_type == TL_READ_WITH_SHARED_LOCKS) { m_lock_rows = RDB_LOCK_READ; - } else { + } else if (lock_type != TL_IGNORE) { m_lock_rows = RDB_LOCK_NONE; if (THDVAR(thd, lock_scanned_rows)) { /* From 9ea7df55e0698f442fcc1bd507eca2970f9f87b3 Mon Sep 17 00:00:00 2001 From: Bin Tong Date: Wed, 5 Sep 2018 10:53:36 -0700 Subject: [PATCH 168/214] Reset MyRocks savepoints on every statement Upstream commit ID : fb-mysql-5.6.35/ac53c187f5c435d2de3cd3911b9df721125122bb PS-5217 : Merge fb-prod201803 Summary: Currently a savepoint is set after every successful statement. The purpose is that after a failed statement, we can rollback to the last successful statement. However, when setting a save point after a successful statement, the savepoints set previously become useless and they consume large memory space. This change removes these savepoints. Reviewed By: lth, yoshinorim Differential Revision: D9660839 fbshipit-source-id: a698908c938 --- storage/rocksdb/ha_rocksdb.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 7e6e2d23b254..0ebba17f951d 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -61,6 +61,7 @@ #include "rocksdb/utilities/convenience.h" #include "rocksdb/utilities/memory_util.h" #include "rocksdb/utilities/sim_cache.h" +#include "rocksdb/utilities/write_batch_with_index.h" #include "util/stop_watch.h" /* MyRocks includes */ @@ -1867,6 +1868,7 @@ class Rdb_transaction { std::shared_ptr m_notifier; // This should be used only when updating binlog information. + virtual rocksdb::WriteBatchBase *get_write_batch() = 0; virtual bool commit_no_binlog() = 0; virtual rocksdb::Iterator * get_iterator(const rocksdb::ReadOptions &options, @@ -2365,15 +2367,26 @@ class Rdb_transaction { Called when a "top-level" statement inside a transaction completes successfully and its changes become part of the transaction's changes. */ - void make_stmt_savepoint_permanent() { + int make_stmt_savepoint_permanent() { // Take another RocksDB savepoint only if we had changes since the last // one. This is very important for long transactions doing lots of // SELECTs. if (m_writes_at_last_savepoint != m_write_count) { + rocksdb::WriteBatchBase *batch = get_write_batch(); + rocksdb::Status status = rocksdb::Status::NotFound(); + while ((status = batch->PopSavePoint()) == rocksdb::Status::OK()) { + } + + if (status != rocksdb::Status::NotFound()) { + return HA_EXIT_FAILURE; + } + do_set_savepoint(); m_writes_at_last_savepoint = m_write_count; } + + return HA_EXIT_SUCCESS; } /* @@ -2620,6 +2633,10 @@ class Rdb_transaction_impl : public Rdb_transaction { m_rocksdb_tx->GetWriteBatch()->GetWriteBatch()->Count() > 0; } + rocksdb::WriteBatchBase *get_write_batch() override { + return m_rocksdb_tx->GetCommitTimeWriteBatch(); + } + /* Return a WriteBatch that one can write to. The writes will skip any transaction locking. The writes WILL be visible to the transaction. @@ -2885,6 +2902,8 @@ class Rdb_writebatch_impl : public Rdb_transaction { return m_batch->GetWriteBatch()->Count() > 0; } + rocksdb::WriteBatchBase *get_write_batch() override { return m_batch; } + rocksdb::WriteBatchBase *get_indexed_write_batch() override { ++m_write_count; return m_batch; From e15e5b33672bd61f5fbe8955b58ae26340208911 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Thu, 24 May 2018 17:25:41 -0700 Subject: [PATCH 169/214] Add cache_high_pri_pool_ratio option Upstream commit ID : fb-mysql-5.6.35/b704f92e7476f47dae92764d5e66f2fb6903f39c PS-5217 : Merge fb-prod201803 Summary: Adding rocksdb options cache_high_pri_pool_ratio and cache_index_and_filter_blocks_with_high_priority. I'm adding LRU cache midpoint insertion with rocksdb PR facebook/rocksdb#3877. My preliminary db_bench shows some latency and throughput drop for a read only workload when background full table scan presents (See the PR for more details). To enable the midpoint insertion strategy, high_pri_pool_ratio needs to be set to set the location for the midpoint. cache_index_and_filter_blocks_with_high_priority can be enabled so that index and filter blocks don't insert to the midpoint, but the tail of the full list. @[100005042139835:Anand Ananthabhotla] plan to test this option with NVM test setup. Reviewed By: lth Differential Revision: D10089425 fbshipit-source-id: 9ce32935f30 --- ...sdb_cache_high_pri_pool_ratio_basic.result | 22 +++++++++++++++++ ...and_filter_with_high_priority_basic.result | 19 +++++++++++++++ ...cksdb_cache_high_pri_pool_ratio_basic.test | 24 +++++++++++++++++++ ...x_and_filter_with_high_priority_basic.test | 21 ++++++++++++++++ .../r-native-partitioning/rocksdb.result | 2 ++ mysql-test/suite/rocksdb/r/rocksdb.result | 2 ++ storage/rocksdb/ha_rocksdb.cc | 23 ++++++++++++++++-- 7 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_high_pri_pool_ratio_basic.result create mode 100644 mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_index_and_filter_with_high_priority_basic.result create mode 100644 mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_high_pri_pool_ratio_basic.test create mode 100644 mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_index_and_filter_with_high_priority_basic.test diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_high_pri_pool_ratio_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_high_pri_pool_ratio_basic.result new file mode 100644 index 000000000000..9d0983857899 --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_high_pri_pool_ratio_basic.result @@ -0,0 +1,22 @@ +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(1.0); +INSERT INTO valid_values VALUES(0.0); +INSERT INTO valid_values VALUES(0.5); +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES(2.0); +INSERT INTO invalid_values VALUES(-0.5); +INSERT INTO invalid_values VALUES('\'aaa\''); +INSERT INTO invalid_values VALUES('\'bbb\''); +INSERT INTO invalid_values VALUES('\'-1\''); +INSERT INTO invalid_values VALUES('\'101\''); +INSERT INTO invalid_values VALUES('\'484436\''); +INSERT INTO invalid_values VALUES('\'0.5\''); +SET @start_global_value = @@global.ROCKSDB_CACHE_HIGH_PRI_POOL_RATIO; +SELECT @start_global_value; +@start_global_value +0 +"Trying to set variable @@global.ROCKSDB_CACHE_HIGH_PRI_POOL_RATIO to 444. It should fail because it is readonly." +SET @@global.ROCKSDB_CACHE_HIGH_PRI_POOL_RATIO = 444; +ERROR HY000: Variable 'rocksdb_cache_high_pri_pool_ratio' is a read only variable +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_index_and_filter_with_high_priority_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_index_and_filter_with_high_priority_basic.result new file mode 100644 index 000000000000..819425c8bce8 --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_cache_index_and_filter_with_high_priority_basic.result @@ -0,0 +1,19 @@ +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(1); +INSERT INTO valid_values VALUES(0); +INSERT INTO valid_values VALUES('on'); +INSERT INTO valid_values VALUES('off'); +INSERT INTO valid_values VALUES('true'); +INSERT INTO valid_values VALUES('false'); +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); +INSERT INTO invalid_values VALUES('\'bbb\''); +SET @start_global_value = @@global.ROCKSDB_CACHE_INDEX_AND_FILTER_WITH_HIGH_PRIORITY; +SELECT @start_global_value; +@start_global_value +1 +"Trying to set variable @@global.ROCKSDB_CACHE_INDEX_AND_FILTER_WITH_HIGH_PRIORITY to 444. It should fail because it is readonly." +SET @@global.ROCKSDB_CACHE_INDEX_AND_FILTER_WITH_HIGH_PRIORITY = 444; +ERROR HY000: Variable 'rocksdb_cache_index_and_filter_with_high_priority' is a read only variable +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_high_pri_pool_ratio_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_high_pri_pool_ratio_basic.test new file mode 100644 index 000000000000..d97c4e20f827 --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_high_pri_pool_ratio_basic.test @@ -0,0 +1,24 @@ +--source include/have_rocksdb.inc + +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(1.0); +INSERT INTO valid_values VALUES(0.0); +INSERT INTO valid_values VALUES(0.5); + +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES(2.0); +INSERT INTO invalid_values VALUES(-0.5); +INSERT INTO invalid_values VALUES('\'aaa\''); +INSERT INTO invalid_values VALUES('\'bbb\''); +INSERT INTO invalid_values VALUES('\'-1\''); +INSERT INTO invalid_values VALUES('\'101\''); +INSERT INTO invalid_values VALUES('\'484436\''); +INSERT INTO invalid_values VALUES('\'0.5\''); + +--let $sys_var=ROCKSDB_CACHE_HIGH_PRI_POOL_RATIO +--let $read_only=1 +--let $session=0 +--source ../include/rocksdb_sys_var.inc + +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_index_and_filter_with_high_priority_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_index_and_filter_with_high_priority_basic.test new file mode 100644 index 000000000000..5ed7927f233d --- /dev/null +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_cache_index_and_filter_with_high_priority_basic.test @@ -0,0 +1,21 @@ +--source include/have_rocksdb.inc + +CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO valid_values VALUES(1); +INSERT INTO valid_values VALUES(0); +INSERT INTO valid_values VALUES('on'); +INSERT INTO valid_values VALUES('off'); +INSERT INTO valid_values VALUES('true'); +INSERT INTO valid_values VALUES('false'); + +CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; +INSERT INTO invalid_values VALUES('\'aaa\''); +INSERT INTO invalid_values VALUES('\'bbb\''); + +--let $sys_var=ROCKSDB_CACHE_INDEX_AND_FILTER_WITH_HIGH_PRIORITY +--let $read_only=1 +--let $session=0 +--source ../include/rocksdb_sys_var.inc + +DROP TABLE valid_values; +DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result b/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result index 560b72ef016a..ad57e5e34083 100644 --- a/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result +++ b/mysql-test/suite/rocksdb/r-native-partitioning/rocksdb.result @@ -901,7 +901,9 @@ rocksdb_bulk_load_allow_sk OFF rocksdb_bulk_load_allow_unsorted OFF rocksdb_bulk_load_size 1000 rocksdb_bytes_per_sync 0 +rocksdb_cache_high_pri_pool_ratio 0.000000 rocksdb_cache_index_and_filter_blocks ON +rocksdb_cache_index_and_filter_with_high_priority ON rocksdb_checksums_pct 100 rocksdb_collect_sst_properties ON rocksdb_commit_in_the_middle OFF diff --git a/mysql-test/suite/rocksdb/r/rocksdb.result b/mysql-test/suite/rocksdb/r/rocksdb.result index 8d95f6061d35..56aa2c614dfd 100644 --- a/mysql-test/suite/rocksdb/r/rocksdb.result +++ b/mysql-test/suite/rocksdb/r/rocksdb.result @@ -903,7 +903,9 @@ rocksdb_bulk_load_allow_sk OFF rocksdb_bulk_load_allow_unsorted OFF rocksdb_bulk_load_size 1000 rocksdb_bytes_per_sync 0 +rocksdb_cache_high_pri_pool_ratio 0.000000 rocksdb_cache_index_and_filter_blocks ON +rocksdb_cache_index_and_filter_with_high_priority ON rocksdb_checksums_pct 100 rocksdb_collect_sst_properties ON rocksdb_commit_in_the_middle OFF diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 0ebba17f951d..13066a8e019c 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -426,6 +426,7 @@ static constexpr ulong RDB_DEADLOCK_DETECT_DEPTH = 50; static long long rocksdb_block_cache_size = RDB_DEFAULT_BLOCK_CACHE_SIZE; static long long rocksdb_sim_cache_size = 0; +static double rocksdb_cache_high_pri_pool_ratio = 0.0; /* Use unsigned long long instead of uint64_t because of MySQL compatibility */ static unsigned long long // NOLINT(runtime/int) rocksdb_rate_limiter_bytes_per_sec = 0; @@ -1134,6 +1135,13 @@ static MYSQL_SYSVAR_LONGLONG(sim_cache_size, rocksdb_sim_cache_size, /* max */ LLONG_MAX, /* Block size */ 0); +static MYSQL_SYSVAR_DOUBLE(cache_high_pri_pool_ratio, + rocksdb_cache_high_pri_pool_ratio, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Specify the size of block cache high-pri pool", + nullptr, nullptr, /* default */ 0.0, /* min */ 0.0, + /* max */ 1.0, 0); + static MYSQL_SYSVAR_BOOL( cache_index_and_filter_blocks, *reinterpret_cast( @@ -1142,6 +1150,14 @@ static MYSQL_SYSVAR_BOOL( "BlockBasedTableOptions::cache_index_and_filter_blocks for RocksDB", nullptr, nullptr, true); +static MYSQL_SYSVAR_BOOL( + cache_index_and_filter_with_high_priority, + *reinterpret_cast( + &rocksdb_tbl_options->cache_index_and_filter_blocks_with_high_priority), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "cache_index_and_filter_blocks_with_high_priority for RocksDB", nullptr, + nullptr, true); + // When pin_l0_filter_and_index_blocks_in_cache is true, RocksDB will use the // LRU cache, but will always keep the filter & idndex block's handle checked // out (=won't call ShardedLRUCache::Release), plus the parsed out objects @@ -1627,7 +1643,9 @@ static struct st_mysql_sys_var *rocksdb_system_variables[] = { MYSQL_SYSVAR(block_cache_size), MYSQL_SYSVAR(sim_cache_size), + MYSQL_SYSVAR(cache_high_pri_pool_ratio), MYSQL_SYSVAR(cache_index_and_filter_blocks), + MYSQL_SYSVAR(cache_index_and_filter_with_high_priority), MYSQL_SYSVAR(pin_l0_filter_and_index_blocks_in_cache), MYSQL_SYSVAR(index_type), MYSQL_SYSVAR(hash_index_allow_collision), @@ -4174,8 +4192,9 @@ static int rocksdb_init_func(void *const p) { (rocksdb::BlockBasedTableOptions::IndexType)rocksdb_index_type; if (!rocksdb_tbl_options->no_block_cache) { - std::shared_ptr block_cache = - rocksdb::NewLRUCache(rocksdb_block_cache_size); + std::shared_ptr block_cache = rocksdb::NewLRUCache( + rocksdb_block_cache_size, -1 /*num_shard_bits*/, + false /*strict_capcity_limit*/, rocksdb_cache_high_pri_pool_ratio); if (rocksdb_sim_cache_size > 0) { // Simulated cache enabled // Wrap block cache inside a simulated cache and pass it to RocksDB From 579cc9a6fa04439519a6730b385d9802b83888d6 Mon Sep 17 00:00:00 2001 From: Manuel Ung Date: Wed, 3 Oct 2018 10:11:50 -0700 Subject: [PATCH 170/214] Fix issue #878: Descending scans from reverse cf return no results (#879) Upstream commit ID : fb-mysql-5.6.35/36dac36b400ba5cdd47b0290a8bfc8ca3a0997cb PS-5217 : Merge fb-prod201803 Summary: Currently, `Rdb_key_def::predecessor` can underflow during `ha_rocksdb::setup_iterator_bounds` if eq_cond being passed in is too short. The fix is to use index id directly in that case, instead of relying on eq_cond. Fixes https://github.com/facebook/mysql-5.6/issues/878 Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/879 Differential Revision: D10092728 Pulled By: lth fbshipit-source-id: 7d9ab055e9b --- .../suite/rocksdb/r/iterator_bounds.result | 15 +++++++ .../rocksdb/t/iterator_bounds-master.opt | 2 + .../suite/rocksdb/t/iterator_bounds.test | 30 ++++++++++++++ storage/rocksdb/ha_rocksdb.cc | 40 ++++++++++++++----- 4 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 mysql-test/suite/rocksdb/r/iterator_bounds.result create mode 100644 mysql-test/suite/rocksdb/t/iterator_bounds-master.opt create mode 100644 mysql-test/suite/rocksdb/t/iterator_bounds.test diff --git a/mysql-test/suite/rocksdb/r/iterator_bounds.result b/mysql-test/suite/rocksdb/r/iterator_bounds.result new file mode 100644 index 000000000000..600f19e0d613 --- /dev/null +++ b/mysql-test/suite/rocksdb/r/iterator_bounds.result @@ -0,0 +1,15 @@ +create table t (i int primary key) engine=rocksdb; +drop table t; +create table t (i int primary key, j int, key(j) comment 'rev:bf5_2') engine=rocksdb; +select RIGHT(HEX(index_number), 2) from information_schema.rocksdb_ddl where table_name = 't'; +RIGHT(HEX(index_number), 2) +FE +FF +insert into t values (1, 1); +select j from t order by j asc; +j +1 +select j from t order by j desc; +j +1 +drop table t; diff --git a/mysql-test/suite/rocksdb/t/iterator_bounds-master.opt b/mysql-test/suite/rocksdb/t/iterator_bounds-master.opt new file mode 100644 index 000000000000..a61e9bbed077 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/iterator_bounds-master.opt @@ -0,0 +1,2 @@ +--loose-rocksdb_default_cf_options=write_buffer_size=256k;block_based_table_factory={filter_policy=bloomfilter:10:false;whole_key_filtering=0;} +--loose-rocksdb_override_cf_options=rev:bf5_1={prefix_extractor=capped:12}; diff --git a/mysql-test/suite/rocksdb/t/iterator_bounds.test b/mysql-test/suite/rocksdb/t/iterator_bounds.test new file mode 100644 index 000000000000..51981bbfc520 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/iterator_bounds.test @@ -0,0 +1,30 @@ +# +# Issue #878: Descending scans from reverse column families return no results +# due to iterator bounds +# +--source include/have_rocksdb.inc + +create table t (i int primary key) engine=rocksdb; + +let $cond=1; +while ($cond) +{ + --disable_query_log + truncate table t; + --enable_query_log + let $cond=`select RIGHT(HEX(index_number), 2) != "FD" from information_schema.rocksdb_ddl where table_name = 't'`; +} + +# Index id is now at FD. Create a table with primary and secondary key, so +# that the secondary key index id ends in 0xFF. + +drop table t; +create table t (i int primary key, j int, key(j) comment 'rev:bf5_2') engine=rocksdb; +select RIGHT(HEX(index_number), 2) from information_schema.rocksdb_ddl where table_name = 't'; + +insert into t values (1, 1); + +select j from t order by j asc; +select j from t order by j desc; + +drop table t; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 13066a8e019c..c52ce399c50a 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -9240,18 +9240,29 @@ void ha_rocksdb::setup_iterator_bounds( const Rdb_key_def &kd, const rocksdb::Slice &eq_cond, size_t bound_len, uchar *const lower_bound, uchar *const upper_bound, rocksdb::Slice *lower_bound_slice, rocksdb::Slice *upper_bound_slice) { - uint min_len = std::min(eq_cond.size(), bound_len); - memcpy(upper_bound, eq_cond.data(), min_len); - kd.successor(upper_bound, min_len); - memcpy(lower_bound, eq_cond.data(), min_len); - kd.predecessor(lower_bound, min_len); + // If eq_cond is shorter than Rdb_key_def::INDEX_NUMBER_SIZE, we should be + // able to get better bounds just by using index id directly. + if (eq_cond.size() <= Rdb_key_def::INDEX_NUMBER_SIZE) { + DBUG_ASSERT(bound_len == Rdb_key_def::INDEX_NUMBER_SIZE); + uint size; + kd.get_infimum_key(lower_bound, &size); + DBUG_ASSERT(size == Rdb_key_def::INDEX_NUMBER_SIZE); + kd.get_supremum_key(upper_bound, &size); + DBUG_ASSERT(size == Rdb_key_def::INDEX_NUMBER_SIZE); + } else { + DBUG_ASSERT(bound_len <= eq_cond.size()); + memcpy(upper_bound, eq_cond.data(), bound_len); + kd.successor(upper_bound, bound_len); + memcpy(lower_bound, eq_cond.data(), bound_len); + kd.predecessor(lower_bound, bound_len); + } if (kd.m_is_reverse_cf) { - *upper_bound_slice = rocksdb::Slice((const char *)lower_bound, min_len); - *lower_bound_slice = rocksdb::Slice((const char *)upper_bound, min_len); + *upper_bound_slice = rocksdb::Slice((const char *)lower_bound, bound_len); + *lower_bound_slice = rocksdb::Slice((const char *)upper_bound, bound_len); } else { - *upper_bound_slice = rocksdb::Slice((const char *)upper_bound, min_len); - *lower_bound_slice = rocksdb::Slice((const char *)lower_bound, min_len); + *upper_bound_slice = rocksdb::Slice((const char *)upper_bound, bound_len); + *lower_bound_slice = rocksdb::Slice((const char *)lower_bound, bound_len); } } @@ -9271,8 +9282,17 @@ void ha_rocksdb::setup_scan_iterator(const Rdb_key_def &kd, bool skip_bloom = true; const rocksdb::Slice eq_cond(slice->data(), eq_cond_len); + // The size of m_scan_it_lower_bound (and upper) is technically + // max_packed_sk_len as calculated in ha_rocksdb::alloc_key_buffers. Rather + // than recalculating that number, we pass in the max of eq_cond_len and + // Rdb_key_def::INDEX_NUMBER_SIZE which is guaranteed to be smaller than + // max_packed_sk_len, hence ensuring no buffer overrun. + // + // See ha_rocksdb::setup_iterator_bounds on how the bound_len parameter is + // used. if (check_bloom_and_set_bounds( - ha_thd(), kd, eq_cond, use_all_keys, eq_cond_len, + ha_thd(), kd, eq_cond, use_all_keys, + std::max(eq_cond_len, (uint)Rdb_key_def::INDEX_NUMBER_SIZE), m_scan_it_lower_bound, m_scan_it_upper_bound, &m_scan_it_lower_bound_slice, &m_scan_it_upper_bound_slice)) { skip_bloom = false; From 394902b9982f6718d6542fd471ee89e0ae03058e Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Fri, 5 Oct 2018 15:47:02 -0700 Subject: [PATCH 171/214] rocksdb_update_cf_options: create column family if it doesn't exist Upstream commit ID : fb-mysql-5.6.35/f06c79b76b1896324d816399efaaf711ad177dc0 PS-5217 : Merge fb-prod201803 Summary: D8037510 was merged to introduce dynamic change of prefix_extractor However due to operational reasons, it is necessary that SET @global.rocksdb_update_cf_options could automatically create column family if it doesn't exist yet. It will make possible the following scenario: SET @global.rocksdb_update_cf_options = 'cf3={prefix_extractor=capped:28}; CREATE TABLE t3 (id int, primary key (id) COMMENT 'cf3'); Reviewed By: yoshinorim Differential Revision: D10128061 fbshipit-source-id: 224457e62i53 Percona Server - Integrated change with Percona rocksdb_no_create_column_family and added additional test to cover proper behavior. - Moved test from random file appendage into rocksdb_cf_options test. --- mysql-test/suite/rocksdb/r/rocksdb_cf_options.result | 11 ++++++++++- mysql-test/suite/rocksdb/t/rocksdb_cf_options.test | 11 +++++++++++ storage/rocksdb/ha_rocksdb.cc | 8 ++++++++ storage/rocksdb/rdb_cf_manager.cc | 5 +++-- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/rocksdb/r/rocksdb_cf_options.result b/mysql-test/suite/rocksdb/r/rocksdb_cf_options.result index a33e3ade7b43..624f974898ac 100644 --- a/mysql-test/suite/rocksdb/r/rocksdb_cf_options.result +++ b/mysql-test/suite/rocksdb/r/rocksdb_cf_options.result @@ -7,6 +7,7 @@ primary key (a) comment 'z') engine=rocksdb; insert into t1 values (1); insert into t2 values (2); insert into t3 values (2); +SET @@global.rocksdb_update_cf_options = 'cf5={prefix_extractor=capped:28};'; # restart Default options for all column families: @@ -24,6 +25,9 @@ cf1 WRITE_BUFFER_SIZE 12582912 cf2 MAX_BYTES_FOR_LEVEL_MULTIPLIER 10.000000 cf2 TARGET_FILE_SIZE_BASE 1048576 cf2 WRITE_BUFFER_SIZE 12582912 +cf5 MAX_BYTES_FOR_LEVEL_MULTIPLIER 10.000000 +cf5 TARGET_FILE_SIZE_BASE 1048576 +cf5 WRITE_BUFFER_SIZE 12582912 default MAX_BYTES_FOR_LEVEL_MULTIPLIER 10.000000 default TARGET_FILE_SIZE_BASE 1048576 default WRITE_BUFFER_SIZE 12582912 @@ -50,6 +54,9 @@ cf1 WRITE_BUFFER_SIZE 8388608 cf2 MAX_BYTES_FOR_LEVEL_MULTIPLIER 8.000000 cf2 TARGET_FILE_SIZE_BASE 1048576 cf2 WRITE_BUFFER_SIZE 16777216 +cf5 MAX_BYTES_FOR_LEVEL_MULTIPLIER 10.000000 +cf5 TARGET_FILE_SIZE_BASE 1048576 +cf5 WRITE_BUFFER_SIZE 12582912 default MAX_BYTES_FOR_LEVEL_MULTIPLIER 10.000000 default TARGET_FILE_SIZE_BASE 1048576 default WRITE_BUFFER_SIZE 12582912 @@ -66,8 +73,10 @@ primary key (a) comment 'cf3') engine=rocksdb; include/assert.inc ["Expected cf3 to exist"] create table t5 (a int, primary key (a) comment 'nobodyknows') engine=rocksdb; -ERROR HY000: Incorrect arguments to CREATE | ALTER - can not find column family for storing index data and creation is not allowed. +ERROR HY000: Incorrect arguments to CREATE | ALTER | SET rocksdb_update_cf_options - can not find column family for storing index data and creation is not allowed. include/assert.inc ["Expected cf4 to NOT exist"] +SET @@global.rocksdb_update_cf_options = 'cf6={prefix_extractor=capped:28};'; +ERROR HY000: Incorrect arguments to CREATE | ALTER | SET rocksdb_update_cf_options - can not find column family for storing index data and creation is not allowed. # restart drop table t1,t2,t3,t4; diff --git a/mysql-test/suite/rocksdb/t/rocksdb_cf_options.test b/mysql-test/suite/rocksdb/t/rocksdb_cf_options.test index 37973d3a4b7c..c23998783bd6 100644 --- a/mysql-test/suite/rocksdb/t/rocksdb_cf_options.test +++ b/mysql-test/suite/rocksdb/t/rocksdb_cf_options.test @@ -16,6 +16,11 @@ insert into t1 values (1); insert into t2 values (2); insert into t3 values (2); +# set cf_options for non-existent cf5, cf5 should be created automatically +SET @@global.rocksdb_update_cf_options = 'cf5={prefix_extractor=capped:28};'; +--let $assert_text="Expected cf5 to exist" +--let $assert_cond="[select count(distinct cf_name) from information_schema.rocksdb_cf_options where cf_name in (\'cf5\')]" = 1 + # restart with new column families in DB --let $restart_parameters= @@ -73,6 +78,12 @@ create table t5 (a int, --let $assert_cond="[select count(distinct cf_name) from information_schema.rocksdb_cf_options where cf_name in (\'cf4\')]" = 0 --source include/assert.inc +# set cf_options for non-existent cf6, cf6 should NOT be created automatically +--error ER_WRONG_ARGUMENTS +SET @@global.rocksdb_update_cf_options = 'cf6={prefix_extractor=capped:28};'; +--let $assert_text="Expected cf6 to NOT exist" +--let $assert_cond="[select count(distinct cf_name) from information_schema.rocksdb_cf_options where cf_name in (\'cf6\')]" = 0 + # syntax error in options (no equal sign) --exec echo "restart:--rocksdb_override_cf_options=cf1" > $_expect_file_name diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index c52ce399c50a..f5e0e4724731 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -13064,6 +13064,14 @@ static int rocksdb_validate_update_cf_options( my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "rocksdb_update_cf_options", str); return HA_EXIT_FAILURE; } + // Loop through option_map and create missing column families + for (Rdb_cf_options::Name_to_config_t::iterator it = option_map.begin(); + it != option_map.end(); ++it) { + if (!cf_manager.get_or_create_cf(rdb, it->first, + !rocksdb_no_create_column_family)) { + return HA_EXIT_FAILURE; + } + } return HA_EXIT_SUCCESS; } diff --git a/storage/rocksdb/rdb_cf_manager.cc b/storage/rocksdb/rdb_cf_manager.cc index a1e762ee7ca8..348fce24a879 100644 --- a/storage/rocksdb/rdb_cf_manager.cc +++ b/storage/rocksdb/rdb_cf_manager.cc @@ -120,8 +120,9 @@ Rdb_cf_manager::get_or_create_cf(rocksdb::DB *const rdb, } else { RDB_MUTEX_UNLOCK_CHECK(m_mutex); my_error(ER_WRONG_ARGUMENTS, MYF(0), - "CREATE | ALTER - can not find column family for storing index " - "data and creation is not allowed."); + "CREATE | ALTER | SET rocksdb_update_cf_options - can not find " + "column family for storing index data and creation is not " + "allowed."); return nullptr; } } From 833160b4575ac56bcd0a9e170bf13e77e3b71656 Mon Sep 17 00:00:00 2001 From: Volodymyr Verovkin Date: Fri, 12 Oct 2018 15:16:28 -0700 Subject: [PATCH 172/214] Fixed test rocksdb.show_engine and update rocksdb head Upstream commit ID : fb-mysql-5.6.35/c036201540e8c99b92f1c8ecdba13def31edd7d1 PS-5217 : Merge fb-prod201803 Summary: Fixed test rocksdb.show_engine The controller you requested could not be found.: rocksdb Reviewed By: lth Differential Revision: D10225200 fbshipit-source-id: 4f8426cca0f --- .../suite/rocksdb/r-native-partitioning/show_engine.result | 4 ++++ mysql-test/suite/rocksdb/r/show_engine.result | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mysql-test/suite/rocksdb/r-native-partitioning/show_engine.result b/mysql-test/suite/rocksdb/r-native-partitioning/show_engine.result index a319ddcfdb64..3a3a23c4920b 100644 --- a/mysql-test/suite/rocksdb/r-native-partitioning/show_engine.result +++ b/mysql-test/suite/rocksdb/r-native-partitioning/show_engine.result @@ -136,6 +136,7 @@ __system__ TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # __system__ TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # __system__ TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # __system__ TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +__system__ TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # __system__ TABLE_FACTORY::INDEX_TYPE # __system__ TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # __system__ TABLE_FACTORY::CHECKSUM # @@ -208,6 +209,7 @@ cf_t1 TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # cf_t1 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # cf_t1 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # cf_t1 TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +cf_t1 TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # cf_t1 TABLE_FACTORY::INDEX_TYPE # cf_t1 TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # cf_t1 TABLE_FACTORY::CHECKSUM # @@ -280,6 +282,7 @@ default TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # default TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # default TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # default TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +default TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # default TABLE_FACTORY::INDEX_TYPE # default TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # default TABLE_FACTORY::CHECKSUM # @@ -352,6 +355,7 @@ rev:cf_t2 TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # rev:cf_t2 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # rev:cf_t2 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # rev:cf_t2 TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +rev:cf_t2 TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # rev:cf_t2 TABLE_FACTORY::INDEX_TYPE # rev:cf_t2 TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # rev:cf_t2 TABLE_FACTORY::CHECKSUM # diff --git a/mysql-test/suite/rocksdb/r/show_engine.result b/mysql-test/suite/rocksdb/r/show_engine.result index 6ad302c91d2b..7fd8ee68ef9a 100644 --- a/mysql-test/suite/rocksdb/r/show_engine.result +++ b/mysql-test/suite/rocksdb/r/show_engine.result @@ -140,6 +140,7 @@ __system__ TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # __system__ TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # __system__ TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # __system__ TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +__system__ TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # __system__ TABLE_FACTORY::INDEX_TYPE # __system__ TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # __system__ TABLE_FACTORY::CHECKSUM # @@ -212,6 +213,7 @@ cf_t1 TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # cf_t1 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # cf_t1 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # cf_t1 TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +cf_t1 TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # cf_t1 TABLE_FACTORY::INDEX_TYPE # cf_t1 TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # cf_t1 TABLE_FACTORY::CHECKSUM # @@ -284,6 +286,7 @@ default TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # default TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # default TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # default TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +default TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # default TABLE_FACTORY::INDEX_TYPE # default TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # default TABLE_FACTORY::CHECKSUM # @@ -356,6 +359,7 @@ rev:cf_t2 TABLE_FACTORY::FLUSH_BLOCK_POLICY_FACTORY # rev:cf_t2 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS # rev:cf_t2 TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS_WITH_HIGH_PRIORITY # rev:cf_t2 TABLE_FACTORY::PIN_L0_FILTER_AND_INDEX_BLOCKS_IN_CACHE # +rev:cf_t2 TABLE_FACTORY::PIN_TOP_LEVEL_INDEX_AND_FILTER # rev:cf_t2 TABLE_FACTORY::INDEX_TYPE # rev:cf_t2 TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION # rev:cf_t2 TABLE_FACTORY::CHECKSUM # From 834547ab056966f884c2dfc3cd78934b092e1d25 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 16 Oct 2018 11:18:36 -0700 Subject: [PATCH 173/214] Issue #881: Issue #809 still occurs for reverse scans on forward cfs (#883) Upstream commit ID : fb-mysql-5.6.35/24ae596af4d2802acb3be58b5794f59d6212aeff PS-5217 : Merge fb-prod201803 Summary: When constructing a lookup key for reverse full index scan, pass the correct eq_cond_len to setup_scan_iterator(). The code mirrors the code in ha_rocksdb::index_first_intern(). Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/883 Differential Revision: D10388394 Pulled By: hermanlee fbshipit-source-id: 75cf5d6737a --- .../suite/rocksdb/r/bloomfilter5.result | 27 +++++++++++++++++- .../suite/rocksdb/t/bloomfilter5-master.opt | 3 +- mysql-test/suite/rocksdb/t/bloomfilter5.test | 28 ++++++++++++++++++- storage/rocksdb/ha_rocksdb.cc | 8 ++---- storage/rocksdb/rdb_datadic.h | 21 ++++++++++++++ 5 files changed, 77 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/rocksdb/r/bloomfilter5.result b/mysql-test/suite/rocksdb/r/bloomfilter5.result index 6509a69df349..5e1ac2b5d80b 100644 --- a/mysql-test/suite/rocksdb/r/bloomfilter5.result +++ b/mysql-test/suite/rocksdb/r/bloomfilter5.result @@ -64,4 +64,29 @@ insert into t4 values (1, 0xFFFF, 0xFFF, 12345); # This must not fail an assert: select * from t4 force index(kp1) where kp1=0xFFFFFFFF and kp2<=0xFFFFFFFF order by kp2 desc; pk kp1 kp2 col1 -drop table t1,t2,t3,t4; +# +# Issue #881: Issue #809 still occurs for reverse scans on forward cfs +# +create table t5 ( +id1 bigint not null, +id2 bigint not null, +id3 varchar(100) not null, +id4 int not null, +id5 int not null, +value bigint, +value2 varchar(100), +primary key (id1, id2, id3, id4) COMMENT 'bf5_1' +) engine=ROCKSDB; +insert into t5 select * from t1; +set global rocksdb_force_flush_memtable_now=1; +# An index scan starting from the end of the table: +explain +select * from t5 order by id1 desc,id2 desc, id3 desc, id4 desc limit 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t5 NULL index NULL PRIMARY 122 NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t5`.`id1` AS `id1`,`test`.`t5`.`id2` AS `id2`,`test`.`t5`.`id3` AS `id3`,`test`.`t5`.`id4` AS `id4`,`test`.`t5`.`id5` AS `id5`,`test`.`t5`.`value` AS `value`,`test`.`t5`.`value2` AS `value2` from `test`.`t5` order by `test`.`t5`.`id1` desc,`test`.`t5`.`id2` desc,`test`.`t5`.`id3` desc,`test`.`t5`.`id4` desc limit 1 +select * from t5 order by id1 desc,id2 desc, id3 desc, id4 desc limit 1; +id1 id2 id3 id4 id5 value value2 +1000 2000 2000 10000 10000 1000 aaabbbccc +drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/rocksdb/t/bloomfilter5-master.opt b/mysql-test/suite/rocksdb/t/bloomfilter5-master.opt index 3c62bd7fec62..64705718a523 100644 --- a/mysql-test/suite/rocksdb/t/bloomfilter5-master.opt +++ b/mysql-test/suite/rocksdb/t/bloomfilter5-master.opt @@ -1,3 +1,2 @@ --loose-rocksdb_default_cf_options=write_buffer_size=256k;block_based_table_factory={filter_policy=bloomfilter:10:false;whole_key_filtering=0;} ---loose-rocksdb_override_cf_options=rev:bf5_1={prefix_extractor=capped:4}; - +--loose-rocksdb_override_cf_options=rev:bf5_1={prefix_extractor=capped:4};bf5_1={prefix_extractor=capped:4} diff --git a/mysql-test/suite/rocksdb/t/bloomfilter5.test b/mysql-test/suite/rocksdb/t/bloomfilter5.test index 0e9ca5547e76..92f13e4c037d 100644 --- a/mysql-test/suite/rocksdb/t/bloomfilter5.test +++ b/mysql-test/suite/rocksdb/t/bloomfilter5.test @@ -61,4 +61,30 @@ insert into t4 values (1, 0xFFFF, 0xFFF, 12345); --echo # This must not fail an assert: select * from t4 force index(kp1) where kp1=0xFFFFFFFF and kp2<=0xFFFFFFFF order by kp2 desc; -drop table t1,t2,t3,t4; +--echo # +--echo # Issue #881: Issue #809 still occurs for reverse scans on forward cfs +--echo # + +# The same as t1 above but uses forward-ordered column family: + +create table t5 ( + id1 bigint not null, + id2 bigint not null, + id3 varchar(100) not null, + id4 int not null, + id5 int not null, + value bigint, + value2 varchar(100), + primary key (id1, id2, id3, id4) COMMENT 'bf5_1' +) engine=ROCKSDB; + +insert into t5 select * from t1; + +set global rocksdb_force_flush_memtable_now=1; + +--echo # An index scan starting from the end of the table: +explain +select * from t5 order by id1 desc,id2 desc, id3 desc, id4 desc limit 1; +select * from t5 order by id1 desc,id2 desc, id3 desc, id4 desc limit 1; + +drop table t1,t2,t3,t4,t5; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index f5e0e4724731..f07473a90e15 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8351,11 +8351,7 @@ int ha_rocksdb::index_last_intern(uchar *const buf) { DBUG_ASSERT(key != nullptr); const Rdb_key_def &kd = *m_key_descr_arr[active_index]; - if (kd.m_is_reverse_cf) { - kd.get_infimum_key(key, &key_size); - } else { - kd.get_supremum_key(key, &key_size); - } + int key_end_matching_bytes = kd.get_last_key(key, &key_size); rocksdb::Slice index_key((const char *)key, key_size); @@ -8366,7 +8362,7 @@ int ha_rocksdb::index_last_intern(uchar *const buf) { // Loop as long as we get a deadlock error AND we end up creating the // snapshot here (i.e. it did not exist prior to this) for (;;) { - setup_scan_iterator(kd, &index_key, false, Rdb_key_def::INDEX_NUMBER_SIZE); + setup_scan_iterator(kd, &index_key, false, key_end_matching_bytes); m_scan_it->SeekForPrev(index_key); m_skip_scan_it_next_call = false; diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h index a75e4f4761b4..a074942aaf48 100644 --- a/storage/rocksdb/rdb_datadic.h +++ b/storage/rocksdb/rdb_datadic.h @@ -259,6 +259,27 @@ class Rdb_key_def { return i; } + /* + The same as get_first_key, but get the key for the last entry in the index + */ + inline int get_last_key(uchar *const key, uint *const size) const { + if (m_is_reverse_cf) + get_infimum_key(key, size); + else + get_supremum_key(key, size); + + /* Find out how many bytes of infimum are the same as m_index_number */ + uchar unmodified_key[INDEX_NUMBER_SIZE]; + rdb_netbuf_store_index(unmodified_key, m_index_number); + int i; + for (i = 0; i < INDEX_NUMBER_SIZE; i++) { + if (key[i] != unmodified_key[i]) + break; + } + return i; + } + + /* Make a key that is right after the given key. */ static int successor(uchar *const packed_tuple, const uint &len); From 70d8b376a45a7008868e0e1177af5228df843230 Mon Sep 17 00:00:00 2001 From: Herman Lee Date: Tue, 16 Oct 2018 11:26:24 -0700 Subject: [PATCH 174/214] Fix clang-format complaint in rdb_datadic.h Upstream commit ID : fb-mysql-5.6.35/92247842429f414c81ca7cb1b99803a0899acad2 PS-5217 : Merge fb-prod201803 Summary: Fixes a few minor issues from Issue #881: Issue #809 still occurs for reverse scans on forward cfs. Squash with D10388394 Reviewed By: lth Differential Revision: D10410065 fbshipit-source-id: 10df167f888 --- storage/rocksdb/rdb_datadic.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h index a074942aaf48..beb2cb3e3bf9 100644 --- a/storage/rocksdb/rdb_datadic.h +++ b/storage/rocksdb/rdb_datadic.h @@ -268,7 +268,7 @@ class Rdb_key_def { else get_supremum_key(key, size); - /* Find out how many bytes of infimum are the same as m_index_number */ + /* Find out how many bytes are the same as m_index_number */ uchar unmodified_key[INDEX_NUMBER_SIZE]; rdb_netbuf_store_index(unmodified_key, m_index_number); int i; @@ -279,7 +279,6 @@ class Rdb_key_def { return i; } - /* Make a key that is right after the given key. */ static int successor(uchar *const packed_tuple, const uint &len); From d9487164d156bc6272a85b78b426a76823835945 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Fri, 12 Oct 2018 15:30:57 -0700 Subject: [PATCH 175/214] Update cmake to build rocksdb with jemalloc Upstream commit ID : fb-mysql-5.6.35/f792496915e043e8ba162ed2c1564e150c422da4 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. From a1367cac7da3cac1ae11cf10a543263eeab328b4 Mon Sep 17 00:00:00 2001 From: Bin Tong Date: Wed, 17 Oct 2018 16:44:43 -0700 Subject: [PATCH 176/214] Support deletion of unused column family from RocksDB Upstream commit ID : fb-mysql-5.6.35/43a78199188ce46c857e420ab6ed75f8c6b0c9c8 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. From e7c835e7c2e300cdf4c5b75991dadc45cd5bb437 Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Wed, 17 Oct 2018 16:08:45 -0700 Subject: [PATCH 177/214] Default commit_time_batch_for_recovery to true Upstream commit ID : fb-mysql-5.6.35/b38db08d3d7050154628f2a37d481baa1e99cbc5 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Patch not taken into Percona Server. This is a default value change, something we do not do for mid-series releases. The default value change appears to benefit the write_prepared write policy, but, the default policy is write_committed. From 4aae4790cc8231927d091e8f510eeb6f4d051704 Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Tue, 23 Oct 2018 14:29:33 -0700 Subject: [PATCH 178/214] =?UTF-8?q?[mysql-5.6][PR]=20issue-884=20:=20Prefi?= =?UTF-8?q?xed=20PK=20and=20index=5Fmerge=20causes=20"ERROR=201032=20(HY00?= =?UTF-8?q?0):=20C=E2=80=A6=20(#893)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream commit ID : fb-mysql-5.6.35/aa6ea847144ed99e4f08edf39925041cf733aad8 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Change already applied to source tree through another patch. From 9e7b02a7add731446ce1120af901b8c1b46d9d8e Mon Sep 17 00:00:00 2001 From: Herman Lee Date: Mon, 29 Oct 2018 13:49:09 -0700 Subject: [PATCH 179/214] Add retry for CompactFiles call in rocksdb_force_flush_memtable_and_lzero_now Upstream commit ID : fb-mysql-5.6.35/65d61c9acf5f7f7306cced2831cc1710735c08e3 PS-5217 : Merge fb-prod201803 Summary: Updating to the latest rocksdb seems to trigger a race between CompactFiles and the selection of the files to compact more frequently. Add a retry loop to this call. Reviewed By: lth Differential Revision: D12834578 fbshipit-source-id: 65e6eb92560 --- storage/rocksdb/ha_rocksdb.cc | 38 ++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index f07473a90e15..dd5a5ad8d8a0 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -286,29 +286,47 @@ static int rocksdb_force_flush_memtable_and_lzero_now( rocksdb::ColumnFamilyMetaData metadata; rocksdb::ColumnFamilyDescriptor cf_descr; + static constexpr int max_attempts = 3; + int i, num_errors = 0; + for (const auto &cf_handle : cf_manager.get_all_cf()) { - rdb->GetColumnFamilyMetaData(cf_handle, &metadata); - cf_handle->GetDescriptor(&cf_descr); - c_options.output_file_size_limit = cf_descr.options.target_file_size_base; + for (i = 0; i < max_attempts; i++) { + rdb->GetColumnFamilyMetaData(cf_handle, &metadata); + cf_handle->GetDescriptor(&cf_descr); + c_options.output_file_size_limit = cf_descr.options.target_file_size_base; + + DBUG_ASSERT(metadata.levels[0].level == 0); + std::vector file_names; + for (const auto &file : metadata.levels[0].files) { + file_names.emplace_back(file.db_path + file.name); + } - DBUG_ASSERT(metadata.levels[0].level == 0); - std::vector file_names; - for (const auto &file : metadata.levels[0].files) { - file_names.emplace_back(file.db_path + file.name); - } + if (file_names.empty()) { + break; + } - if (!file_names.empty()) { rocksdb::Status s; s = rdb->CompactFiles(c_options, cf_handle, file_names, 1); + // Due to a race, it's possible for CompactFiles to collide + // with auto compaction, causing an error to return + // regarding file not found. In that case, retry. + if (s.IsInvalidArgument()) { + continue; + } + if (!s.ok() && !s.IsAborted()) { rdb_handle_io_error(s, RDB_IO_ERROR_GENERAL); return HA_EXIT_FAILURE; } + break; + } + if (i == max_attempts) { + num_errors++; } } - return HA_EXIT_SUCCESS; + return num_errors == 0 ? HA_EXIT_SUCCESS : HA_EXIT_FAILURE; } static void rocksdb_drop_index_wakeup_thread( From 52a83e005785fd7e229eb60d5ec0f77baea2cc77 Mon Sep 17 00:00:00 2001 From: Manuel Ung Date: Mon, 29 Oct 2018 11:38:48 -0700 Subject: [PATCH 180/214] Move FB error codes to 50000 range Upstream commit ID : fb-mysqli-5.6.35/3ebf6bad4eaeb6ee7fbd3e3dbdab2cc24bdb9855 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Change already applied to source tree through another patch. From 4d0e66b6fe45c0cbea6eda0ade5a50ef87008da2 Mon Sep 17 00:00:00 2001 From: Herman Lee Date: Mon, 29 Oct 2018 17:30:19 -0700 Subject: [PATCH 181/214] Update rocksdb submodule and tests Upstream commit ID : fb-mysql-5.6.35/0b50f7cc792655dfbebf3297e987ad535799a434 PS-5217 : Merge fb-prod201803 This is a NULL cherry-pick to Percona Server 5.7 to create the commit placeholder for the corresponding upstream commit. Reason: Change already applied to source tree through another patch. From 511c6537026c70c46ae74f91ad2003d2385c756f Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Fri, 16 Nov 2018 11:11:03 -0800 Subject: [PATCH 182/214] issue-661 : rocksdb_sys_vars.rocksdb_update_cf_options_basic is unstable (#899) Upstream commit ID : fb-mysql-5.6.35/04d444a49926c91a3f83ae7c442af1e02183ef37 PS-5217 : Merge fb-prod201803 Summary: - Test was failing to reset specific column family options back to their starting point which would cause the test to fail if run with --repeat=2 and the server instance is not restarted. Added harvesting of original cf options and reset on all column families at end of test. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/899 Differential Revision: D13090527 Pulled By: lth fbshipit-source-id: 8d25548ad6d --- .../rocksdb_update_cf_options_basic.result | 4 ++++ .../r/rocksdb_update_cf_options_basic.result | 4 ++++ .../t/rocksdb_update_cf_options_basic.test | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/mysql-test/suite/rocksdb.sys_vars/r-native-partitioning/rocksdb_update_cf_options_basic.result b/mysql-test/suite/rocksdb.sys_vars/r-native-partitioning/rocksdb_update_cf_options_basic.result index 5e4991fe542b..b46adc55f16d 100644 --- a/mysql-test/suite/rocksdb.sys_vars/r-native-partitioning/rocksdb_update_cf_options_basic.result +++ b/mysql-test/suite/rocksdb.sys_vars/r-native-partitioning/rocksdb_update_cf_options_basic.result @@ -108,6 +108,10 @@ ERROR 42000: Variable 'rocksdb_update_cf_options' can't be set to the value of ' SELECT @@global.rocksdb_update_cf_options; @@global.rocksdb_update_cf_options cf1={target_file_size_base=24m};foo={max_bytes_for_level_multiplier=8}; +SET @@global.rocksdb_update_cf_options = 'default={write_buffer_size=67108864;target_file_size_base=67108864};'; +SET @@global.rocksdb_update_cf_options = 'cf1={write_buffer_size=67108864;target_file_size_base=67108864};'; +SET @@global.rocksdb_update_cf_options = 'cf2={write_buffer_size=67108864;target_file_size_base=67108864;max_bytes_for_level_multiplier=10.000000};'; +SET @@global.rocksdb_update_cf_options = 'cf3={write_buffer_size=67108864;target_file_size_base=67108864};'; SET @@global.rocksdb_update_cf_options = NULL; SELECT @@global.rocksdb_update_cf_options; @@global.rocksdb_update_cf_options diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_update_cf_options_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_update_cf_options_basic.result index 689659f920e8..04b987b411d2 100644 --- a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_update_cf_options_basic.result +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_update_cf_options_basic.result @@ -110,6 +110,10 @@ ERROR 42000: Variable 'rocksdb_update_cf_options' can't be set to the value of ' SELECT @@global.rocksdb_update_cf_options; @@global.rocksdb_update_cf_options cf1={target_file_size_base=24m};foo={max_bytes_for_level_multiplier=8}; +SET @@global.rocksdb_update_cf_options = 'default={write_buffer_size=67108864;target_file_size_base=67108864};'; +SET @@global.rocksdb_update_cf_options = 'cf1={write_buffer_size=67108864;target_file_size_base=67108864};'; +SET @@global.rocksdb_update_cf_options = 'cf2={write_buffer_size=67108864;target_file_size_base=67108864;max_bytes_for_level_multiplier=10.000000};'; +SET @@global.rocksdb_update_cf_options = 'cf3={write_buffer_size=67108864;target_file_size_base=67108864};'; SET @@global.rocksdb_update_cf_options = NULL; SELECT @@global.rocksdb_update_cf_options; @@global.rocksdb_update_cf_options diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_update_cf_options_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_update_cf_options_basic.test index 40b1c810fceb..2fdf26e46543 100644 --- a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_update_cf_options_basic.test +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_update_cf_options_basic.test @@ -48,6 +48,11 @@ SELECT @@global.rocksdb_update_cf_options; SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS WHERE CF_NAME='default' AND OPTION_TYPE='WRITE_BUFFER_SIZE'; SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS WHERE CF_NAME='default' AND OPTION_TYPE='TARGET_FILE_SIZE_BASE'; +# Save these off to reset later +--let $ORIG_WRITE_BUFFER_SIZE=`SELECT VALUE FROM INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS WHERE CF_NAME='default' AND OPTION_TYPE='WRITE_BUFFER_SIZE'` +--let $ORIG_TARGET_FILE_SIZE_BASE=`SELECT VALUE FROM INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS WHERE CF_NAME='default' AND OPTION_TYPE='TARGET_FILE_SIZE_BASE'` +--let $ORIG_MAX_BYTES_FOR_LEVEL_MULTIPLIER=`SELECT VALUE FROM INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS WHERE CF_NAME='default' AND OPTION_TYPE='MAX_BYTES_FOR_LEVEL_MULTIPLIER'` + # All good. Use default CF. SET @@global.rocksdb_update_cf_options = 'default={write_buffer_size=8m;target_file_size_base=2m};'; SELECT @@global.rocksdb_update_cf_options; @@ -93,6 +98,12 @@ SELECT * FROM INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS WHERE CF_NAME='cf1' AND OPTI --eval SET @@global.rocksdb_update_cf_options = 'default={foo=bar};'; SELECT @@global.rocksdb_update_cf_options; +# Reset the cf options so the test passes with --repeat=2 +--eval SET @@global.rocksdb_update_cf_options = 'default={write_buffer_size=$ORIG_WRITE_BUFFER_SIZE;target_file_size_base=$ORIG_TARGET_FILE_SIZE_BASE};' +--eval SET @@global.rocksdb_update_cf_options = 'cf1={write_buffer_size=$ORIG_WRITE_BUFFER_SIZE;target_file_size_base=$ORIG_TARGET_FILE_SIZE_BASE};' +--eval SET @@global.rocksdb_update_cf_options = 'cf2={write_buffer_size=$ORIG_WRITE_BUFFER_SIZE;target_file_size_base=$ORIG_TARGET_FILE_SIZE_BASE;max_bytes_for_level_multiplier=$ORIG_MAX_BYTES_FOR_LEVEL_MULTIPLIER};' +--eval SET @@global.rocksdb_update_cf_options = 'cf3={write_buffer_size=$ORIG_WRITE_BUFFER_SIZE;target_file_size_base=$ORIG_TARGET_FILE_SIZE_BASE};' + SET @@global.rocksdb_update_cf_options = NULL; SELECT @@global.rocksdb_update_cf_options; From cd1a0a0cfbd42fb9ad6ceb500dcdfaf9a47ea0dd Mon Sep 17 00:00:00 2001 From: Herman Lee Date: Tue, 20 Nov 2018 16:48:52 -0800 Subject: [PATCH 183/214] Fix assertion whitelist == nullptr for rocksdb_read_free_rpl_tables (#887) Upstream commit ID : fb-mysql-5.6.35/274bad39f0c14aa4fbe5a90bcc320e9897a64e28 PS-5217 : Merge fb-prod201803 Summary: It is valid for NULL to be passed in as an argument for read_free_rpl_tables and skip_unique_check. Handle NULL arguments in these functions by treating it as the default value. Addresses https://github.com/facebook/mysql-5.6/issues/844 Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/887 Differential Revision: D10392551 Pulled By: hermanlee fbshipit-source-id: 18d2c0b2f7b --- .../r/rocksdb_read_free_rpl_tables_basic.result | 2 ++ .../t/rocksdb_read_free_rpl_tables_basic.test | 3 +++ storage/rocksdb/ha_rocksdb.cc | 11 +++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_read_free_rpl_tables_basic.result b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_read_free_rpl_tables_basic.result index b218fe034aaf..db33d2aecdf6 100644 --- a/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_read_free_rpl_tables_basic.result +++ b/mysql-test/suite/rocksdb.sys_vars/r/rocksdb_read_free_rpl_tables_basic.result @@ -61,5 +61,7 @@ SET @@session.ROCKSDB_READ_FREE_RPL_TABLES = @start_session_value; SELECT @@session.ROCKSDB_READ_FREE_RPL_TABLES; @@session.ROCKSDB_READ_FREE_RPL_TABLES +SET GLOBAL ROCKSDB_READ_FREE_RPL_TABLES=NULL; +SET GLOBAL ROCKSDB_READ_FREE_RPL_TABLES=DEFAULT; DROP TABLE valid_values; DROP TABLE invalid_values; diff --git a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_read_free_rpl_tables_basic.test b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_read_free_rpl_tables_basic.test index b5506216c233..c78a86f38a24 100644 --- a/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_read_free_rpl_tables_basic.test +++ b/mysql-test/suite/rocksdb.sys_vars/t/rocksdb_read_free_rpl_tables_basic.test @@ -12,5 +12,8 @@ CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; --let $session=1 --source ../include/rocksdb_sys_var.inc +SET GLOBAL ROCKSDB_READ_FREE_RPL_TABLES=NULL; +SET GLOBAL ROCKSDB_READ_FREE_RPL_TABLES=DEFAULT; + DROP TABLE valid_values; DROP TABLE invalid_values; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index dd5a5ad8d8a0..d7e87188ad54 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -697,11 +697,12 @@ static MYSQL_THDVAR_BOOL( nullptr, nullptr, false); #if defined(ROCKSDB_INCLUDE_RFR) && ROCKSDB_INCLUDE_RFR +#define DEFAULT_READ_FREE_RPL_TABLES "" static MYSQL_THDVAR_STR( read_free_rpl_tables, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, "Regex that describes set of tables that will use read-free replication " "on the slave (i.e. not lookup a row during replication)", - nullptr, nullptr, ""); + nullptr, nullptr, DEFAULT_READ_FREE_RPL_TABLES); #endif // defined(ROCKSDB_INCLUDE_RFR) && ROCKSDB_INCLUDE_RFR static MYSQL_SYSVAR_BOOL( @@ -5951,7 +5952,7 @@ void ha_rocksdb::free_key_buffers() { #if defined(ROCKSDB_INCLUDE_RFR) && ROCKSDB_INCLUDE_RFR void ha_rocksdb::set_use_read_free_rpl(const char *const whitelist) { - DBUG_ASSERT(whitelist != nullptr); + const char *const wl = whitelist ? whitelist : DEFAULT_READ_FREE_RPL_TABLES; #if defined(HAVE_PSI_INTERFACE) Regex regex_handler(key_rwlock_read_free_rpl_tables); @@ -5963,10 +5964,8 @@ void ha_rocksdb::set_use_read_free_rpl(const char *const whitelist) { if (lower_case_table_names) flags |= MY_REG_ICASE; - if (!regex_handler.compile(whitelist, - flags, - table_alias_charset)) { - warn_about_bad_patterns(regex_handler, "read_free_rpl_tables"); + if (!regex_handler.compile(wl, flags, table_alias_charset)) { + warn_about_bad_patterns(regex_handler, "read_free_rpl_tables"); } m_use_read_free_rpl = regex_handler.match(m_tbl_def->base_tablename()); From 0758f5883f0ccb0dc318135508f94a2be6a155ae Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Tue, 27 Nov 2018 13:05:06 -0800 Subject: [PATCH 184/214] issue-896 : Segmentation fault in myrocks::Rdb_string_reader::read (#898) Upstream commit ID : fb-mysql-5.6.35/b3c26480d23616f2f49e73005db1bc1328f055c4 PS-5217 : Merge fb-prod201803 Summary: - Code for skipping ttl bytes for secondary keys is slightly incorrect. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/898 Differential Revision: D13104901 Pulled By: lth fbshipit-source-id: ff48bca7e0e --- mysql-test/suite/rocksdb/r/issue896.result | 19 +++++++++++++++++++ mysql-test/suite/rocksdb/t/issue896.test | 17 +++++++++++++++++ storage/rocksdb/rdb_datadic.cc | 19 ++++++++++++------- 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 mysql-test/suite/rocksdb/r/issue896.result create mode 100644 mysql-test/suite/rocksdb/t/issue896.test diff --git a/mysql-test/suite/rocksdb/r/issue896.result b/mysql-test/suite/rocksdb/r/issue896.result new file mode 100644 index 000000000000..90fd44db34d5 --- /dev/null +++ b/mysql-test/suite/rocksdb/r/issue896.result @@ -0,0 +1,19 @@ +CREATE TABLE `t1` ( +`a` bigint(20) NOT NULL, +`b` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, +`u` bigint(20) unsigned NOT NULL, +`d` bigint(20) DEFAULT NULL, +PRIMARY KEY (`a`,`b`), +KEY `d` (`d`) +) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ttl_duration=1000;ttl_col=u'; +INSERT INTO t1 VALUES (100, 'aaabbb', UNIX_TIMESTAMP(), 200); +EXPLAIN SELECT COUNT(*) FROM t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL d 9 # # 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` +# segfault here without the fix +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +DROP TABLE t1; diff --git a/mysql-test/suite/rocksdb/t/issue896.test b/mysql-test/suite/rocksdb/t/issue896.test new file mode 100644 index 000000000000..3b3bbeb37231 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/issue896.test @@ -0,0 +1,17 @@ +# issue 896 : Segmentation fault in myrocks::Rdb_string_reader::read +--source include/have_rocksdb.inc + +CREATE TABLE `t1` ( +`a` bigint(20) NOT NULL, +`b` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, +`u` bigint(20) unsigned NOT NULL, +`d` bigint(20) DEFAULT NULL, +PRIMARY KEY (`a`,`b`), +KEY `d` (`d`) +) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ttl_duration=1000;ttl_col=u'; +INSERT INTO t1 VALUES (100, 'aaabbb', UNIX_TIMESTAMP(), 200); +--replace_column 9 # 10 # +EXPLAIN SELECT COUNT(*) FROM t1; +--echo # segfault here without the fix +SELECT COUNT(*) FROM t1; +DROP TABLE t1; diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc index 3ee80061211b..becd5c15d9db 100644 --- a/storage/rocksdb/rdb_datadic.cc +++ b/storage/rocksdb/rdb_datadic.cc @@ -1977,17 +1977,22 @@ int Rdb_key_def::unpack_record(TABLE *const table, uchar *const buf, return HA_ERR_ROCKSDB_CORRUPT_DATA; } - // For secondary keys, we expect the value field to contain unpack data and - // checksum data in that order. One or both can be missing, but they cannot - // be reordered. + // For secondary keys, we expect the value field to contain index flags, + // unpack data, and checksum data in that order. One or all can be missing, + // but they cannot be reordered. + if (unp_reader.remaining_bytes()) { + if (m_index_type == INDEX_TYPE_SECONDARY && + m_total_index_flags_length > 0 && + !unp_reader.read(m_total_index_flags_length)) { + return HA_ERR_ROCKSDB_CORRUPT_DATA; + } + } + const char *unpack_header = unp_reader.get_current_ptr(); const bool has_unpack_info = unp_reader.remaining_bytes() && is_unpack_data_tag(unpack_header[0]); if (has_unpack_info) { - if ((m_index_type == INDEX_TYPE_SECONDARY && - m_total_index_flags_length > 0 && - !unp_reader.read(m_total_index_flags_length)) || - !unp_reader.read(get_unpack_header_size(unpack_header[0]))) { + if (!unp_reader.read(get_unpack_header_size(unpack_header[0]))) { return HA_ERR_ROCKSDB_CORRUPT_DATA; } } From f9dd749a0c9c3cc563510ba3cdb5278eb70f50e4 Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Thu, 6 Dec 2018 10:25:33 -0800 Subject: [PATCH 185/214] issue 900 : Segentation fault in myrocks::Rdb_string_reader::read (#910) Upstream commit ID : fb-mysql-5.6.35/6264a3eeea01a84adc0a9602a460f1cf1e4c2564 PS-5217 : Merge fb-prod201803 Summary: - Inplace ALTER TABLE .. ADD UNIQUE during uniqueness checks needs to unpack secondary but code was not passing in unpack info to index->unpack_record. Fixed to pass unpack info (value) to unack_record. - Created simple test that reproduced initial segfault. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/910 Differential Revision: D13243924 Pulled By: lth fbshipit-source-id: 548781a2024 --- mysql-test/suite/rocksdb/r/issue900.result | 9 +++++++++ mysql-test/suite/rocksdb/t/issue900.test | 13 +++++++++++++ storage/rocksdb/ha_rocksdb.cc | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/rocksdb/r/issue900.result create mode 100644 mysql-test/suite/rocksdb/t/issue900.test diff --git a/mysql-test/suite/rocksdb/r/issue900.result b/mysql-test/suite/rocksdb/r/issue900.result new file mode 100644 index 000000000000..d1a4c574b1eb --- /dev/null +++ b/mysql-test/suite/rocksdb/r/issue900.result @@ -0,0 +1,9 @@ +CREATE TABLE t1(c1 VARCHAR(3) CHARACTER SET 'utf8' COLLATE 'utf8_bin', c2 YEAR, c3 REAL(1,0) UNSIGNED, PRIMARY KEY(c1)) ENGINE=RocksDB; +INSERT INTO t1 VALUES(0,'0','0'); +INSERT INTO t1 VALUES('{0}','0','0'); +INSERT INTO t1 VALUES('1','0','1'); +ALTER TABLE t1 ADD INDEX(c3), ADD UNIQUE (c3); +ERROR 23000: Duplicate entry '0' for key 'c3_2' +SELECT c3 FROM t1 FORCE INDEX(c3) ORDER BY c3; +ERROR 42000: Key 'c3' doesn't exist in table 't1' +DROP TABLE t1; diff --git a/mysql-test/suite/rocksdb/t/issue900.test b/mysql-test/suite/rocksdb/t/issue900.test new file mode 100644 index 000000000000..4557a07dfd02 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/issue900.test @@ -0,0 +1,13 @@ +--source include/have_rocksdb.inc + +# Issue 900 : Segmentation fault in myrocks::Rdb_string_reader::read +CREATE TABLE t1(c1 VARCHAR(3) CHARACTER SET 'utf8' COLLATE 'utf8_bin', c2 YEAR, c3 REAL(1,0) UNSIGNED, PRIMARY KEY(c1)) ENGINE=RocksDB; +INSERT INTO t1 VALUES(0,'0','0'); +INSERT INTO t1 VALUES('{0}','0','0'); +INSERT INTO t1 VALUES('1','0','1'); +# Would segfault here +--error ER_DUP_ENTRY +ALTER TABLE t1 ADD INDEX(c3), ADD UNIQUE (c3); +--error ER_KEY_DOES_NOT_EXITS +SELECT c3 FROM t1 FORCE INDEX(c3) ORDER BY c3; +DROP TABLE t1; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index d7e87188ad54..5558b3a6685c 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -11568,7 +11568,7 @@ int ha_rocksdb::inplace_populate_sk( the duplicate record. */ if (index->unpack_record(new_table_arg, new_table_arg->record[0], - &merge_key, nullptr, + &merge_key, &merge_val, m_verify_row_debug_checksums)) { /* Should never reach here */ DBUG_ASSERT(0); From e52091d5370d1260780b99a7e3922fcb7c38db6f Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Thu, 6 Dec 2018 10:27:10 -0800 Subject: [PATCH 186/214] =?UTF-8?q?[mysql-5.6][PR]=20issue-902=20:=20Debug?= =?UTF-8?q?=20assertion=20'max=5Fval=20=3D=3D=20std::numeric=5Flimits::max()' with auto inc manually set > than field limit - Added extra check to see if current auto_inc value is greater than the fields max_value, and if so, return ullong_max instead of trying to find a new value. - Updated autoinc_vars test with a simple sequence that would have hit the debug assertion prior to the fix but now illustrates proper (well, similar to innodb) behavior. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/909 Differential Revision: D13243938 Pulled By: lth fbshipit-source-id: 0c9d0d9312b --- .../suite/rocksdb/r/autoinc_vars.result | 21 +++ mysql-test/suite/rocksdb/t/autoinc_vars.test | 20 +++ storage/rocksdb/ha_rocksdb.cc | 130 +++++++++--------- 3 files changed, 108 insertions(+), 63 deletions(-) diff --git a/mysql-test/suite/rocksdb/r/autoinc_vars.result b/mysql-test/suite/rocksdb/r/autoinc_vars.result index 92e4ebfa3532..a114fe6a6143 100644 --- a/mysql-test/suite/rocksdb/r/autoinc_vars.result +++ b/mysql-test/suite/rocksdb/r/autoinc_vars.result @@ -167,3 +167,24 @@ INSERT INTO t1 (a) VALUES (1); UPDATE t1 SET pk = 3; ALTER TABLE t1 AUTO_INCREMENT 2; DROP TABLE t1; +#---------------------------------- +# Issue #902 Debug assert in autoincrement with small field type +#---------------------------------- +SET auto_increment_increment=100, auto_increment_offset=10; +CREATE TABLE t1(i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB AUTO_INCREMENT=18446744073709551615; +INSERT INTO t1 VALUES (NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +SELECT * FROM t1; +i +ALTER TABLE t1 AUTO_INCREMENT=1; +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +i +10 +ALTER TABLE t1 AUTO_INCREMENT=18446744073709551615; +INSERT INTO t1 VALUES (NULL); +ERROR HY000: Failed to read auto-increment value from storage engine +SELECT * FROM t1; +i +10 +DROP TABLE t1; diff --git a/mysql-test/suite/rocksdb/t/autoinc_vars.test b/mysql-test/suite/rocksdb/t/autoinc_vars.test index 1b48501c542a..d42c2d85e2e7 100644 --- a/mysql-test/suite/rocksdb/t/autoinc_vars.test +++ b/mysql-test/suite/rocksdb/t/autoinc_vars.test @@ -129,3 +129,23 @@ INSERT INTO t1 (a) VALUES (1); UPDATE t1 SET pk = 3; ALTER TABLE t1 AUTO_INCREMENT 2; DROP TABLE t1; + +--echo #---------------------------------- +--echo # Issue #902 Debug assert in autoincrement with small field type +--echo #---------------------------------- + +SET auto_increment_increment=100, auto_increment_offset=10; +CREATE TABLE t1(i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB AUTO_INCREMENT=18446744073709551615; +# ha_rocksdb::get_auto_increment would assert here +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +ALTER TABLE t1 AUTO_INCREMENT=1; +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +ALTER TABLE t1 AUTO_INCREMENT=18446744073709551615; +# ha_rocksdb::get_auto_increment would assert here +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 5558b3a6685c..e6803015a07f 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -10986,73 +10986,77 @@ void ha_rocksdb::get_auto_increment(ulonglong off, ulonglong inc, // The next value can be more complicated if either 'inc' or 'off' is not 1 ulonglong last_val = auto_incr; - // Loop until we can correctly update the atomic value - do { - DBUG_ASSERT(last_val > 0); - // Calculate the next value in the auto increment series: offset - // + N * increment where N is 0, 1, 2, ... - // - // For further information please visit: - // http://dev.mysql.com/doc/refman/5.7/en/replication-options-master.html - // - // The following is confusing so here is an explanation: - // To get the next number in the sequence above you subtract out the - // offset, calculate the next sequence (N * increment) and then add the - // offset back in. - // - // The additions are rearranged to avoid overflow. The following is - // equivalent to (last_val - 1 + inc - off) / inc. This uses the fact - // that (a+b)/c = a/c + b/c + (a%c + b%c)/c. To show why: - // - // (a+b)/c - // = (a - a%c + a%c + b - b%c + b%c) / c - // = (a - a%c) / c + (b - b%c) / c + (a%c + b%c) / c - // = a/c + b/c + (a%c + b%c) / c - // - // Now, substitute a = last_val - 1, b = inc - off, c = inc to get the - // following statement. - ulonglong n = - (last_val - 1) / inc + ((last_val - 1) % inc + inc - off) / inc; - - // Check if n * inc + off will overflow. This can only happen if we have - // an UNSIGNED BIGINT field. - if (n > (std::numeric_limits::max() - off) / inc) { - DBUG_ASSERT(max_val == std::numeric_limits::max()); - // The 'last_val' value is already equal to or larger than the largest - // value in the sequence. Continuing would wrap around (technically - // the behavior would be undefined). What should we do? - // We could: - // 1) set the new value to the last possible number in our sequence - // as described above. The problem with this is that this - // number could be smaller than a value in an existing row. - // 2) set the new value to the largest possible number. This number - // may not be in our sequence, but it is guaranteed to be equal - // to or larger than any other value already inserted. + if (last_val > max_val) { + new_val = std::numeric_limits::max(); + } else { + // Loop until we can correctly update the atomic value + do { + DBUG_ASSERT(last_val > 0); + // Calculate the next value in the auto increment series: offset + // + N * increment where N is 0, 1, 2, ... // - // For now I'm going to take option 2. + // For further information please visit: + // http://dev.mysql.com/doc/refman/5.7/en/replication-options-master.html // - // Returning ULLONG_MAX from get_auto_increment will cause the SQL - // layer to fail with ER_AUTOINC_READ_FAILED. This means that due to - // the SE API for get_auto_increment, inserts will fail with - // ER_AUTOINC_READ_FAILED if the column is UNSIGNED BIGINT, but - // inserts will fail with ER_DUP_ENTRY for other types (or no failure - // if the column is in a non-unique SK). - new_val = std::numeric_limits::max(); - auto_incr = new_val; // Store the largest value into auto_incr - break; - } + // The following is confusing so here is an explanation: + // To get the next number in the sequence above you subtract out the + // offset, calculate the next sequence (N * increment) and then add the + // offset back in. + // + // The additions are rearranged to avoid overflow. The following is + // equivalent to (last_val - 1 + inc - off) / inc. This uses the fact + // that (a+b)/c = a/c + b/c + (a%c + b%c)/c. To show why: + // + // (a+b)/c + // = (a - a%c + a%c + b - b%c + b%c) / c + // = (a - a%c) / c + (b - b%c) / c + (a%c + b%c) / c + // = a/c + b/c + (a%c + b%c) / c + // + // Now, substitute a = last_val - 1, b = inc - off, c = inc to get the + // following statement. + ulonglong n = + (last_val - 1) / inc + ((last_val - 1) % inc + inc - off) / inc; + + // Check if n * inc + off will overflow. This can only happen if we have + // an UNSIGNED BIGINT field. + if (n > (std::numeric_limits::max() - off) / inc) { + DBUG_ASSERT(max_val == std::numeric_limits::max()); + // The 'last_val' value is already equal to or larger than the largest + // value in the sequence. Continuing would wrap around (technically + // the behavior would be undefined). What should we do? + // We could: + // 1) set the new value to the last possible number in our sequence + // as described above. The problem with this is that this + // number could be smaller than a value in an existing row. + // 2) set the new value to the largest possible number. This number + // may not be in our sequence, but it is guaranteed to be equal + // to or larger than any other value already inserted. + // + // For now I'm going to take option 2. + // + // Returning ULLONG_MAX from get_auto_increment will cause the SQL + // layer to fail with ER_AUTOINC_READ_FAILED. This means that due to + // the SE API for get_auto_increment, inserts will fail with + // ER_AUTOINC_READ_FAILED if the column is UNSIGNED BIGINT, but + // inserts will fail with ER_DUP_ENTRY for other types (or no failure + // if the column is in a non-unique SK). + new_val = std::numeric_limits::max(); + auto_incr = new_val; // Store the largest value into auto_incr + break; + } - new_val = n * inc + off; + new_val = n * inc + off; - // Attempt to store the new value (plus 1 since m_auto_incr_val contains - // the next available value) into the atomic value. If the current - // value no longer matches what we have in 'last_val' this will fail and - // we will repeat the loop (`last_val` will automatically get updated - // with the current value). - // - // See above explanation for inc == 1 for why we use std::min. - } while (!auto_incr.compare_exchange_weak(last_val, - std::min(new_val + 1, max_val))); + // Attempt to store the new value (plus 1 since m_auto_incr_val contains + // the next available value) into the atomic value. If the current + // value no longer matches what we have in 'last_val' this will fail and + // we will repeat the loop (`last_val` will automatically get updated + // with the current value). + // + // See above explanation for inc == 1 for why we use std::min. + } while (!auto_incr.compare_exchange_weak( + last_val, std::min(new_val + 1, max_val))); + } } *first_value = new_val; From 5aac19912d816fd974040f696ae99d21d5715c53 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Fri, 11 Jan 2019 10:19:49 +0200 Subject: [PATCH 187/214] Fix PS-240 (Typo in mysqld_safe.sh - trottling should be throttling) Apply patch by Michael Coburn at https://github.com/percona/percona-server/pull/1810 --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 scripts/mysqld_safe.sh diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh old mode 100644 new mode 100755 index d4dc613b84f5..a1841ad978c9 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -1001,7 +1001,7 @@ log_notice "Starting $MYSQLD daemon with databases from $DATADIR" # variable to track the current number of "fast" (a.k.a. subsecond) restarts fast_restart=0 -# maximum number of restarts before trottling kicks in +# maximum number of restarts before throttling kicks in max_fast_restarts=5 # flag whether a usable sleep command exists have_sleep=1 @@ -1067,7 +1067,7 @@ do sleep_state=$? if test $sleep_state -gt 0 then - log_notice "The server is respawning too fast and no working sleep command. Turning off trottling." + log_notice "The server is respawning too fast and no working sleep command. Turning off throttling." have_sleep=0 fi From 3779fed6a7668f41fae23a5a338de1a4505b68d4 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Mon, 14 Jan 2019 15:13:14 +0200 Subject: [PATCH 188/214] Fix PS-5328 (fil0crypt.h:123:7: error: 'memset_s' was not declared in this scope on illumos) memset_s in C11 is only guaranteed to be available if __STDC_LIB_EXT1__ is defined by the implementation and if user defines __STDC_WANT_LIB_EXT1__, which we didn't do. Thus add the latter define to CMake default defines, before the feature checks. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9c24eff4267..9472de4b21f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -520,6 +520,9 @@ ELSE() ENDIF() ENDIF() +# Portably get access to memset_s +ADD_DEFINITIONS(-D__STDC_WANT_LIB_EXT1__=1) + # Run platform tests INCLUDE(configure.cmake) From e673ab20be96ef779602730246e018600345c3c2 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Fri, 11 Jan 2019 15:04:10 +0200 Subject: [PATCH 189/214] Fix PS-2455 (Innodb does not report filename in I/O error message) Apply a patch by Marcelo Altmann at https://github.com/percona/percona-server/pull/2919 which attempts to get the file path from file descriptor through /proc//fd/ symlink, present on Linux. The original patch was changed to extract the /proc-reading code to a separate function, which is used to report not only read but also fsync and fallocate errors. --- storage/innobase/os/os0file.cc | 58 +++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 22d2571cbf6d..ed81d66ea333 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2462,6 +2462,18 @@ SyncFileIO::execute(const IORequest& request) return(n_bytes); } +MY_ATTRIBUTE((warn_unused_result)) +static std::string +os_file_find_path_for_fd( + os_file_t fd) +{ + char fdname[FN_REFLEN]; + snprintf(fdname, sizeof fdname, "/proc/%d/fd/%d", getpid(), fd); + char filename[FN_REFLEN]; + const int err_filename = my_readlink(filename, fdname, MYF(0)); + return std::string((err_filename != -1) ? filename : ""); +} + /** Free storage space associated with a section of the file. @param[in] fh Open file handle @param[in] off Starting offset (SEEK_SET) @@ -2489,11 +2501,20 @@ os_file_punch_hole_posix( return(DB_IO_NO_PUNCH_HOLE); } - ib::warn() - << "fallocate(" << fh - <<", FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, " - << off << ", " << len << ") returned errno: " - << errno; + const std::string fd_path = os_file_find_path_for_fd(fh); + if (!fd_path.empty()) { + ib::warn() + << "fallocate(" << fh << " (" + << fd_path << "), FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, " + << off << ", " << len << ") returned errno: " + << errno; + } else { + ib::warn() + << "fallocate(" << fh + <<", FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, " + << off << ", " << len << ") returned errno: " + << errno; + } return(DB_IO_ERROR); @@ -3490,11 +3511,17 @@ os_file_fsync_posix( os_thread_sleep(200000); break; - case EIO: + case EIO: { - ib::fatal() - << "fsync() returned EIO, aborting."; + const std::string fd_path + = os_file_find_path_for_fd(file); + if (!fd_path.empty()) + ib::fatal() << "fsync(\"" << fd_path + << "\") returned EIO, aborting."; + else + ib::fatal() << "fsync() returned EIO, aborting."; break; + } case EINTR: @@ -6203,9 +6230,18 @@ os_file_read_page( } } - ib::error() << "Tried to read " << n - << " bytes at offset " << offset - << ", but was only able to read " << n_bytes; + const std::string fd_path = os_file_find_path_for_fd(file); + if (!fd_path.empty()) { + ib::error() << "Tried to read " << n + << " bytes at offset " << offset + << ", but was only able to read " << n_bytes + << " of FD " << file + << ", filename " << fd_path; + } else { + ib::error() << "Tried to read " << n + << " bytes at offset " << offset + << ", but was only able to read " << n_bytes; + } if (exit_on_err) { From 9a1d761d5c5277357e7c0068f9768b01ffb1fba9 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Thu, 17 Jan 2019 13:39:55 +0200 Subject: [PATCH 190/214] [PS-5317] Dist upgrade removes packages --- build-ps/debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/build-ps/debian/control b/build-ps/debian/control index a810e557d662..086daedc239e 100644 --- a/build-ps/debian/control +++ b/build-ps/debian/control @@ -175,6 +175,7 @@ Package: percona-server-server-5.7 Architecture: any Pre-Depends: percona-server-common-5.7 (= ${binary:Version}), adduser, + libcurl4-openssl-dev, debconf (>= 0.2.17) Depends: percona-server-client-5.7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, From f3a67ecb1fc75d2290ad2368ce779f82d05852c5 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Thu, 17 Jan 2019 13:44:53 +0200 Subject: [PATCH 191/214] Add build script --- build-ps/percona-server-5.7_builder.sh | 795 +++++++++++++++++++++++++ 1 file changed, 795 insertions(+) create mode 100644 build-ps/percona-server-5.7_builder.sh diff --git a/build-ps/percona-server-5.7_builder.sh b/build-ps/percona-server-5.7_builder.sh new file mode 100644 index 000000000000..c8aea6637221 --- /dev/null +++ b/build-ps/percona-server-5.7_builder.sh @@ -0,0 +1,795 @@ +#!/bin/sh + +shell_quote_string() { + echo "$1" | sed -e 's,\([^a-zA-Z0-9/_.=-]\),\\\1,g' +} + +usage () { + cat <&2 "Current directory cannot be used for building!" + exit 1 + else + if ! test -d "$WORKDIR" + then + echo >&2 "$WORKDIR is not a directory." + exit 1 + fi + fi + return +} + +add_percona_yum_repo(){ + if [ ! -f /etc/yum.repos.d/percona-dev.repo ] + then + curl -o /etc/yum.repos.d/ https://jenkins.percona.com/yum-repo/percona-dev.repo + fi + return +} + +add_percona_apt_repo(){ + if [ ! -f /etc/apt/sources.list.d/percona-dev.list ]; then + curl -o /etc/apt/sources.list.d/ https://jenkins.percona.com/apt-repo/percona-dev.list.template + mv /etc/apt/sources.list.d/percona-dev.list.template /etc/apt/sources.list.d/percona-dev.list + sed -i "s:@@DIST@@:$OS_NAME:g" /etc/apt/sources.list.d/percona-dev.list + fi + + wget -q -O - http://jenkins.percona.com/apt-repo/8507EFA5.pub | sudo apt-key add - + wget -q -O - http://jenkins.percona.com/apt-repo/CD2EFD2A.pub | sudo apt-key add - + return +} + +get_sources(){ + cd "${WORKDIR}" + if [ "${SOURCE}" = 0 ] + then + echo "Sources will not be downloaded" + return 0 + fi + + git clone "$REPO" + retval=$? + if [ $retval != 0 ] + then + echo "There were some issues during repo cloning from github. Please retry one more time" + exit 1 + fi + + cd percona-server + if [ ! -z "$BRANCH" ] + then + git reset --hard + git clean -xdf + git checkout "$BRANCH" + fi + + REVISION=$(git rev-parse --short HEAD) + git reset --hard + # + source VERSION + cat VERSION > ../percona-server-5.7.properties + echo "REVISION=${REVISION}" >> ../percona-server-5.7.properties + BRANCH_NAME="${BRANCH}" + echo "BRANCH_NAME=${BRANCH_NAME}" >> ../percona-server-5.7.properties + export PRODUCT=Percona-Server-${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR} + echo "PRODUCT=Percona-Server-${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}" >> ../percona-server-5.7.properties + export PRODUCT_FULL=${PRODUCT}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA} + echo "PRODUCT_FULL=${PRODUCT}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" >> ../percona-server-5.7.properties + echo "BUILD_NUMBER=${BUILD_NUMBER}" >> ../percona-server-5.7.properties + echo "BUILD_ID=${BUILD_ID}" >> ../percona-server-5.7.properties + echo "PERCONAFT_REPO=${PERCONAFT_REPO}" >> ../percona-server-5.7.properties + echo "PERCONAFT_BRANCH=${PERCONAFT_BRANCH}" >> ../percona-server-5.7.properties + echo "TOKUBACKUP_REPO=${TOKUBACKUP_REPO}" >> ../percona-server-5.7.properties + echo "TOKUBACKUP_BRANCH=${TOKUBACKUP_BRANCH}" >> ../percona-server-5.7.properties + echo "TOKUDB_VERSION=${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" >> ../percona-server-5.7.properties + BOOST_PACKAGE_NAME=$(cat cmake/boost.cmake|grep "SET(BOOST_PACKAGE_NAME"|awk -F '"' '{print $2}') + echo "BOOST_PACKAGE_NAME=${BOOST_PACKAGE_NAME}" >> ../percona-server-5.7.properties + echo "RPM_RELEASE=${RPM_RELEASE}" >> ../percona-server-5.7.properties + echo "DEB_RELEASE=${DEB_RELEASE}" >> ../percona-server-5.7.properties + + if [ -z "${DESTINATION:-}" ]; then + export DESTINATION=experimental + fi + TIMESTAMP=$(date "+%Y%m%d-%H%M%S") + echo "DESTINATION=${DESTINATION}" >> ../percona-server-5.7.properties + echo "UPLOAD=UPLOAD/${DESTINATION}/BUILDS/${PRODUCT}/${PRODUCT_FULL}/${BRANCH_NAME}/${REVISION}/${TIMESTAMP}" >> ../percona-server-5.7.properties + + rm -rf storage/tokudb/PerconaFT + rm -rf plugin/tokudb-backup-plugin/Percona-TokuBackup + git submodule init + git submodule update + rm -rf storage/tokudb/PerconaFT + rm -rf plugin/tokudb-backup-plugin/Percona-TokuBackup + if [ ${PERCONAFT_REPO} = 0 ]; then + PERCONAFT_REPO='' + fi + if [ ${TOKUBACKUP_REPO} = 0 ]; then + TOKUBACKUP_REPO='' + fi + + if [ -z ${PERCONAFT_REPO} -a -z ${TOKUBACKUP_REPO} ]; then + mkdir plugin/tokudb-backup-plugin/Percona-TokuBackup + mkdir storage/tokudb/PerconaFT + git submodule init + git submodule update + cd storage/tokudb/PerconaFT + git fetch origin + git checkout ${PERCONAFT_BRANCH} + if [ ${PERCONAFT_BRANCH} = "master" ]; then + git pull + fi + cd ${WORKDIR}/percona-server + # + cd plugin/tokudb-backup-plugin/Percona-TokuBackup + git fetch origin + git checkout ${TOKUBACKUP_BRANCH} + if [ ${TOKUBACKUP_BRANCH} = "master" ]; then + git pull + fi + cd ${WORKDIR}/percona-server + else + cd storage/tokudb + git clone ${PERCONAFT_REPO} + cd PerconaFT + git checkout ${PERCONAFT_BRANCH} + cd ${WORKDIR}/percona-server + # + cd plugin/tokudb-backup-plugin + git clone ${TOKUBACKUP_REPO} + cd Percona-TokuBackup + git checkout ${TOKUBACKUP_BRANCH} + cd ${WORKDIR}/percona-server + fi + # + git submodule update + cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=${WORKDIR}/build-ps/boost + make dist + # + EXPORTED_TAR=$(basename $(find . -type f -name percona-server*.tar.gz | sort | tail -n 1)) + # + PSDIR=${EXPORTED_TAR%.tar.gz} + rm -fr ${PSDIR} + tar xzf ${EXPORTED_TAR} + rm -f ${EXPORTED_TAR} + # add git submodules because make dist uses git archive which doesn't include them + rsync -av storage/tokudb/PerconaFT ${PSDIR}/storage/tokudb --exclude .git + rsync -av plugin/tokudb-backup-plugin/Percona-TokuBackup ${PSDIR}/plugin/tokudb-backup-plugin --exclude .git + rsync -av storage/rocksdb/rocksdb/ ${PSDIR}/storage/rocksdb/rocksdb --exclude .git + rsync -av storage/rocksdb/third_party/lz4/ ${PSDIR}/storage/rocksdb/third_party/lz4 --exclude .git + rsync -av storage/rocksdb/third_party/zstd/ ${PSDIR}/storage/rocksdb/third_party/zstd --exclude .git + # + cd ${PSDIR} + # set tokudb version - can be seen with show variables like '%version%' + sed -i "1s/^/SET(TOKUDB_VERSION ${TOKUDB_VERSION})\n/" storage/tokudb/CMakeLists.txt + # + sed -i "s:@@PERCONA_VERSION_EXTRA@@:${MYSQL_VERSION_EXTRA#-}:g" build-ps/debian/rules + sed -i "s:@@REVISION@@:${REVISION}:g" build-ps/debian/rules + sed -i "s:@@TOKUDB_BACKUP_VERSION@@:${TOKUDB_VERSION}:g" build-ps/debian/rules + sed -i "s:@@PERCONA_VERSION_EXTRA@@:${MYSQL_VERSION_EXTRA#-}:g" build-ps/debian/rules.notokudb + sed -i "s:@@REVISION@@:${REVISION}:g" build-ps/debian/rules.notokudb + # + sed -i "s:@@PERCONA_VERSION_EXTRA@@:${MYSQL_VERSION_EXTRA#-}:g" build-ps/ubuntu/rules + sed -i "s:@@REVISION@@:${REVISION}:g" build-ps/ubuntu/rules + sed -i "s:@@TOKUDB_BACKUP_VERSION@@:${TOKUDB_VERSION}:g" build-ps/ubuntu/rules + sed -i "s:@@PERCONA_VERSION_EXTRA@@:${MYSQL_VERSION_EXTRA#-}:g" build-ps/ubuntu/rules.notokudb + sed -i "s:@@REVISION@@:${REVISION}:g" build-ps/ubuntu/rules.notokudb + # + sed -i "s:@@MYSQL_VERSION@@:${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}:g" build-ps/percona-server.spec + sed -i "s:@@PERCONA_VERSION@@:${MYSQL_VERSION_EXTRA#-}:g" build-ps/percona-server.spec + sed -i "s:@@REVISION@@:${REVISION}:g" build-ps/percona-server.spec + sed -i "s:@@RPM_RELEASE@@:${RPM_RELEASE}:g" build-ps/percona-server.spec + sed -i "s:@@BOOST_PACKAGE_NAME@@:${BOOST_PACKAGE_NAME}:g" build-ps/percona-server.spec + cd ${WORKDIR}/percona-server + tar --owner=0 --group=0 --exclude=.bzr --exclude=.git -czf ${PSDIR}.tar.gz ${PSDIR} + + mkdir $WORKDIR/source_tarball + mkdir $CURDIR/source_tarball + cp ${PSDIR}.tar.gz $WORKDIR/source_tarball + cp ${PSDIR}.tar.gz $CURDIR/source_tarball + cd $CURDIR + rm -rf percona-server + return +} + +get_system(){ + if [ -f /etc/redhat-release ]; then + RHEL=$(rpm --eval %rhel) + ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g') + OS_NAME="el$RHEL" + OS="rpm" + else + ARCH=$(uname -m) + OS_NAME="$(lsb_release -sc)" + OS="deb" + fi + return +} + +install_deps() { + if [ $INSTALL = 0 ] + then + echo "Dependencies will not be installed" + return; + fi + if [ $( id -u ) -ne 0 ] + then + echo "It is not possible to instal dependencies. Please run as root" + exit 1 + fi + CURPLACE=$(pwd) + + if [ "x$OS" = "xrpm" ]; then + RHEL=$(rpm --eval %rhel) + ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g') + add_percona_yum_repo + yum -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm || true + percona-release enable origin release + yum -y install epel-release + yum -y install git numactl-devel rpm-build gcc-c++ gperf ncurses-devel perl readline-devel openssl-devel jemalloc + yum -y install time zlib-devel libaio-devel bison cmake pam-devel libeatmydata jemalloc-devel + yum -y install perl-Time-HiRes libcurl-devel openldap-devel unzip wget libcurl-devel + yum -y install perl-Env perl-Data-Dumper perl-JSON MySQL-python perl-Digest perl-Digest-MD5 perl-Digest-Perl-MD5 || true + if [ ${RHEL} -lt 7 -a $(uname -m) = x86_64 ]; then + yum -y install percona-devtoolset-gcc percona-devtoolset-gcc-c++ percona-devtoolset-binutils + fi + if [ "x$RHEL" = "x6" ]; then + yum -y install Percona-Server-shared-56 + fi + else + apt-get -y install dirmngr || true + add_percona_apt_repo + apt-get update + apt-get -y install dirmngr || true + apt-get -y install lsb-release wget + export DEBIAN_FRONTEND="noninteractive" + export DIST="$(lsb_release -sc)" + until sudo apt-get update; do + sleep 1 + echo "waiting" + done + apt-get -y purge eatmydata || true + apt-get update + apt-get -y install psmisc + apt-get -y install libsasl2-modules:amd64 || apt-get -y install libsasl2-modules + apt-get -y install dh-systemd || true + apt-get -y install curl bison cmake perl libssl-dev gcc g++ libaio-dev libldap2-dev libwrap0-dev gdb unzip gawk + apt-get -y install lsb-release libmecab-dev libncurses5-dev libreadline-dev libpam-dev zlib1g-dev libcurl4-openssl-dev + apt-get -y install libldap2-dev libnuma-dev libjemalloc-dev libeatmydata libc6-dbg valgrind libjson-perl python-mysqldb libsasl2-dev + + apt-get -y install libmecab2 mecab mecab-ipadic + apt-get -y install build-essential devscripts + apt-get -y install cmake autotools-dev autoconf automake build-essential devscripts debconf debhelper fakeroot + fi + return; +} + +get_tar(){ + TARBALL=$1 + TARFILE=$(basename $(find $WORKDIR/$TARBALL -name 'percona-server*.tar.gz' | sort | tail -n1)) + if [ -z $TARFILE ] + then + TARFILE=$(basename $(find $CURDIR/$TARBALL -name 'percona-server*.tar.gz' | sort | tail -n1)) + if [ -z $TARFILE ] + then + echo "There is no $TARBALL for build" + exit 1 + else + cp $CURDIR/$TARBALL/$TARFILE $WORKDIR/$TARFILE + fi + else + cp $WORKDIR/$TARBALL/$TARFILE $WORKDIR/$TARFILE + fi + return +} + +get_deb_sources(){ + param=$1 + echo $param + FILE=$(basename $(find $WORKDIR/source_deb -name "percona-server*.$param" | sort | tail -n1)) + if [ -z $FILE ] + then + FILE=$(basename $(find $CURDIR/source_deb -name "percona-server*.$param" | sort | tail -n1)) + if [ -z $FILE ] + then + echo "There is no sources for build" + exit 1 + else + cp $CURDIR/source_deb/$FILE $WORKDIR/ + fi + else + cp $WORKDIR/source_deb/$FILE $WORKDIR/ + fi + return +} + +build_srpm(){ + if [ $SRPM = 0 ] + then + echo "SRC RPM will not be created" + return; + fi + if [ "x$OS" = "xdeb" ] + then + echo "It is not possible to build src rpm here" + exit 1 + fi + cd $WORKDIR + get_tar "source_tarball" + rm -fr rpmbuild + ls | grep -v percona-server*.tar.* | xargs rm -rf + mkdir -vp rpmbuild/{SOURCES,SPECS,BUILD,SRPMS,RPMS} + + TARFILE=$(basename $(find . -name 'percona-server-*.tar.gz' | sort | tail -n1)) + NAME=$(echo ${TARFILE}| awk -F '-' '{print $1"-"$2}') + VERSION=$(echo ${TARFILE}| awk -F '-' '{print $3}') + # + SHORTVER=$(echo ${VERSION} | awk -F '.' '{print $1"."$2}') + TMPREL=$(echo ${TARFILE}| awk -F '-' '{print $4}') + RELEASE=${TMPREL%.tar.gz} + # + mkdir -vp rpmbuild/{SOURCES,SPECS,BUILD,SRPMS,RPMS} + # + cd ${WORKDIR}/rpmbuild/SPECS + tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/*.spec' --strip=2 + # + cd ${WORKDIR}/rpmbuild/SOURCES + #wget http://downloads.sourceforge.net/boost/${BOOST_PACKAGE_NAME}.tar.bz2 + wget http://jenkins.percona.com/downloads/boost/${BOOST_PACKAGE_NAME}.tar.gz + tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/rpm/*.patch' --strip=3 + tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/rpm/filter-provides.sh' --strip=3 + tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/rpm/filter-requires.sh' --strip=3 + tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/rpm/mysql_config.sh' --strip=3 + tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/rpm/my_config.h' --strip=3 + # + cd ${WORKDIR} + # + mv -fv ${TARFILE} ${WORKDIR}/rpmbuild/SOURCES + # + rpmbuild -bs --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .generic" rpmbuild/SPECS/percona-server.spec + # + + mkdir -p ${WORKDIR}/srpm + mkdir -p ${CURDIR}/srpm + cp rpmbuild/SRPMS/*.src.rpm ${CURDIR}/srpm + cp rpmbuild/SRPMS/*.src.rpm ${WORKDIR}/srpm + return +} + +build_mecab_lib(){ + MECAB_TARBAL="mecab-0.996.tar.gz" + MECAB_LINK="http://jenkins.percona.com/downloads/mecab/${MECAB_TARBAL}" + MECAB_DIR="${WORKDIR}/${MECAB_TARBAL%.tar.gz}" + MECAB_INSTALL_DIR="${WORKDIR}/mecab-install" + rm -f ${MECAB_TARBAL} + rm -rf ${MECAB_DIR} + rm -rf ${MECAB_INSTALL_DIR} + mkdir ${MECAB_INSTALL_DIR} + wget ${MECAB_LINK} + tar xf ${MECAB_TARBAL} + cd ${MECAB_DIR} + ./configure --with-pic --prefix=/usr + make + make check + make DESTDIR=${MECAB_INSTALL_DIR} install + cd ${WORKDIR} +} + +build_mecab_dict(){ + MECAB_IPADIC_TARBAL="mecab-ipadic-2.7.0-20070801.tar.gz" + MECAB_IPADIC_LINK="http://jenkins.percona.com/downloads/mecab/${MECAB_IPADIC_TARBAL}" + MECAB_IPADIC_DIR="${WORKDIR}/${MECAB_IPADIC_TARBAL%.tar.gz}" + rm -f ${MECAB_IPADIC_TARBAL} + rm -rf ${MECAB_IPADIC_DIR} + wget ${MECAB_IPADIC_LINK} + tar xf ${MECAB_IPADIC_TARBAL} + cd ${MECAB_IPADIC_DIR} + # these two lines should be removed if proper packages are created and used for builds + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MECAB_INSTALL_DIR}/usr/lib + sed -i "/MECAB_DICT_INDEX=\"/c\MECAB_DICT_INDEX=\"${MECAB_INSTALL_DIR}\/usr\/libexec\/mecab\/mecab-dict-index\"" configure + # + ./configure --with-mecab-config=${MECAB_INSTALL_DIR}/usr/bin/mecab-config + make + make DESTDIR=${MECAB_INSTALL_DIR} install + cd ../ + cd ${MECAB_INSTALL_DIR} + if [ -d usr/lib64 ]; then + mv usr/lib64/* usr/lib + fi + cd ${WORKDIR} +} + +build_rpm(){ + if [ $RPM = 0 ] + then + echo "RPM will not be created" + return; + fi + if [ "x$OS" = "xdeb" ] + then + echo "It is not possible to build rpm here" + exit 1 + fi + SRC_RPM=$(basename $(find $WORKDIR/srpm -name 'Percona-Server-*.src.rpm' | sort | tail -n1)) + if [ -z $SRC_RPM ] + then + SRC_RPM=$(basename $(find $CURDIR/srpm -name 'Percona-Server-*.src.rpm' | sort | tail -n1)) + if [ -z $SRC_RPM ] + then + echo "There is no src rpm for build" + echo "You can create it using key --build_src_rpm=1" + exit 1 + else + cp $CURDIR/srpm/$SRC_RPM $WORKDIR + fi + else + cp $WORKDIR/srpm/$SRC_RPM $WORKDIR + fi + cd $WORKDIR + rm -fr rpmbuild + mkdir -vp rpmbuild/{SOURCES,SPECS,BUILD,SRPMS,RPMS} + cp $SRC_RPM rpmbuild/SRPMS/ + + RHEL=$(rpm --eval %rhel) + ARCH=$(echo $(uname -m) | sed -e 's:i686:i386:g') + # + echo "RHEL=${RHEL}" >> percona-server-5.7.properties + echo "ARCH=${ARCH}" >> percona-server-5.7.properties + # + SRCRPM=$(basename $(find . -name '*.src.rpm' | sort | tail -n1)) + mkdir -vp rpmbuild/{SOURCES,SPECS,BUILD,SRPMS,RPMS} + # + mv *.src.rpm rpmbuild/SRPMS + # + if [ ${ARCH} = x86_64 ]; then + if [ ${RHEL} != 7 ]; then + source /opt/percona-devtoolset/enable + fi + fi + + build_mecab_lib + build_mecab_dict + + cd ${WORKDIR} + # + if [ ${ARCH} = x86_64 ]; then + rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM} + else + rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_rocksdb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM} + fi + return_code=$? + if [ $return_code != 0 ]; then + exit $return_code + fi + mkdir -p ${WORKDIR}/rpm + mkdir -p ${CURDIR}/rpm + cp rpmbuild/RPMS/*/*.rpm ${WORKDIR}/rpm + cp rpmbuild/RPMS/*/*.rpm ${CURDIR}/rpm + +} + +build_source_deb(){ + if [ $SDEB = 0 ] + then + echo "source deb package will not be created" + return; + fi + if [ "x$OS" = "xrpm" ] + then + echo "It is not possible to build source deb here" + exit 1 + fi + rm -rf percona-server* + get_tar "source_tarball" + rm -f *.dsc *.orig.tar.gz *.debian.tar.gz *.changes + # + + TARFILE=$(basename $(find . -name 'percona-server-*.tar.gz' | grep -v tokudb | sort | tail -n1)) + + NAME=$(echo ${TARFILE}| awk -F '-' '{print $1"-"$2}') + VERSION=$(echo ${TARFILE}| awk -F '-' '{print $3}') + SHORTVER=$(echo ${VERSION} | awk -F '.' '{print $1"."$2}') + TMPREL=$(echo ${TARFILE}| awk -F '-' '{print $4}') + RELEASE=${TMPREL%.tar.gz} + + NEWTAR=${NAME}-${SHORTVER}_${VERSION}-${RELEASE}.orig.tar.gz + mv ${TARFILE} ${NEWTAR} + + tar xzf ${NEWTAR} + cd ${NAME}-${VERSION}-${RELEASE} + cp -ap build-ps/debian/ . + dch -D unstable --force-distribution -v "${VERSION}-${RELEASE}-${DEB_RELEASE}" "Update to new upstream release Percona Server ${VERSION}-${RELEASE}-1" + dpkg-buildpackage -S + + cd ${WORKDIR} + + mkdir -p $WORKDIR/source_deb + mkdir -p $CURDIR/source_deb + cp *.debian.tar.* $WORKDIR/source_deb + cp *_source.changes $WORKDIR/source_deb + cp *.dsc $WORKDIR/source_deb + cp *.orig.tar.gz $WORKDIR/source_deb + cp *.debian.tar.* $CURDIR/source_deb + cp *_source.changes $CURDIR/source_deb + cp *.dsc $CURDIR/source_deb + cp *.orig.tar.gz $CURDIR/source_deb +} + +build_deb(){ + if [ $DEB = 0 ] + then + echo "source deb package will not be created" + return; + fi + if [ "x$OS" = "xrpm" ] + then + echo "It is not possible to build source deb here" + exit 1 + fi + for file in 'dsc' 'orig.tar.gz' 'changes' 'debian.tar*' + do + get_deb_sources $file + done + cd $WORKDIR + rm -fv *.deb + + export DEBIAN_VERSION="$(lsb_release -sc)" + + DSC=$(basename $(find . -name '*.dsc' | sort | tail -n 1)) + DIRNAME=$(echo ${DSC%-${DEB_RELEASE}.dsc} | sed -e 's:_:-:g') + VERSION=$(echo ${DSC} | sed -e 's:_:-:g' | awk -F'-' '{print $4}') + RELEASE=$(echo ${DSC} | sed -e 's:_:-:g' | awk -F'-' '{print $5}') + ARCH=$(uname -m) + export EXTRAVER=${MYSQL_VERSION_EXTRA#-} + # + echo "ARCH=${ARCH}" >> percona-server-5.7.properties + echo "DEBIAN_VERSION=${DEBIAN_VERSION}" >> percona-server-5.7.properties + echo "VERSION=${VERSION}" >> percona-server-5.7.properties + # + + dpkg-source -x ${DSC} + + cd ${DIRNAME} + # + if [ ${DEBIAN_VERSION} = xenial -o ${DEBIAN_VERSION} = artful -o ${DEBIAN_VERSION} = bionic -o ${DEBIAN_VERSION} = trusty ]; then + rm -rf debian + cp -r build-ps/ubuntu debian + fi + dch -b -m -D "$DEBIAN_VERSION" --force-distribution -v "${VERSION}-${RELEASE}-${DEB_RELEASE}.${DEBIAN_VERSION}" 'Update distribution' + + if [ ${ARCH} != "x86_64" ]; then + rm -f debian/rules + rm -f debian/control + mv debian/rules.notokudb debian/rules + mv debian/control.notokudb debian/control + else + if [ ${DEBIAN_VERSION} != trusty -a ${DEBIAN_VERSION} != xenial -a ${DEBIAN_VERSION} != jessie -a ${DEBIAN_VERSION} != stretch -a ${DEBIAN_VERSION} != artful -a ${DEBIAN_VERSION} != bionic ]; then + gcc47=$(which gcc-4.7 2>/dev/null || true) + if [ -x "${gcc47}" ]; then + export CC=gcc-4.7 + export USE_THIS_GCC_VERSION="-4.7" + export CXX=g++-4.7 + else + export CC=gcc-4.8 + export USE_THIS_GCC_VERSION="-4.8" + export CXX=g++-4.8 + fi + fi + fi + + if [ ${DEBIAN_VERSION} = "xenial" ]; then + sed -i 's/export CFLAGS=/export CFLAGS=-Wno-error=date-time /' debian/rules + sed -i 's/export CXXFLAGS=/export CXXFLAGS=-Wno-error=date-time /' debian/rules + fi + + if [ ${DEBIAN_VERSION} = "stretch" ]; then + sed -i 's/export CFLAGS=/export CFLAGS=-Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-parameter -Wno-error=date-time /' debian/rules + sed -i 's/export CXXFLAGS=/export CXXFLAGS=-Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-parameter -Wno-error=date-time /' debian/rules + fi + + if [ ${DEBIAN_VERSION} = "artful" -o ${DEBIAN_VERSION} = "bionic" ]; then + sed -i 's/export CFLAGS=/export CFLAGS=-Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-parameter -Wno-error=date-time /' debian/rules + sed -i 's/export CXXFLAGS=/export CXXFLAGS=-Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-parameter -Wno-error=date-time /' debian/rules + fi + + dpkg-buildpackage -rfakeroot -uc -us -b + + cd ${WORKDIR} + mkdir -p $CURDIR/deb + mkdir -p $WORKDIR/deb + cp $WORKDIR/*.deb $WORKDIR/deb + cp $WORKDIR/*.deb $CURDIR/deb +} + +build_tarball(){ + if [ $TARBALL = 0 ] + then + echo "Binary tarball will not be created" + return; + fi + get_tar "source_tarball" + cd $WORKDIR + TARFILE=$(basename $(find . -name 'percona-server-*.tar.gz' | sort | tail -n1)) + if [ -f /etc/debian_version ]; then + export OS_RELEASE="$(lsb_release -sc)" + fi + # + if [ -f /etc/redhat-release ]; then + export OS_RELEASE="centos$(lsb_release -sr | awk -F'.' '{print $1}')" + RHEL=$(rpm --eval %rhel) + fi + # + + ARCH=$(uname -m 2>/dev/null||true) + TARFILE=$(basename $(find . -name 'percona-server-*.tar.gz' | sort | grep -v "tools" | tail -n1)) + NAME=$(echo ${TARFILE}| awk -F '-' '{print $1"-"$2}') + VERSION=$(echo ${TARFILE}| awk -F '-' '{print $3}') + # + SHORTVER=$(echo ${VERSION} | awk -F '.' '{print $1"."$2}') + TMPREL=$(echo ${TARFILE}| awk -F '-' '{print $4}') + RELEASE=${TMPREL%.tar.gz} + # + export CFLAGS=$(rpm --eval %{optflags} | sed -e "s|march=i386|march=i686|g") + export CXXFLAGS="${CFLAGS}" + if [ "${YASSL}" = 0 ]; then + if [ -f /etc/redhat-release ]; then + SSL_VER_TMP=$(yum list installed|grep -i openssl|head -n1|awk '{print $2}'|awk -F "-" '{print $1}'|sed 's/\.//g'|sed 's/[a-z]$//') + export SSL_VER=".ssl${SSL_VER_TMP}" + else + SSL_VER_TMP=$(dpkg -l|grep -i libssl|grep -v "libssl\-"|head -n1|awk '{print $2}'|awk -F ":" '{print $1}'|sed 's/libssl/ssl/g'|sed 's/\.//g') + export SSL_VER=".${SSL_VER_TMP}" + fi + fi + + build_mecab_lib + build_mecab_dict + MECAB_INSTALL_DIR="${WORKDIR}/mecab-install" + rm -fr TARGET && mkdir TARGET + rm -rf jemalloc + git clone https://github.com/jemalloc/jemalloc + ( + cd jemalloc + git checkout 3.6.0 + bash autogen.sh + ) + # + rm -fr ${TARFILE%.tar.gz} + tar xzf ${TARFILE} + cd ${TARFILE%.tar.gz} + if [ "${YASSL}" = 1 ]; then + DIRNAME="tarball_yassl" + CMAKE_OPTS="-DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --with-jemalloc=../jemalloc/ --with-yassl --with-mecab="${MECAB_INSTALL_DIR}/usr" ../TARGET + else + CMAKE_OPTS="-DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET + + DIRNAME="tarball" + fi + + + + mkdir -p ${WORKDIR}/${DIRNAME} + mkdir -p ${CURDIR}/${DIRNAME} + cp ../TARGET/*.tar.gz ${WORKDIR}/${DIRNAME} + cp ../TARGET/*.tar.gz ${CURDIR}/${DIRNAME} +} + +#main + +CURDIR=$(pwd) +VERSION_FILE=$CURDIR/percona-server-5.7.properties +args= +WORKDIR= +SRPM=0 +SDEB=0 +RPM=0 +DEB=0 +SOURCE=0 +TARBALL=0 +OS_NAME= +ARCH= +OS= +TOKUBACKUP_REPO= +PERCONAFT_REPO= +INSTALL=0 +RPM_RELEASE=1 +DEB_RELEASE=1 +REVISION=0 +BRANCH="5.7" +RPM_RELEASE=1 +DEB_RELEASE=1 +YASSL=0 +MECAB_INSTALL_DIR="${WORKDIR}/mecab-install" +REPO="git://github.com/percona/percona-server.git" +PRODUCT=Percona-Server-5.7 +MYSQL_VERSION_MAJOR=5 +MYSQL_VERSION_MINOR=7 +MYSQL_VERSION_PATCH=22 +MYSQL_VERSION_EXTRA=-22 +PRODUCT_FULL=Percona-Server-5.7.22-22 +BOOST_PACKAGE_NAME=boost_1_59_0 +PERCONAFT_BRANCH=Percona-Server-5.7.22-22 +TOKUBACKUP_BRANCH=Percona-Server-5.7.22-22 +parse_arguments PICK-ARGS-FROM-ARGV "$@" +if [ ${YASSL} = 1 ]; then + TARBALL=1 +fi + +check_workdir +get_system +install_deps +get_sources +build_tarball +build_srpm +build_source_deb +build_rpm +build_deb \ No newline at end of file From 3dee83e159e3579bee8b396283d20da9247e3c42 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Mon, 21 Jan 2019 15:50:23 +0200 Subject: [PATCH 192/214] Fix PS-5369 (buf_pool_zip_hash mutex declared with buf_pool_zip_free key) Backport a trivial fix [1] from upstream 8.0.14: buf_pool_zip_hash mutex was declared with the wrong key (buf_pool_zip_free). Do not bother with cherry-picking due to fix triviality. [1]: commit 5ce335439e2fe2bda98c2292116f41959cfda8da Author: Rahul Agarkar Date: Wed Sep 26 10:12:25 2018 +0530 Bug#28556539 LOCK_ORDER: CYCLE INVOLVING BUF_POOL_FREE_LIST_MUTEX AND BUF_POOL_ZIP_FREE_MUTEX Problem: The LOCK_ORDER tool reports a cycle in innodb mutex locks because of incorrectly mapped key while creating a mutex. Because of this incorrect mapping, the tool assumes there is a cycle between two mutexes potentially leading to a deadlock. Solution: Replaced the incorrect key with the correct one RB: 20610 Reviewed By: Debarun Banerjee (debarun.banerjee@oracle.com) --- storage/innobase/sync/sync0debug.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index f67eaf092867..4efb6dd35b25 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -1356,7 +1356,7 @@ sync_latch_meta_init() buf_pool_zip_free_mutex_key); LATCH_ADD_MUTEX(BUF_POOL_ZIP_HASH, SYNC_BUF_ZIP_HASH, - buf_pool_zip_free_mutex_key); + buf_pool_zip_hash_mutex_key); LATCH_ADD_MUTEX(BUF_POOL_FLUSH_STATE, SYNC_BUF_FLUSH_STATE, buf_pool_flush_state_mutex_key); From f60b98c711726cdd920d2f6c5872b066c58f4f03 Mon Sep 17 00:00:00 2001 From: "przemyslaw.skibinski@percona.com" Date: Mon, 21 Jan 2019 15:12:03 +0100 Subject: [PATCH 193/214] PS-5330: Protobuf-related compilation failure with GCC 4.8 on Xenial Disable `-DWITH_PROTOBUF=system` for Xenial and gcc-4.8 --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17ee7f3a455c..40523d60d6d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -214,9 +214,6 @@ script: if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"; fi; - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo -E apt-add-repository -y "ppa:jonathonf/mysql"; - fi; - echo --- Update list of packages and download dependencies; if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then @@ -297,6 +294,10 @@ script: -DWITH_INNODB_MEMCACHED=ON "; fi; + `# disable -DWITH_PROTOBUF=system for gcc-4.8 as it causes linking issues`; + if [[ "$CC" == "gcc-4.8" ]]; then + CMAKE_OPT=${CMAKE_OPT/WITH_PROTOBUF=system/WITH_PROTOBUF=bundled}; + fi; `# disable RocksDB for gcc-8 until MyRocks is warning-free`; if [[ "$CC" == "gcc-8" ]]; then NOT_GCC_8=0; else NOT_GCC_8=1; fi; if [[ "$TRAVIS_REPO_SLUG" == "percona/percona-server" ]]; then From 18d13db8536f5bbd164f453ac7257d48ecbba49a Mon Sep 17 00:00:00 2001 From: "George O. Lorch III" Date: Thu, 17 Jan 2019 20:05:35 -0700 Subject: [PATCH 194/214] PS-5331 : Fix instances of 'const char* const name = "foo"' to be 'static const constexpr char name[]= "foo"' - Subject says it all, modernize 'const' to 'constexpr' --- storage/rocksdb/ha_rocksdb.cc | 32 ++++++++++++++++---------------- storage/rocksdb/ha_rocksdb.h | 32 ++++++++++++++++---------------- storage/rocksdb/rdb_datadic.h | 32 ++++++++++++++++---------------- storage/rocksdb/rdb_utils.h | 2 +- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 3645f7770e16..48fa27133990 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -423,22 +423,22 @@ static int rocksdb_validate_set_block_cache_size( ////////////////////////////////////////////////////////////////////////////// // Options definitions ////////////////////////////////////////////////////////////////////////////// -static constexpr ulong RDB_MAX_LOCK_WAIT_SECONDS = 1024 * 1024 * 1024; -static constexpr ulong RDB_MAX_ROW_LOCKS = 1024 * 1024 * 1024; -static constexpr ulong RDB_DEFAULT_ROW_LOCKS = 1024 * 1024; -static constexpr ulong RDB_DEFAULT_BULK_LOAD_SIZE = 1000; -static constexpr ulong RDB_MAX_BULK_LOAD_SIZE = 1024 * 1024 * 1024; -static constexpr size_t RDB_DEFAULT_MERGE_BUF_SIZE = 64 * 1024 * 1024; -static constexpr size_t RDB_MIN_MERGE_BUF_SIZE = 100; -static constexpr size_t RDB_DEFAULT_MERGE_COMBINE_READ_SIZE = 1024 * 1024 * 1024; -static constexpr size_t RDB_MIN_MERGE_COMBINE_READ_SIZE = 100; -static constexpr size_t RDB_DEFAULT_MERGE_TMP_FILE_REMOVAL_DELAY = 0; -static constexpr size_t RDB_MIN_MERGE_TMP_FILE_REMOVAL_DELAY = 0; -static constexpr int64 RDB_DEFAULT_BLOCK_CACHE_SIZE = 512 * 1024 * 1024; -static constexpr int64 RDB_MIN_BLOCK_CACHE_SIZE = 1024; -static constexpr int RDB_MAX_CHECKSUMS_PCT = 100; -static constexpr uint32_t RDB_DEFAULT_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = 60 * 1000 * 1000; -static constexpr ulong RDB_DEADLOCK_DETECT_DEPTH = 50; +static const constexpr ulong RDB_MAX_LOCK_WAIT_SECONDS = 1024 * 1024 * 1024; +static const constexpr ulong RDB_MAX_ROW_LOCKS = 1024 * 1024 * 1024; +static const constexpr ulong RDB_DEFAULT_ROW_LOCKS = 1024 * 1024; +static const constexpr ulong RDB_DEFAULT_BULK_LOAD_SIZE = 1000; +static const constexpr ulong RDB_MAX_BULK_LOAD_SIZE = 1024 * 1024 * 1024; +static const constexpr size_t RDB_DEFAULT_MERGE_BUF_SIZE = 64 * 1024 * 1024; +static const constexpr size_t RDB_MIN_MERGE_BUF_SIZE = 100; +static const constexpr size_t RDB_DEFAULT_MERGE_COMBINE_READ_SIZE = 1024 * 1024 * 1024; +static const constexpr size_t RDB_MIN_MERGE_COMBINE_READ_SIZE = 100; +static const constexpr size_t RDB_DEFAULT_MERGE_TMP_FILE_REMOVAL_DELAY = 0; +static const constexpr size_t RDB_MIN_MERGE_TMP_FILE_REMOVAL_DELAY = 0; +static const constexpr int64 RDB_DEFAULT_BLOCK_CACHE_SIZE = 512 * 1024 * 1024; +static const constexpr int64 RDB_MIN_BLOCK_CACHE_SIZE = 1024; +static const constexpr int RDB_MAX_CHECKSUMS_PCT = 100; +static const constexpr uint32_t RDB_DEFAULT_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = 60 * 1000 * 1000; +static const constexpr ulong RDB_DEADLOCK_DETECT_DEPTH = 50; static long long rocksdb_block_cache_size = RDB_DEFAULT_BLOCK_CACHE_SIZE; static long long rocksdb_sim_cache_size = 0; diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index a316e4334934..36512219a7a1 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -131,7 +131,7 @@ extern const std::string DEFAULT_SYSTEM_CF_NAME; /* This is the name of the hidden primary key for tables with no pk. */ -const char *const HIDDEN_PK_NAME = "HIDDEN_PK_ID"; +const constexpr char HIDDEN_PK_NAME[] = "HIDDEN_PK_ID"; /* Column family name which means "put this index into its own column family". @@ -142,12 +142,12 @@ extern const std::string PER_INDEX_CF_NAME; /* Name for the background thread. */ -const char *const BG_THREAD_NAME = "myrocks-bg"; +const constexpr char BG_THREAD_NAME[] = "myrocks-bg"; /* Name for the drop index thread. */ -const char *const INDEX_THREAD_NAME = "myrocks-index"; +const constexpr char INDEX_THREAD_NAME[] = "myrocks-index"; /* Separator between partition name and the qualifier. Sample usage: @@ -155,7 +155,7 @@ const char *const INDEX_THREAD_NAME = "myrocks-index"; - p0_cfname=foo - p3_tts_col=bar */ -constexpr char RDB_PER_PARTITION_QUALIFIER_NAME_SEP = '_'; +const constexpr char RDB_PER_PARTITION_QUALIFIER_NAME_SEP = '_'; /* Separator between qualifier name and value. Sample usage: @@ -163,29 +163,29 @@ constexpr char RDB_PER_PARTITION_QUALIFIER_NAME_SEP = '_'; - p0_cfname=foo - p3_tts_col=bar */ -constexpr char RDB_QUALIFIER_VALUE_SEP = '='; +const constexpr char RDB_QUALIFIER_VALUE_SEP = '='; /* Separator between multiple qualifier assignments. Sample usage: - p0_cfname=foo;p1_cfname=bar;p2_cfname=baz */ -constexpr char RDB_QUALIFIER_SEP = ';'; +const constexpr char RDB_QUALIFIER_SEP = ';'; /* Qualifier name for a custom per partition column family. */ -const char *const RDB_CF_NAME_QUALIFIER = "cfname"; +const constexpr char RDB_CF_NAME_QUALIFIER[] = "cfname"; /* Qualifier name for a custom per partition ttl duration. */ -const char *const RDB_TTL_DURATION_QUALIFIER = "ttl_duration"; +const constexpr char RDB_TTL_DURATION_QUALIFIER[] = "ttl_duration"; /* Qualifier name for a custom per partition ttl duration. */ -const char *const RDB_TTL_COL_QUALIFIER = "ttl_col"; +const constexpr char RDB_TTL_COL_QUALIFIER[] = "ttl_col"; /* Default, minimal valid, and maximum valid sampling rate values when collecting @@ -215,15 +215,15 @@ const char *const RDB_TTL_COL_QUALIFIER = "ttl_col"; CPU-s and derive the values from there. This however has its own set of problems and we'll choose simplicity for now. */ -constexpr int MAX_BACKGROUND_JOBS = 64; +const constexpr int MAX_BACKGROUND_JOBS = 64; -constexpr int DEFAULT_SUBCOMPACTIONS = 1; -constexpr int MAX_SUBCOMPACTIONS = 64; +const constexpr int DEFAULT_SUBCOMPACTIONS = 1; +const constexpr int MAX_SUBCOMPACTIONS = 64; /* Default value for rocksdb_sst_mgr_rate_bytes_per_sec = 0 (disabled). */ -constexpr uint64_t DEFAULT_SST_MGR_RATE_BYTES_PER_SEC = 0; +const constexpr uint64_t DEFAULT_SST_MGR_RATE_BYTES_PER_SEC = 0; /* Defines the field sizes for serializing XID object to a string representation. @@ -266,8 +266,8 @@ constexpr uint64_t DEFAULT_SST_MGR_RATE_BYTES_PER_SEC = 0; /* Maximum index prefix length in bytes. */ -constexpr uint MAX_INDEX_COL_LEN_LARGE = 3072; -constexpr uint MAX_INDEX_COL_LEN_SMALL = 767; +const constexpr uint MAX_INDEX_COL_LEN_LARGE = 3072; +const constexpr uint MAX_INDEX_COL_LEN_SMALL = 767; /* MyRocks specific error codes. NB! Please make sure that you will update @@ -341,7 +341,7 @@ class Rdb_transaction_impl; class Rdb_writebatch_impl; class Rdb_field_encoder; -const char *const rocksdb_hton_name = "ROCKSDB"; +const constexpr char rocksdb_hton_name[] = "ROCKSDB"; typedef struct _gl_index_id_s { uint32_t cf_id; diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h index a75e4f4761b4..54c6f4cd93ca 100644 --- a/storage/rocksdb/rdb_datadic.h +++ b/storage/rocksdb/rdb_datadic.h @@ -91,51 +91,51 @@ using rdb_index_field_pack_t = void (Rdb_key_def::*)(Rdb_field_packing *fpi, Field *field, uchar *buf, uchar **dst, Rdb_pack_field_context *pack_ctx) const; -const uint RDB_INVALID_KEY_LEN = uint(-1); +const constexpr uint RDB_INVALID_KEY_LEN = uint(-1); /* How much one checksum occupies when stored in the record */ -const size_t RDB_CHECKSUM_SIZE = sizeof(uint32_t); +const constexpr size_t RDB_CHECKSUM_SIZE = sizeof(uint32_t); /* How much the checksum data occupies in record, in total. It is storing two checksums plus 1 tag-byte. */ -const size_t RDB_CHECKSUM_CHUNK_SIZE = 2 * RDB_CHECKSUM_SIZE + 1; +const constexpr size_t RDB_CHECKSUM_CHUNK_SIZE = 2 * RDB_CHECKSUM_SIZE + 1; /* Checksum data starts from CHECKSUM_DATA_TAG which is followed by two CRC32 checksums. */ -const char RDB_CHECKSUM_DATA_TAG = 0x01; +const constexpr char RDB_CHECKSUM_DATA_TAG = 0x01; /* Unpack data is variable length. The header is 1 tag-byte plus a two byte length field. The length field includes the header as well. */ -const char RDB_UNPACK_DATA_TAG = 0x02; -const size_t RDB_UNPACK_DATA_LEN_SIZE = sizeof(uint16_t); -const size_t RDB_UNPACK_HEADER_SIZE = +const constexpr char RDB_UNPACK_DATA_TAG = 0x02; +const constexpr size_t RDB_UNPACK_DATA_LEN_SIZE = sizeof(uint16_t); +const constexpr size_t RDB_UNPACK_HEADER_SIZE = sizeof(RDB_UNPACK_DATA_TAG) + RDB_UNPACK_DATA_LEN_SIZE; /* This header format is 1 tag-byte plus a two byte length field plus a two byte covered bitmap. The length field includes the header size. */ -const char RDB_UNPACK_COVERED_DATA_TAG = 0x03; -const size_t RDB_UNPACK_COVERED_DATA_LEN_SIZE = sizeof(uint16_t); -const size_t RDB_COVERED_BITMAP_SIZE = sizeof(uint16_t); -const size_t RDB_UNPACK_COVERED_HEADER_SIZE = +const constexpr char RDB_UNPACK_COVERED_DATA_TAG = 0x03; +const constexpr size_t RDB_UNPACK_COVERED_DATA_LEN_SIZE = sizeof(uint16_t); +const constexpr size_t RDB_COVERED_BITMAP_SIZE = sizeof(uint16_t); +const constexpr size_t RDB_UNPACK_COVERED_HEADER_SIZE = sizeof(RDB_UNPACK_COVERED_DATA_TAG) + RDB_UNPACK_COVERED_DATA_LEN_SIZE + RDB_COVERED_BITMAP_SIZE; /* Data dictionary index info field sizes. */ -constexpr size_t RDB_SIZEOF_INDEX_INFO_VERSION = sizeof(uint16); -constexpr size_t RDB_SIZEOF_INDEX_TYPE = sizeof(uchar); -constexpr size_t RDB_SIZEOF_KV_VERSION = sizeof(uint16); -constexpr size_t RDB_SIZEOF_INDEX_FLAGS = sizeof(uint32); -constexpr size_t RDB_SIZEOF_AUTO_INCREMENT_VERSION = sizeof(uint16); +const constexpr size_t RDB_SIZEOF_INDEX_INFO_VERSION = sizeof(uint16); +const constexpr size_t RDB_SIZEOF_INDEX_TYPE = sizeof(uchar); +const constexpr size_t RDB_SIZEOF_KV_VERSION = sizeof(uint16); +const constexpr size_t RDB_SIZEOF_INDEX_FLAGS = sizeof(uint32); +const constexpr size_t RDB_SIZEOF_AUTO_INCREMENT_VERSION = sizeof(uint16); // Possible return values for rdb_index_field_unpack_t functions. enum { diff --git a/storage/rocksdb/rdb_utils.h b/storage/rocksdb/rdb_utils.h index b7641600c55a..26ec479f738e 100644 --- a/storage/rocksdb/rdb_utils.h +++ b/storage/rocksdb/rdb_utils.h @@ -147,7 +147,7 @@ namespace myrocks { /* Generic constant. */ -const size_t RDB_MAX_HEXDUMP_LEN = 1000; +const constexpr size_t RDB_MAX_HEXDUMP_LEN = 1000; /* Helper function to get an NULL terminated uchar* out of a given MySQL String. From cb491710d91f12a1dc67d05f518a3020e701d61b Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 22 Jan 2019 19:05:21 +0200 Subject: [PATCH 195/214] PS-1097: audit_log_rotate_on_size - update the definition --- doc/source/management/audit_log_plugin.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/source/management/audit_log_plugin.rst b/doc/source/management/audit_log_plugin.rst index 63f5efbf95f5..add23a1b5c95 100644 --- a/doc/source/management/audit_log_plugin.rst +++ b/doc/source/management/audit_log_plugin.rst @@ -504,7 +504,12 @@ This variable is used to specify which events should be logged. Possible values :vartype: Numeric :default: 0 (don't rotate the log file) -This variable is used to specify the maximum audit log file size. Upon reaching this size the log will be rotated. The rotated log files will be present in the same same directory as the current log file. A sequence number will be appended to the log file name upon rotation. This variable has effect only when :variable:`audit_log_handler` is set to ``FILE``. +This variable specifies the maximum size of the audit log file. Upon reaching +this size, the audit log will be rotated. The rotated log files are present in +the same directory as the current log file. The sequence number is appended to +the log file name upon rotation. For this variable to take effect, set the +:variable:`audit_log_handler` variable to ``FILE`` and the +:variable:`audit_log_rotations` variable to a value greater than zero. .. variable:: audit_log_rotations From def357e540c3c01192c49d32815e3e863c75a2ec Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 22 Jan 2019 19:46:48 +0200 Subject: [PATCH 196/214] PS-5081: innodb_print_lock_wait_timeout_info - add missing variable --- doc/source/diagnostics/innodb_show_status.rst | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/source/diagnostics/innodb_show_status.rst b/doc/source/diagnostics/innodb_show_status.rst index f722bf7d947c..3ab5827441bd 100644 --- a/doc/source/diagnostics/innodb_show_status.rst +++ b/doc/source/diagnostics/innodb_show_status.rst @@ -71,6 +71,40 @@ output. Specifies the number of locks held to print for each |InnoDB| transaction in ``SHOW ENGINE INNODB STATUS``. +.. variable:: innodb_print_lock_wait_timeout_info + + :version 5.7.20-18: Implemented + :cli: Yes + :conf: Yes + :scope: Global + :dyn: Yes + :vartype: Boolean + :default: ``OFF`` + +Makes |InnoDB| to write information about all lock wait timeout errors +into the log file. + +This allows to find out details about the failed transaction, and, most +importantly, the blocking transaction. Query string can be obtained from +:table:`performance_schema.events_statements_current` table, based on the +``PROCESSLIST_ID`` field, which corresponds to ``thread_id`` from the log +output. + +Taking into account that blocking transaction is often a multiple statement +one, folowing query can be used to obtain blocking thread statements history: + +.. code-block:: mysql + + SELECT s.SQL_TEXT FROM performance_schema.events_statements_history s + INNER JOIN performance_schema.threads t ON t.THREAD_ID = s.THREAD_ID + WHERE t.PROCESSLIST_ID = %d + UNION + SELECT s.SQL_TEXT FROM performance_schema.events_statements_current s + INNER JOIN performance_schema.threads t ON t.THREAD_ID = s.THREAD_ID + WHERE t.PROCESSLIST_ID = %d; + +(PROCESSLIST_ID in this example is exactly the thread id from error log +output). Status Variables ================ From e831594a21bf9bb6b399eff5f301820de0bebc1d Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Wed, 23 Jan 2019 16:43:18 +0200 Subject: [PATCH 197/214] Implemented PS-4833 (Merge MySQL 5.7.25) (docs) https://jira.percona.com/browse/PS-4833 *** Updated man pages from MySQL Server 5.7.25 source tarball. *** Updated 'scripts/fill_help_tables.sql' from MySQL Server 5.7.25 source tarball. --- man/comp_err.1 | 4 +- man/innochecksum.1 | 4 +- man/lz4_decompress.1 | 4 +- man/my_print_defaults.1 | 16 +- man/myisam_ftdump.1 | 4 +- man/myisamchk.1 | 19 +- man/myisamlog.1 | 4 +- man/myisampack.1 | 4 +- man/mysql.1 | 52 +- man/mysql.server.1 | 6 +- man/mysql_config.1 | 4 +- man/mysql_config_editor.1 | 4 +- man/mysql_install_db.1 | 54 +- man/mysql_plugin.1 | 4 +- man/mysql_secure_installation.1 | 21 +- man/mysql_ssl_rsa_setup.1 | 4 +- man/mysql_tzinfo_to_sql.1 | 4 +- man/mysql_upgrade.1 | 32 +- man/mysqladmin.1 | 25 +- man/mysqlbinlog.1 | 29 +- man/mysqlcheck.1 | 22 +- man/mysqld.8 | 4 +- man/mysqld_multi.1 | 11 +- man/mysqld_safe.1 | 10 +- man/mysqldump.1 | 26 +- man/mysqlimport.1 | 22 +- man/mysqlpump.1 | 24 +- man/mysqlshow.1 | 22 +- man/mysqlslap.1 | 22 +- man/ndb-common-options.1 | 28 +- man/ndb_blob_tool.1 | 4 +- man/ndb_config.1 | 6 +- man/ndb_cpcd.1 | 4 +- man/ndb_delete_all.1 | 4 +- man/ndb_desc.1 | 4 +- man/ndb_drop_index.1 | 6 +- man/ndb_drop_table.1 | 4 +- man/ndb_error_reporter.1 | 4 +- man/ndb_import.1 | 260 +- man/ndb_index_stat.1 | 4 +- man/ndb_mgm.1 | 6 +- man/ndb_mgmd.8 | 4 +- man/ndb_move_data.1 | 4 +- man/ndb_perror.1 | 6 +- man/ndb_print_backup_file.1 | 4 +- man/ndb_print_file.1 | 4 +- man/ndb_print_frag_file.1 | 4 +- man/ndb_print_schema_file.1 | 4 +- man/ndb_print_sys_file.1 | 4 +- man/ndb_redo_log_reader.1 | 4 +- man/ndb_restore.1 | 9 +- man/ndb_select_all.1 | 4 +- man/ndb_select_count.1 | 4 +- man/ndb_setup.py.1 | 6 +- man/ndb_show_tables.1 | 4 +- man/ndb_size.pl.1 | 4 +- man/ndb_top.1 | 4 +- man/ndb_waiter.1 | 4 +- man/ndbd.8 | 8 +- man/ndbinfo_select_all.1 | 4 +- man/ndbmtd.8 | 4 +- man/perror.1 | 26 +- man/replace.1 | 4 +- man/resolve_stack_dump.1 | 22 +- man/resolveip.1 | 25 +- man/zlib_decompress.1 | 4 +- scripts/fill_help_tables.sql | 5592 ++++++++++++++++--------------- 67 files changed, 3534 insertions(+), 3027 deletions(-) diff --git a/man/comp_err.1 b/man/comp_err.1 index 3511784075f9..66530b8e108d 100644 --- a/man/comp_err.1 +++ b/man/comp_err.1 @@ -2,12 +2,12 @@ .\" Title: \fBcomp_err\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBCOMP_ERR\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBCOMP_ERR\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/innochecksum.1 b/man/innochecksum.1 index faf4cc4bccf0..77b22f390513 100644 --- a/man/innochecksum.1 +++ b/man/innochecksum.1 @@ -2,12 +2,12 @@ .\" Title: \fBinnochecksum\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBINNOCHECKSUM\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBINNOCHECKSUM\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/lz4_decompress.1 b/man/lz4_decompress.1 index e7f8288e4731..4164467d5d31 100644 --- a/man/lz4_decompress.1 +++ b/man/lz4_decompress.1 @@ -2,12 +2,12 @@ .\" Title: \fBlz4_decompress\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBLZ4_DECOMPRESS\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBLZ4_DECOMPRESS\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/my_print_defaults.1 b/man/my_print_defaults.1 index 5ba34a9c920d..7520701c54cb 100644 --- a/man/my_print_defaults.1 +++ b/man/my_print_defaults.1 @@ -2,12 +2,12 @@ .\" Title: \fBmy_print_defaults\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMY_PRINT_DEFAULTS\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMY_PRINT_DEFAULTS\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -123,6 +123,9 @@ d:t:o,/tmp/my_print_defaults\&.trace\&. \fB\-e \fR\fB\fIfile_name\fR\fR .sp Read this option file after the global option file but (on Unix) before the user option file\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -137,6 +140,9 @@ Read this option file after the global option file but (on Unix) before the user \fB\-g \fR\fB\fIsuffix\fR\fR .sp In addition to the groups named on the command line, read groups that have the given suffix\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -158,6 +164,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -172,6 +181,9 @@ utility\&. See \fB\-n\fR .sp Return an empty string\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/myisam_ftdump.1 b/man/myisam_ftdump.1 index a3e4aa19ea3d..a97676220c0f 100644 --- a/man/myisam_ftdump.1 +++ b/man/myisam_ftdump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisam_ftdump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYISAM_FTDUMP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYISAM_FTDUMP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisamchk.1 b/man/myisamchk.1 index 06979ebf4556..ca3bd896f200 100644 --- a/man/myisamchk.1 +++ b/man/myisamchk.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamchk\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYISAMCHK\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYISAMCHK\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -314,6 +314,9 @@ d:t:o,/tmp/myisamchk\&.trace\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -329,6 +332,9 @@ is interpreted relative to the current directory if given as a relative path nam Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -353,6 +359,9 @@ option is given, also reads the [myisamchk_other] group\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -378,6 +387,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -391,6 +403,9 @@ utility\&. See \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/myisamlog.1 b/man/myisamlog.1 index 76fd6dfd1621..cc4a6d8a8772 100644 --- a/man/myisamlog.1 +++ b/man/myisamlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYISAMLOG\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYISAMLOG\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisampack.1 b/man/myisampack.1 index a1a509baea10..99db81c4bf22 100644 --- a/man/myisampack.1 +++ b/man/myisampack.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisampack\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYISAMPACK\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYISAMPACK\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql.1 b/man/mysql.1 index d88a45e889f7..92c3000af662 100644 --- a/man/mysql.1 +++ b/man/mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -mysql \- the MySQL command\-line tool +mysql \- the MySQL command\-line client .SH "SYNOPSIS" .HP \w'\fBmysql\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIdb_name\fR\fR\ 'u \fBmysql [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR @@ -115,8 +115,8 @@ shell> \fBmysql \fR\fB\fIdb_name\fR\fR\fB < \fR\fB\fIscript\&.sql\fR\fR\fB > \fR On Unix, the \fBmysql\fR client logs statements executed interactively to a history file\&. See -the section called \(lqMYSQL LOGGING\(rq\&. -.SH "MYSQL OPTIONS" +the section called \(lqMYSQL CLIENT LOGGING\(rq\&. +.SH "MYSQL CLIENT OPTIONS" .PP \fBmysql\fR supports the following options, which can be specified on the command line or in the @@ -514,6 +514,9 @@ Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -533,6 +536,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -561,6 +567,9 @@ also reads the and [mysql_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -593,7 +602,7 @@ form only, or use named commands only at the beginning of a line ending with a s starts with this option \fIenabled\fR by default\&. However, even with this option, long\-format commands still work from the first line\&. See -the section called \(lqMYSQL COMMANDS\(rq\&. +the section called \(lqMYSQL CLIENT COMMANDS\(rq\&. .RE .sp .RS 4 @@ -688,7 +697,7 @@ syslog if the \fB\-\-syslog\fR option is given\&. For more information, see -the section called \(lqMYSQL LOGGING\(rq\&. +the section called \(lqMYSQL CLIENT LOGGING\(rq\&. .RE .sp .RS 4 @@ -805,6 +814,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -827,7 +839,7 @@ and both are recognized\&. Use \fB\-\-skip\-named\-commands\fR to disable named commands\&. See -the section called \(lqMYSQL COMMANDS\(rq\&. +the section called \(lqMYSQL CLIENT COMMANDS\(rq\&. .RE .sp .RS 4 @@ -883,6 +895,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1004,7 +1019,7 @@ environment variable\&. Valid pagers are \fBmore\fR, \fBcat [> filename]\fR, and so forth\&. This option works only on Unix and only in interactive mode\&. To disable paging, use \fB\-\-skip\-pager\fR\&. -the section called \(lqMYSQL COMMANDS\(rq, discusses output paging further\&. +the section called \(lqMYSQL CLIENT COMMANDS\(rq, discusses output paging further\&. .RE .sp .RS 4 @@ -1091,6 +1106,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1105,7 +1123,7 @@ Print the program name and all options that it gets from option files\&. .sp Set the prompt to the specified format\&. The default is mysql>\&. The special sequences that the prompt can contain are described in -the section called \(lqMYSQL COMMANDS\(rq\&. +the section called \(lqMYSQL CLIENT COMMANDS\(rq\&. .RE .sp .RS 4 @@ -1451,7 +1469,7 @@ Mar 7 12:39:28 myhost MysqlClient[20824]: .\} .sp For more information, see -the section called \(lqMYSQL LOGGING\(rq\&. +the section called \(lqMYSQL CLIENT LOGGING\(rq\&. .sp The \fB\-\-syslog\fR @@ -1483,7 +1501,7 @@ Display output in table format\&. This is the default for interactive use, but c \fB\-\-tee=\fR\fB\fIfile_name\fR\fR .sp Append a copy of output to the given file\&. This option works only in interactive mode\&. -the section called \(lqMYSQL COMMANDS\(rq, discusses tee files further\&. +the section called \(lqMYSQL CLIENT COMMANDS\(rq, discusses tee files further\&. .RE .sp .RS 4 @@ -1727,7 +1745,7 @@ SELECT statements when using \fB\-\-safe\-updates\fR\&. (Default value is 1,000\&.) .RE -.SH "MYSQL COMMANDS" +.SH "MYSQL CLIENT COMMANDS" .PP \fBmysql\fR sends each SQL statement that you issue to the server to be executed\&. There is also a set of commands that @@ -1824,7 +1842,7 @@ help command, \fBmysql\fR uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. For more information, see -the section called \(lqMYSQL SERVER\-SIDE HELP\(rq\&. +the section called \(lqMYSQL CLIENT SERVER\-SIDE HELP\(rq\&. .RE .sp .RS 4 @@ -2792,7 +2810,7 @@ mysql> .RE .\} .RE -.SH "MYSQL LOGGING" +.SH "MYSQL CLIENT LOGGING" .PP The \fBmysql\fR @@ -3200,7 +3218,7 @@ Mar 7 12:39:28 myhost MysqlClient[20824]: .if n \{\ .RE .\} -.SH "MYSQL SERVER\-SIDE HELP" +.SH "MYSQL CLIENT SERVER\-SIDE HELP" .sp .if n \{\ .RS 4 @@ -3440,7 +3458,7 @@ with an option such as .PP For more information about batch mode, see Section\ \&3.5, \(lqUsing mysql in Batch Mode\(rq\&. -.SH "MYSQL TIPS" +.SH "MYSQL CLIENT TIPS" .PP This section describes some techniques that can help you use \fBmysql\fR diff --git a/man/mysql.server.1 b/man/mysql.server.1 index b5f02b3725cd..7e5a10fa66f9 100644 --- a/man/mysql.server.1 +++ b/man/mysql.server.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql.server\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL\&.SERVER\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL\&.SERVER\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -374,7 +374,7 @@ The path to the MySQL data directory\&. .\} \fBpid\-file=\fR\fB\fIfile_name\fR\fR .sp -The path name of the file in which the server should write its process ID\&. +The path name of the file in which the server should write its process ID\&. The server creates the file in the data directory unless an absolute path name is given to specify a different directory\&. .sp If this option is not given, \fBmysql\&.server\fR diff --git a/man/mysql_config.1 b/man/mysql_config.1 index b1c0bea19014..8ad21d5a7920 100644 --- a/man/mysql_config.1 +++ b/man/mysql_config.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_CONFIG\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_config_editor.1 b/man/mysql_config_editor.1 index de1f35e60e9c..ce0e83ad6353 100644 --- a/man/mysql_config_editor.1 +++ b/man/mysql_config_editor.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config_editor\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG_EDITOR\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_CONFIG_EDITOR\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_install_db.1 b/man/mysql_install_db.1 index b6e4ce4ea091..4dc48542fb79 100644 --- a/man/mysql_install_db.1 +++ b/man/mysql_install_db.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_install_db\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_INSTALL_DB\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_INSTALL_DB\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -689,10 +689,6 @@ passes unrecognized options to \fB\-?\fR .sp Display a help message and exit\&. -.sp -The -\fB\-?\fR -form of this option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -707,8 +703,6 @@ form of this option was added in MySQL 5\&.7\&.5\&. .sp The authentication plugin to use for the administrative account\&. The default is mysql_native_password\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -725,8 +719,6 @@ The host part to use for the adminstrative account name\&. The default is localhost\&. This option is ignored if \fB\-\-login\-path\fR is also specified\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -744,8 +736,6 @@ Whether to require SSL for the administrative account\&. The default is not to r uses to create the account includes a REQUIRE SSL clause\&. As a result, the administrative account must use secure connections when connecting to the server\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -762,8 +752,6 @@ The user part to use for the adminstrative account name\&. The default is root\&. This option is ignored if \fB\-\-login\-path\fR is also specified\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -864,10 +852,6 @@ passes \fB\-\-no\-defaults\fR to \fBmysqld\fR, to prevent option files from being read\&. This may help if program startup fails due to reading unknown options from an option file\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. (Before 5\&.7\&.5, only the -\fB\-\-no\-defaults\fR -variant was supported\&.) .RE .sp .RS 4 @@ -888,6 +872,9 @@ This option is passed by \fBmysql_install_db\fR to \fBmysqld\fR\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -908,6 +895,9 @@ This option is passed by \fBmysql_install_db\fR to \fBmysqld\fR\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -924,8 +914,6 @@ to This option names a file containing additional SQL statements to be executed after the standard bootstrapping statements\&. Accepted statement syntax in the file is like that of the \fBmysql\fR command\-line client, including support for multiple\-line C\-style comments and delimiter handling to enable definition of stored programs\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1037,8 +1025,6 @@ en_US\&. The argument is converted to a language name and combined with the valu \fB\-\-lc\-messages\-dir\fR to produce the location for the error message file\&. See Section\ \&10.11, \(lqSetting the Error Message Language\(rq\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1055,8 +1041,6 @@ The directory where error messages are located\&. The value is used together wit \fB\-\-lc\-messages\fR to produce the location for the error message file\&. See Section\ \&10.11, \(lqSetting the Error Message Language\(rq\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1089,8 +1073,6 @@ The file from which to read the login path if the \fB\-\-login\-path=\fR\fB\fIfile_name\fR\fR option is specified\&. The default file is \&.mylogin\&.cnf\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1126,7 +1108,8 @@ and \fB\-\-admin\-user\fR options are ignored\&. .sp -This option was added in MySQL 5\&.7\&.5\&. +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1225,8 +1208,6 @@ In /opt/local/bin, /opt/local/sbin\&. .RE -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1243,6 +1224,9 @@ Before MySQL 5\&.7\&.5, do not read any option files\&. If program startup fails \fB\-\-no\-defaults\fR can be used to prevent them from being read\&. For behavior of this option as of MySQL 5\&.7\&.5, see the description of \fB\-\-defaults\fR\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1257,8 +1241,6 @@ can be used to prevent them from being read\&. For behavior of this option as of .sp The path name of the file in which to write the randomly generated password for the administrative account\&. The option value must be an absolute path name or an error occurs\&. The default is $HOME/\&.mysql_secret\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1613,10 +1595,6 @@ root user to use this option\&. By default, \fBmysqld\fR runs using your current login name and files and directories that it creates will be owned by you\&. -.sp -The -\fB\-u\fR -form of this option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1635,10 +1613,6 @@ Verbose mode\&. Print more information about what the program does\&. You can us command that \fBmysql_install_db\fR invokes to start the server in bootstrap mode\&. -.sp -The -\fB\-v\fR -form of this option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 @@ -1653,8 +1627,6 @@ form of this option was added in MySQL 5\&.7\&.5\&. \fB\-V\fR .sp Display version information and exit\&. -.sp -This option was added in MySQL 5\&.7\&.5\&. .RE .sp .RS 4 diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1 index 13d668371e9e..9336bf2bb3f1 100644 --- a/man/mysql_plugin.1 +++ b/man/mysql_plugin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_plugin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_PLUGIN\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_PLUGIN\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_secure_installation.1 b/man/mysql_secure_installation.1 index 3a66ec197b57..ccbf08347a04 100644 --- a/man/mysql_secure_installation.1 +++ b/man/mysql_secure_installation.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_secure_installation\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_SECURE_INSTALLATION\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_SECURE_INSTALLATION\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -166,6 +166,9 @@ Display a help message and exit\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -181,6 +184,9 @@ is interpreted relative to the current directory if given as a relative path nam Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -209,6 +215,9 @@ also reads the and [mysql_secure_installation_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -248,6 +257,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -291,6 +303,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -364,7 +379,7 @@ This option was added in MySQL 5\&.7\&.10\&. .\} \fB\-\-use\-default\fR .sp -Execute noninteractively\&. This option can be used for unattended installation operations\&. This option was added in MySQL 5\&.7\&.4\&. +Execute noninteractively\&. This option can be used for unattended installation operations\&. .RE .sp .RS 4 diff --git a/man/mysql_ssl_rsa_setup.1 b/man/mysql_ssl_rsa_setup.1 index bd3dcd6b0946..4bfa7e1e52c8 100644 --- a/man/mysql_ssl_rsa_setup.1 +++ b/man/mysql_ssl_rsa_setup.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_ssl_rsa_setup\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_SSL_RSA_SETUP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_SSL_RSA_SETUP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_tzinfo_to_sql.1 b/man/mysql_tzinfo_to_sql.1 index 6c33b7d04c2e..4c16a61f1bed 100644 --- a/man/mysql_tzinfo_to_sql.1 +++ b/man/mysql_tzinfo_to_sql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_tzinfo_to_sql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_TZINFO_TO_SQL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_TZINFO_TO_SQL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index 8f9cc44d1aca..3c3de7e195de 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_upgrade\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -444,7 +444,7 @@ The path to the MySQL installation directory\&. This option was removed in MySQL .\} \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. This option was added in MySQL 5\&.7\&.5\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .RE .sp .RS 4 @@ -472,9 +472,7 @@ Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&. \fB\-\-compress\fR, \fB\-C\fR .sp -Compress all information sent between the client and the server if both support compression\&. The -\fB\-C\fR -form of this option was added in MySQL 5\&.7\&.5\&. +Compress all information sent between the client and the server if both support compression\&. .RE .sp .RS 4 @@ -578,6 +576,9 @@ Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -593,6 +594,9 @@ is interpreted relative to the current directory if given as a relative path nam Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -621,6 +625,9 @@ also reads the and [mysql_upgrade_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -672,6 +679,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -684,7 +694,7 @@ utility\&. See .\} \fB\-\-max\-allowed\-packet=\fR\fB\fIvalue\fR\fR .sp -The maximum size of the buffer for client/server communication\&. The default value is 24MB\&. The minimum and maximum values are 4KB and 2GB\&. This option was added in MySQL 5\&.7\&.5\&. +The maximum size of the buffer for client/server communication\&. The default value is 24MB\&. The minimum and maximum values are 4KB and 2GB\&. .RE .sp .RS 4 @@ -723,6 +733,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -853,13 +866,12 @@ option to enable shared\-memory connections\&. .\} \fB\-\-skip\-sys\-schema\fR .sp -As of MySQL 5\&.7\&.7, \fBmysql_upgrade\fR installs the sys schema if it is not installed, and upgrades it to the current version otherwise\&. The \fB\-\-skip\-sys\-schema\fR -option suppresses this behavior\&. This option was added in MySQL 5\&.7\&.7\&. +option suppresses this behavior\&. .RE .sp .RS 4 @@ -983,7 +995,7 @@ is connecting to verify that it is the same as the version for which was built\&. If not, \fBmysql_upgrade\fR exits\&. This option is enabled by default; to disable the check, use -\fB\-\-skip\-version\-check\fR\&. This option was added in MySQL 5\&.7\&.2\&. +\fB\-\-skip\-version\-check\fR\&. .RE .sp .RS 4 diff --git a/man/mysqladmin.1 b/man/mysqladmin.1 index f8c7a0628556..b5ad8b42f188 100644 --- a/man/mysqladmin.1 +++ b/man/mysqladmin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqladmin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLADMIN\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLADMIN\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -124,7 +124,8 @@ Display the server status variables and their values\&. .\} flush\-hosts .sp -Flush all information in the host cache\&. +Flush all information in the host cache\&. See +Section\ \&8.12.5.2, \(lqDNS Lookup Optimization and the Host Cache\(rq\&. .RE .sp .RS 4 @@ -763,6 +764,9 @@ Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -782,6 +786,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -810,6 +817,9 @@ also reads the and [mysqladmin_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -905,6 +915,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -944,6 +957,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1030,6 +1046,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1 index 663197230dd7..920cde80d421 100644 --- a/man/mysqlbinlog.1 +++ b/man/mysqlbinlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbinlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -152,6 +152,11 @@ TMPDIR environment variable\&. .PP \fBmysqlbinlog\fR +sets the value of +pseudo_slave_mode +to true before executing any SQL statements\&. +.PP +\fBmysqlbinlog\fR supports the following options, which can be specified on the command line or in the [mysqlbinlog] and @@ -598,6 +603,9 @@ Section\ \&6.3.9, \(lqPluggable Authentication\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -617,6 +625,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -645,6 +656,9 @@ also reads the and [mysqlbinlog_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -858,6 +872,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -883,6 +900,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -971,6 +991,9 @@ The TCP/IP port number to use for connecting to a remote server\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1828,7 +1851,7 @@ The hex output consists of comment lines beginning with .RS 4 .\} .nf -/*!40019 SET @@session\&.max_insert_delayed_threads=0*/; +/*!40019 SET @@SESSION\&.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; # at 4 #051024 17:24:13 server id 1 end_log_pos 98 diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1 index 6b8f4434b697..4099a7916cc4 100644 --- a/man/mysqlcheck.1 +++ b/man/mysqlcheck.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlcheck\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLCHECK\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLCHECK\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -445,6 +445,9 @@ Section\ \&10.14, \(lqCharacter Set Configuration\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -464,6 +467,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -492,6 +498,9 @@ also reads the and [mysqlcheck_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -661,6 +670,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -702,6 +714,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -802,6 +817,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/mysqld.8 b/man/mysqld.8 index 42334ec45340..fc4801a41934 100644 --- a/man/mysqld.8 +++ b/man/mysqld.8 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLD\FR" "8" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLD\FR" "8" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1 index 7645a69b29a2..7b64826d0baa 100644 --- a/man/mysqld_multi.1 +++ b/man/mysqld_multi.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_multi\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLD_MULTI\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLD_MULTI\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -75,7 +75,7 @@ to specify which servers you want to start, stop, or obtain a status report for\ group used for starting \fBmysqld\fR\&. (See, for example, Section\ \&2.10.5, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see -Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&. +Section\ \&5.7, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&. .PP To invoke \fBmysqld_multi\fR, use the following syntax: @@ -201,6 +201,9 @@ Otherwise, option files in the standard list of locations are read, including an option, if one is given\&. (If the option is given multiple times, the last value is used\&.) .RE .PP +For additional information about these and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +.PP Option files read are searched for [mysqld_multi] and @@ -452,7 +455,7 @@ servers with the same data directory\&. Use separate data directories, unless yo what you are doing\&. Starting multiple servers with the same data directory does \fInot\fR give you extra performance in a threaded system\&. See -Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&. +Section\ \&5.7, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&. .if n \{\ .sp .\} diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1 index f7434ebe3bb4..85e8c194cfab 100644 --- a/man/mysqld_safe.1 +++ b/man/mysqld_safe.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_safe\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLD_SAFE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLD_SAFE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -192,7 +192,7 @@ Read this option file in addition to the usual option files\&. If the file does \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. This must be the first option on the command line if it is used\&. .sp -For additional information about this option, see +For additional information about this and other option\-file options, see Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp @@ -210,7 +210,7 @@ Use only the given option file\&. If the file does not exist or is otherwise ina \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. This must be the first option on the command line if it is used\&. .sp -For additional information about this option, see +For additional information about this and other option\-file options, see Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp @@ -594,7 +594,7 @@ Do not read any option files\&. If program startup fails due to reading unknown \fB\-\-no\-defaults\fR can be used to prevent them from being read\&. This must be the first option on the command line if it is used\&. .sp -For additional information about this option, see +For additional information about this and other option\-file options, see Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp diff --git a/man/mysqldump.1 b/man/mysqldump.1 index 9bf287ea77ff..d2d370e4dca1 100644 --- a/man/mysqldump.1 +++ b/man/mysqldump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLDUMP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLDUMP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -531,6 +531,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -807,6 +810,9 @@ These options are used to control which option files to read\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -826,6 +832,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -854,6 +863,9 @@ also reads the and [mysqldump_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -879,6 +891,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -892,6 +907,9 @@ utility\&. See \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE DDL Options.PP Usage scenarios for @@ -1551,7 +1569,7 @@ and causes it to be ignored if both options are used\&. \fB\-\-set\-gtid\-purged=\fR\fB\fIvalue\fR\fR .sp This option enables control over global transaction ID (GTID) information written to the dump file, by indicating whether to add a -SET @@global\&.gtid_purged +SET @@GLOBAL\&.gtid_purged statement to the output\&. This option may also cause a statement to be written to the output that disables binary logging while the dump file is being reloaded\&. .sp The following table shows the permitted option values\&. The default value is @@ -1993,7 +2011,7 @@ The output from the client when run using the \fB\-\-xml\fR option also follows the preceding rules\&. (See -the section called \(lqMYSQL OPTIONS\(rq\&.) +the section called \(lqMYSQL CLIENT OPTIONS\(rq\&.) .sp XML output from \fBmysqldump\fR diff --git a/man/mysqlimport.1 b/man/mysqlimport.1 index 44d7a897c645..5d8a035f1e97 100644 --- a/man/mysqlimport.1 +++ b/man/mysqlimport.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlimport\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLIMPORT\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLIMPORT\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -232,6 +232,9 @@ Section\ \&6.3.9, \(lqPluggable Authentication\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -251,6 +254,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -279,6 +285,9 @@ also reads the and [mysqlimport_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -490,6 +499,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -533,6 +545,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -619,6 +634,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/mysqlpump.1 b/man/mysqlpump.1 index f8c36fb31116..6d4415ff883e 100644 --- a/man/mysqlpump.1 +++ b/man/mysqlpump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlpump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLPUMP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLPUMP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -762,6 +762,9 @@ shell> \fBmysqlpump \-\-single\-transaction \-\-default\-parallelism=0\fR Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -781,6 +784,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -809,6 +815,9 @@ also reads the and [mysqlpump_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1179,6 +1188,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1271,6 +1283,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1372,6 +1387,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1544,7 +1562,7 @@ statement, use \fB\-\-set\-gtid\-purged=\fR\fB\fIvalue\fR\fR .sp This option enables control over global transaction ID (GTID) information written to the dump file, by indicating whether to add a -SET @@global\&.gtid_purged +SET @@GLOBAL\&.gtid_purged statement to the output\&. This option may also cause a statement to be written to the output that disables binary logging while the dump file is being reloaded\&. .sp The following table shows the permitted option values\&. The default value is diff --git a/man/mysqlshow.1 b/man/mysqlshow.1 index 0dd9d33fb2df..7e486c189b9d 100644 --- a/man/mysqlshow.1 +++ b/man/mysqlshow.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlshow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLSHOW\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLSHOW\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -278,6 +278,9 @@ Section\ \&6.3.9, \(lqPluggable Authentication\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -297,6 +300,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -325,6 +331,9 @@ also reads the and [mysqlshow_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -420,6 +429,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -445,6 +457,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -531,6 +546,9 @@ The TCP/IP port number to use for the connection\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/mysqlslap.1 b/man/mysqlslap.1 index 18ab7d84cbdc..58788396d22b 100644 --- a/man/mysqlslap.1 +++ b/man/mysqlslap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlslap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBMYSQLSLAP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBMYSQLSLAP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -484,6 +484,9 @@ Section\ \&6.3.9, \(lqPluggable Authentication\(rq\&. Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. \fIfile_name\fR is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -503,6 +506,9 @@ is interpreted relative to the current directory if given as a relative path nam Exception: Even with \fB\-\-defaults\-file\fR, client programs read \&.mylogin\&.cnf\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -531,6 +537,9 @@ also reads the and [mysqlslap_other] groups\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -667,6 +676,9 @@ is an option group containing options that specify which MySQL server to connect \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -707,6 +719,9 @@ is created by the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&.) +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -928,6 +943,9 @@ before running the tests\&. This execution is not counted for timing purposes\&. \fB\-\-print\-defaults\fR .sp Print the program name and all options that it gets from option files\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/ndb-common-options.1 b/man/ndb-common-options.1 index 29089ef5c9fc..6ff07e233559 100644 --- a/man/ndb-common-options.1 +++ b/man/ndb-common-options.1 @@ -2,12 +2,12 @@ .\" Title: Options Common to NDB Cluster Programs .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "OPTIONS COMMON TO NDB CLUSTER PROGRAMS" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "OPTIONS COMMON TO NDB CLUSTER PROGRAMS" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -350,6 +350,10 @@ T} .TE .sp 1 Tells the program where to find character set information\&. +.sp +This option is supported by +\fBndb_import\fR +in NDB 7\&.6\&.7 and later\&. .RE .sp .RS 4 @@ -618,6 +622,9 @@ T} .TE .sp 1 Read this file after global option files are read\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -659,6 +666,9 @@ T} .TE .sp 1 Read default options from this file\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -700,6 +710,9 @@ T} .TE .sp 1 Also read groups with names ending in this suffix\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -775,6 +788,9 @@ T} .TE .sp 1 Read this path from the login file\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -919,7 +935,7 @@ T} .sp 1 Sets this node\*(Aqs NDB Cluster node ID\&. \fIThe range of permitted values depends on the node\*(Aqs type (data, management, or API) and the NDB Cluster software version\fR\&. See -Section\ \&21.1.6.2, \(lqLimits and Differences of NDB Cluster from Standard MySQL Limits\(rq, for more information\&. +Section\ \&21.1.7.2, \(lqLimits and Differences of NDB Cluster from Standard MySQL Limits\(rq, for more information\&. .RE .sp .RS 4 @@ -961,6 +977,9 @@ T} .TE .sp 1 Do not read default options from any option file other than login file\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -1043,6 +1062,9 @@ T} .TE .sp 1 Print the program argument list and exit\&. +.sp +For additional information about this and other option\-file options, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 diff --git a/man/ndb_blob_tool.1 b/man/ndb_blob_tool.1 index 3fb3cc0363ac..2aed5ddaf3ff 100644 --- a/man/ndb_blob_tool.1 +++ b/man/ndb_blob_tool.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_blob_tool\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_BLOB_TOOL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_BLOB_TOOL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_config.1 b/man/ndb_config.1 index ecedaee04f06..9c36ba8ee976 100644 --- a/man/ndb_config.1 +++ b/man/ndb_config.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_CONFIG\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_CONFIG\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1320,7 +1320,7 @@ to provide output as XML by adding this option\&. A portion of such output is sh .\} .nf shell> \fBndb_config \-\-configinfo \-\-xml\fR -
diff --git a/man/ndb_cpcd.1 b/man/ndb_cpcd.1 index 2d338d2a3994..aad6c990a530 100644 --- a/man/ndb_cpcd.1 +++ b/man/ndb_cpcd.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_cpcd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_CPCD\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_CPCD\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_delete_all.1 b/man/ndb_delete_all.1 index ff8e4cf8e56d..e7de8abb91ee 100644 --- a/man/ndb_delete_all.1 +++ b/man/ndb_delete_all.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_delete_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_DELETE_ALL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_DELETE_ALL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_desc.1 b/man/ndb_desc.1 index 3ebc7eba0c95..422e8cd23c1e 100644 --- a/man/ndb_desc.1 +++ b/man/ndb_desc.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_desc\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_DESC\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_DESC\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_drop_index.1 b/man/ndb_drop_index.1 index 89ebd421282c..28ea0fa46561 100644 --- a/man/ndb_drop_index.1 +++ b/man/ndb_drop_index.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_drop_index\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_DROP_INDEX\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_DROP_INDEX\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -122,7 +122,7 @@ Enter password: ******* Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with \-A Welcome to the MySQL monitor\&. Commands end with ; or \eg\&. -Your MySQL connection id is 7 to server version: 5\&.7\&.24\-ndb\-7\&.5\&.13 +Your MySQL connection id is 7 to server version: 5\&.7\&.25\-ndb\-7\&.5\&.13 Type \*(Aqhelp;\*(Aq or \*(Aq\eh\*(Aq for help\&. Type \*(Aq\ec\*(Aq to clear the buffer\&. mysql> \fBSHOW TABLES;\fR +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ diff --git a/man/ndb_drop_table.1 b/man/ndb_drop_table.1 index 117fcbbae97d..8e5dba704fa8 100644 --- a/man/ndb_drop_table.1 +++ b/man/ndb_drop_table.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_drop_table\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_DROP_TABLE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_DROP_TABLE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_error_reporter.1 b/man/ndb_error_reporter.1 index a92d179f301d..2de42b5b33fb 100644 --- a/man/ndb_error_reporter.1 +++ b/man/ndb_error_reporter.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_error_reporter\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_ERROR_REPORTER\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_ERROR_REPORTER\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_import.1 b/man/ndb_import.1 index e350d450f28f..b7a285b5ae9f 100644 --- a/man/ndb_import.1 +++ b/man/ndb_import.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_import\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_IMPORT\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_IMPORT\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,9 +35,13 @@ ndb_import \- Import CSV data into NDB .SH "DESCRIPTION" .PP \fBndb_import\fR -imports CSV\-formatted data into +imports CSV\-formatted data, such as that produced by +\fBmysqldump\fR +\fB\-\-tab\fR, directly into NDB -using the NDB API, which requires a connection to an NDB management server\&. A connection to a MySQL Server is not required\&. +using the NDB API\&. +\fBndb_import\fR +requires a connection to an NDB management server (\fBndb_mgmd\fR) to function; it does not require a connection to a MySQL Server\&. Usage .sp .if n \{\ @@ -53,13 +57,15 @@ ndb_import \fIdb_name\fR \fIfile_name\fR \fIoptions\fR \fBndb_import\fR requires two arguments\&. \fIdb_name\fR -is the name of the database in which the database where the table into which to import the data is found; +is the name of the database where the table into which to import the data is found; \fIfile_name\fR -is the name of the CSV file from which to read the data, including the path to this file if it is not in the current directory\&. The name of the file must match the name of the table; the file\*(Aqs extention, if any, is not taken into consdieration\&. Additional arguments (described later in this section) are supported, including options for specifying field separators, escapes, and line terminators\&. +is the name of the CSV file from which to read the data; this must include the path to this file if it is not in the current directory\&. The name of the file must match that of the table; the file\*(Aqs extension, if any, is not taken into consideration\&. Options supported by +\fBndb_import\fR +include those for specifying field separators, escapes, and line terminators, and are described later in this section\&. \fBndb_import\fR must be able to connect to an NDB Cluster management server; for this reason, there must be an unused [api] -slot in the +slot in the cluster config\&.ini file\&. .PP @@ -231,6 +237,9 @@ l l l l l l l l l l l l +l l l +l l l +l l l l l l. T{ .PP @@ -401,6 +410,15 @@ ADDED: NDB 7.6.2 T} T{ .PP +--keep-state +T}:T{ +Preserve state files +T}:T{ +.PP +ADDED: NDB 7.6.4 +T} +T{ +.PP --lines-terminated-by=name T}:T{ Same as LINES TERMINATED BY option for LOAD DATA statements @@ -410,6 +428,15 @@ ADDED: NDB 7.6.2 T} T{ .PP +--log-level=# +T}:T{ +Set internal logging level; for debugging and development +T}:T{ +.PP +ADDED: NDB 7.6.4 +T} +T{ +.PP --max-rows=# T}:T{ Import only this number of input data rows; default is 0, which imports @@ -569,6 +596,17 @@ ADDED: NDB 7.6.2 T} T{ .PP +--stats +T}:T{ +Save performance and statistics information in + *.sto and *.stt + files +T}:T{ +.PP +ADDED: NDB 7.6.4 +T} +T{ +.PP --tempdelay=# T}:T{ Number of milliseconds to sleep between temporary errors @@ -594,7 +632,7 @@ T{ .PP -v T}:T{ -Verbosity level for debug messages (maximum is 4 for debug builds) +Enable verbose output T}:T{ .PP ADDED: NDB 7.6.2 @@ -961,6 +999,7 @@ l l l l l l l l +l l l l. T{ \fBCommand-Line Format\fR @@ -978,7 +1017,12 @@ T}:T{ Integer T} T{ -\fBDefault Value\fR +\fBDefault Value\fR (>= 5.7.20-ndb-7.6.4) +T}:T{ +4 +T} +T{ +\fBDefault Value\fR (>= 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3) T}:T{ 1 T} @@ -1589,6 +1633,7 @@ l l l l l l l l +l l l l. T{ \fBCommand-Line Format\fR @@ -1606,7 +1651,12 @@ T}:T{ Integer T} T{ -\fBDefault Value\fR +\fBDefault Value\fR (>= 5.7.20-ndb-7.6.4) +T}:T{ +4 +T} +T{ +\fBDefault Value\fR (>= 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3) T}:T{ 2 T} @@ -1633,6 +1683,55 @@ Set the number of threads processing input\&. .sp -1 .IP \(bu 2.3 .\} +\fB\-\-keep\-state\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--keep-state +T} +T{ +\fBIntroduced\fR +T}:T{ +5.7.20-ndb-7.6.4 +T} +T{ +\fBType\fR +T}:T{ +Boolean +T} +T{ +\fBDefault Value\fR +T}:T{ +false +T} +.TE +.sp 1 +By default, ndb_import removes all state files (except non\-empty +*\&.rej +files) when it completes a job\&. Specify this option (nor argument is required) to force the program to retain all state files instead\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-lines\-terminated\-by\fR=\fIname\fR .TS allbox tab(:); @@ -1684,6 +1783,61 @@ statement, specifying a character to be interpeted as end\-of\-line\&. .sp -1 .IP \(bu 2.3 .\} +\fB\-\-log\-level\fR=\fI#\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--log-level=# +T} +T{ +\fBType\fR +T}:T{ +Integer +T} +T{ +\fBDefault Value\fR +T}:T{ +0 +T} +T{ +\fBMinimum Value\fR +T}:T{ +0 +T} +T{ +\fBMaximum Value\fR +T}:T{ +2 +T} +.TE +.sp 1 +Performs internal logging at the given level\&. This option is intended primarily for internal and development use\&. +.sp +In debug builds of NDB only, the logging level can be set using this option to a maximum of 4\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-max\-rows\fR=\fI#\fR .TS allbox tab(:); @@ -2355,9 +2509,15 @@ T}:T{ T} .TE .sp 1 -Limit the number of rejected rows (rows with permanent errors) in the data load\&. The default is 0, which means that any rejected row causes a fatal error\&. The row causing the limit to be exceeded is added to the +Limit the number of rejected rows (rows with permanent errors) in the data load\&. The default is 0, which means that any rejected row causes a fatal error\&. Any rows causing the limit to be exceeded are added to the \&.rej file\&. +.sp +The limit imposed by this option is effective for the duration of the current run\&. A run restarted using +\fB\-\-resume\fR +is considered a +\(lqnew\(rq +run for this purpose\&. .RE .sp .RS 4 @@ -2533,6 +2693,58 @@ Set a limit on the number of bytes per row queue\&. Use 0 for no limit\&. .sp -1 .IP \(bu 2.3 .\} +\fB\-\-stats\fR +.TS +allbox tab(:); +lB lB. +T{ +Property +T}:T{ +Value +T} +.T& +l l +l l +l l +l l. +T{ +\fBCommand-Line Format\fR +T}:T{ +--stats +T} +T{ +\fBIntroduced\fR +T}:T{ +5.7.20-ndb-7.6.4 +T} +T{ +\fBType\fR +T}:T{ +Boolean +T} +T{ +\fBDefault Value\fR +T}:T{ +false +T} +.TE +.sp 1 +Save information about options related to performance and other internal statistics in files named +*\&.sto +and +*\&.stt\&. These files are always kept on successful completion (even if +\fB\-\-keep\-state\fR +is not also specified)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB \-\-state\-dir\fR=\fIname\fR .TS allbox tab(:); @@ -2703,7 +2915,7 @@ file\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-verbose\fR=\fI#\fR, +\fB\-\-verbose\fR, \fB\-v\fR .TS allbox tab(:); @@ -2719,11 +2931,13 @@ l l l l l l l l +l l +l l l l. T{ \fBCommand-Line Format\fR T}:T{ ---verbose=# +--verbose T} T{ \fBIntroduced\fR @@ -2731,12 +2945,22 @@ T}:T{ 5.7.18-ndb-7.6.2 T} T{ -\fBType\fR +\fBType\fR (>= 5.7.20-ndb-7.6.4) +T}:T{ +Boolean +T} +T{ +\fBType\fR (>= 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3) T}:T{ Integer T} T{ -\fBDefault Value\fR +\fBDefault Value\fR (>= 5.7.20-ndb-7.6.4) +T}:T{ +false +T} +T{ +\fBDefault Value\fR (>= 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3) T}:T{ 0 T} @@ -2752,7 +2976,11 @@ T}:T{ T} .TE .sp 1 -Verbosity level for debugging messages\&. +NDB 7\&.6\&.4 and later: Enable verbose output\&. +.sp +Previously, this option controlled the internal logging level for debugging messages\&. In NDB 7\&.6\&.4 and later, use the +\fB\-\-log\-level\fR +option for this purpose instead\&. .RE .PP As with diff --git a/man/ndb_index_stat.1 b/man/ndb_index_stat.1 index cd113a152fde..1c132ab4407f 100644 --- a/man/ndb_index_stat.1 +++ b/man/ndb_index_stat.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_index_stat\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_INDEX_STAT\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_INDEX_STAT\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_mgm.1 b/man/ndb_mgm.1 index 6e30fbc8266b..fc9b2c86c90d 100644 --- a/man/ndb_mgm.1 +++ b/man/ndb_mgm.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_mgm\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_MGM\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_MGM\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -282,7 +282,7 @@ T} T{ \fBDeprecated\fR T}:T{ -5.6.28-ndb-7.4.9 +Yes T} T{ \fBType\fR (>= 5.7.10-ndb-7.5.0) diff --git a/man/ndb_mgmd.8 b/man/ndb_mgmd.8 index edb2efbf0dd5..e019a25c3567 100644 --- a/man/ndb_mgmd.8 +++ b/man/ndb_mgmd.8 @@ -2,12 +2,12 @@ .\" Title: \fBndb_mgmd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_MGMD\FR" "8" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_MGMD\FR" "8" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_move_data.1 b/man/ndb_move_data.1 index 3806ec133c66..dce1be5ac4fd 100644 --- a/man/ndb_move_data.1 +++ b/man/ndb_move_data.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_move_data\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_MOVE_DATA\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_MOVE_DATA\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_perror.1 b/man/ndb_perror.1 index 134cc061851d..4457bb4c8b11 100644 --- a/man/ndb_perror.1 +++ b/man/ndb_perror.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_perror\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_PERROR\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_PERROR\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_perror \- Obtain NDB error message information +ndb_perror \- obtain NDB error message information .SH "SYNOPSIS" .HP \w'\fBndb_perror\ \fR\fB\fIoptions\fR\fR\ 'u \fBndb_perror \fR\fB\fIoptions\fR\fR diff --git a/man/ndb_print_backup_file.1 b/man/ndb_print_backup_file.1 index e7669423b5d6..76dd19109995 100644 --- a/man/ndb_print_backup_file.1 +++ b/man/ndb_print_backup_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_backup_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_PRINT_BACKUP_FILE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_PRINT_BACKUP_FILE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_file.1 b/man/ndb_print_file.1 index 4d82441144ac..902ccbc240fc 100644 --- a/man/ndb_print_file.1 +++ b/man/ndb_print_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_PRINT_FILE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_PRINT_FILE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_frag_file.1 b/man/ndb_print_frag_file.1 index c1281e7ab663..a4e6763917af 100644 --- a/man/ndb_print_frag_file.1 +++ b/man/ndb_print_frag_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_frag_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_PRINT_FRAG_FILE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_PRINT_FRAG_FILE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_schema_file.1 b/man/ndb_print_schema_file.1 index 7543e8bac001..0eda48d75998 100644 --- a/man/ndb_print_schema_file.1 +++ b/man/ndb_print_schema_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_schema_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_PRINT_SCHEMA_FILE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_PRINT_SCHEMA_FILE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_print_sys_file.1 b/man/ndb_print_sys_file.1 index 1529442cae82..1edd8b20ffd7 100644 --- a/man/ndb_print_sys_file.1 +++ b/man/ndb_print_sys_file.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_sys_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_PRINT_SYS_FILE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_PRINT_SYS_FILE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_redo_log_reader.1 b/man/ndb_redo_log_reader.1 index 5cb0b5cc9917..7af10509db44 100644 --- a/man/ndb_redo_log_reader.1 +++ b/man/ndb_redo_log_reader.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_redo_log_reader\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_REDO_LOG_READER\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_REDO_LOG_READER\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_restore.1 b/man/ndb_restore.1 index 37f93d956b9b..6ed6921c243a 100644 --- a/man/ndb_restore.1 +++ b/man/ndb_restore.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_restore\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_RESTORE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_RESTORE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -842,6 +842,7 @@ Section\ \&21.5.3.2, \(lqUsing The NDB Cluster Management Client to Create a Bac When restoring cluster backups, you must be sure to restore all data nodes from backups having the same backup ID\&. Using files from different backups will at best result in restoring the cluster to an inconsistent state, and may fail altogether\&. .sp .5v .RE +In NDB 7\&.5\&.13 and later, and in NDB 7\&.6\&.9 and later, this option is required\&. .RE .sp .RS 4 @@ -1980,6 +1981,8 @@ Specify the node ID of the data node on which the backup was taken\&. .sp When restoring to a cluster with different number of data nodes from that where the backup was taken, this information helps identify the correct set or sets of files to be restored to a given node\&. (In such cases, multiple files usually need to be restored to a single data node\&.) See the section called \(lqRestoring to a different number of data nodes\(rq, for additional information and examples\&. +.sp +In NDB 7\&.5\&.13 and later, and in NDB 7\&.6\&.9 and later, this option is required\&. .RE .sp .RS 4 @@ -2797,7 +2800,7 @@ to restore the privilege tables\&. This works only if the privilege tables were converted to NDB before the backup was taken\&. For more information, see -Section\ \&21.5.15, \(lqDistributed MySQL Privileges for NDB Cluster\(rq\&. +Section\ \&21.5.16, \(lqDistributed MySQL Privileges for NDB Cluster\(rq\&. .RE .sp .RS 4 diff --git a/man/ndb_select_all.1 b/man/ndb_select_all.1 index 4419cd7bb1d1..70572551f126 100644 --- a/man/ndb_select_all.1 +++ b/man/ndb_select_all.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_select_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_SELECT_ALL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_SELECT_ALL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_select_count.1 b/man/ndb_select_count.1 index 21c98d36a769..60fcd241271b 100644 --- a/man/ndb_select_count.1 +++ b/man/ndb_select_count.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_select_count\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_SELECT_COUNT\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_SELECT_COUNT\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_setup.py.1 b/man/ndb_setup.py.1 index 0a85f5b485b6..6bff3470c423 100644 --- a/man/ndb_setup.py.1 +++ b/man/ndb_setup.py.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_setup.py\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_SETUP\&.PY\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_SETUP\&.PY\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -374,7 +374,7 @@ T} T{ \fBDefault Value\fR T}:T{ -cfg.pem +/usr/share/mysql/mcc/cfg.pem T} .TE .sp 1 diff --git a/man/ndb_show_tables.1 b/man/ndb_show_tables.1 index 0e15bb93941b..d78f46857e3e 100644 --- a/man/ndb_show_tables.1 +++ b/man/ndb_show_tables.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_show_tables\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_SHOW_TABLES\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_SHOW_TABLES\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_size.pl.1 b/man/ndb_size.pl.1 index 1f3639ceb8b5..36e4f5cf7ac2 100644 --- a/man/ndb_size.pl.1 +++ b/man/ndb_size.pl.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_size.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_SIZE\&.PL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_SIZE\&.PL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_top.1 b/man/ndb_top.1 index a85b173ea31d..a717677ec73c 100644 --- a/man/ndb_top.1 +++ b/man/ndb_top.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_top\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_TOP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_TOP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_waiter.1 b/man/ndb_waiter.1 index 642f2898d333..ccfd38b98a53 100644 --- a/man/ndb_waiter.1 +++ b/man/ndb_waiter.1 @@ -2,12 +2,12 @@ .\" Title: \fBndb_waiter\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDB_WAITER\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDB_WAITER\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndbd.8 b/man/ndbd.8 index 45bfe9d3cd9d..aba6773b130d 100644 --- a/man/ndbd.8 +++ b/man/ndbd.8 @@ -2,12 +2,12 @@ .\" Title: \fBndbd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDBD\FR" "8" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDBD\FR" "8" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -327,7 +327,7 @@ T} T{ \fBDeprecated\fR T}:T{ -5.6.28-ndb-7.4.9 +Yes T} T{ \fBType\fR @@ -1376,7 +1376,7 @@ process can consume up to 2 CPUs if permitted to do so\&. For a machine with many CPUs it is possible to use several \fBndbd\fR processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 5\&.7 in a production setting\&. See -Section\ \&21.1.6, \(lqKnown Limitations of NDB Cluster\(rq\&. +Section\ \&21.1.7, \(lqKnown Limitations of NDB Cluster\(rq\&. .SH "COPYRIGHT" .br .PP diff --git a/man/ndbinfo_select_all.1 b/man/ndbinfo_select_all.1 index f1f563bc43b9..2ac19ce5f8c1 100644 --- a/man/ndbinfo_select_all.1 +++ b/man/ndbinfo_select_all.1 @@ -2,12 +2,12 @@ .\" Title: \fBndbinfo_select_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDBINFO_SELECT_ALL\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDBINFO_SELECT_ALL\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndbmtd.8 b/man/ndbmtd.8 index baef5d4ef68d..c837be2c4eb4 100644 --- a/man/ndbmtd.8 +++ b/man/ndbmtd.8 @@ -2,12 +2,12 @@ .\" Title: \fBndbmtd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBNDBMTD\FR" "8" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBNDBMTD\FR" "8" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/perror.1 b/man/perror.1 index 4d5587daa7d2..4c2c398aa537 100644 --- a/man/perror.1 +++ b/man/perror.1 @@ -2,12 +2,12 @@ .\" Title: \fBperror\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBPERROR\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBPERROR\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -perror \- explain error codes +perror \- display MySQL error message information .SH "SYNOPSIS" .HP \w'\fBperror\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIerrorcode\fR\fR\fB\ \&.\&.\&.\fR\ 'u \fBperror [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIerrorcode\fR\fR\fB \&.\&.\&.\fR @@ -68,7 +68,19 @@ shell> \fBperror [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIerrorcode\fR\fR\fB \&.\&.\ .RE .\} .PP -Example: +Examples: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBperror 1231\fR +MySQL error code 1231 (ER_WRONG_VALUE_FOR_VAR): Variable \*(Aq%\-\&.64s\*(Aq can\*(Aqt +be set to the value of \*(Aq%\-\&.200s\*(Aq +.fi +.if n \{\ +.RE +.\} .sp .if n \{\ .RS 4 @@ -82,6 +94,10 @@ OS error code 64: Machine is not on the network .RE .\} .PP +To obtain the error message for a MySQL Cluster error code, use the +\fBndb_perror\fR +utility\&. +.PP The meaning of system error messages may be dependent on your operating system\&. A given error code may mean different things on different operating systems\&. .PP \fBperror\fR @@ -117,7 +133,7 @@ Print the error message for an NDB Cluster error code\&. .sp This option is deprecated in NDB 7\&.6\&.4 and later, where \fBperror\fR -prints a warning if it is used, and subject to removal in a future NDB Cluster release series\&. Use the +prints a warning if it is used, and is removed in NDB Cluster 8\&.0\&. Use the \fBndb_perror\fR utility instead\&. .RE diff --git a/man/replace.1 b/man/replace.1 index 41814d79adaf..df32733258ab 100644 --- a/man/replace.1 +++ b/man/replace.1 @@ -2,12 +2,12 @@ .\" Title: \fBreplace\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBREPLACE\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBREPLACE\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/resolve_stack_dump.1 b/man/resolve_stack_dump.1 index c89d1b000c0d..5c343b9f0b8b 100644 --- a/man/resolve_stack_dump.1 +++ b/man/resolve_stack_dump.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolve_stack_dump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBRESOLVE_STACK_DUMP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBRESOLVE_STACK_DUMP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,6 +36,24 @@ resolve_stack_dump \- resolve numeric stack trace dump to symbols .PP \fBresolve_stack_dump\fR resolves a numeric stack dump to symbols\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +\fBresolve_stack_dump\fR +is deprecated and is removed in MySQL 8\&.0\&. Stack traces from official MySQL builds are always symbolized, so there is no need to use +\fBresolve_stack_dump\fR\&. +.sp .5v +.RE .PP Invoke \fBresolve_stack_dump\fR diff --git a/man/resolveip.1 b/man/resolveip.1 index 639dae3975be..7040c1545b79 100644 --- a/man/resolveip.1 +++ b/man/resolveip.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolveip\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBRESOLVEIP\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBRESOLVEIP\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,6 +37,27 @@ resolveip \- resolve host name to IP address or vice versa The \fBresolveip\fR utility resolves host names to IP addresses and vice versa\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +\fBresolveip\fR +is deprecated and is removed in MySQL 8\&.0\&. +\fBnslookup\fR, +\fBhost\fR, or +\fBdig\fR +can be used instead\&. +.sp .5v +.RE .PP Invoke \fBresolveip\fR diff --git a/man/zlib_decompress.1 b/man/zlib_decompress.1 index 019f659888ed..e39944f60c3e 100644 --- a/man/zlib_decompress.1 +++ b/man/zlib_decompress.1 @@ -2,12 +2,12 @@ .\" Title: \fBzlib_decompress\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 10/03/2018 +.\" Date: 12/20/2018 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "\FBZLIB_DECOMPRESS\FR" "1" "10/03/2018" "MySQL 5\&.7" "MySQL Database System" +.TH "\FBZLIB_DECOMPRESS\FR" "1" "12/20/2018" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index e79342edef2d..770b7c2cd1d5 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -11,15 +11,16 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --- DO NOT EDIT THIS FILE. It is generated automatically by the MySQL docs --- team. If you require changes to the format of this file, contact the --- docs team. --- File generation date: 2018-10-03 +-- DO NOT EDIT THIS FILE. It is generated automatically by the MySQL +-- documentation team. If you require changes to the content of this +-- file, contact the documentation team. + +-- File generation date: 2018-12-20 -- MySQL series: 5.7 --- Document repository revision: 59320 +-- Document repository revision: 60441 -- To use this file, load its contents into the mysql database. For example, -- with the mysql client program, process the file like this, where @@ -37,2804 +38,2805 @@ TRUNCATE TABLE help_relation; START TRANSACTION; -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (1,'Geographic',0,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (2,'Polygon properties',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (3,'Numeric Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (4,'WKT',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (5,'Plugins',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (6,'Control flow functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (7,'MBR',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (8,'Transactions',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (9,'Help Metadata',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (10,'Account Management',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (11,'Point properties',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (12,'Encryption Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (13,'LineString properties',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (14,'Miscellaneous Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (15,'Logical operators',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (16,'Functions and Modifiers for Use with GROUP BY',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (17,'Information Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (18,'Storage Engines',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (19,'Bit Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (20,'Comparison operators',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (21,'Table Maintenance',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (22,'User-Defined Functions',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (23,'Data Types',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (24,'Compound Statements',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (25,'Geometry constructors',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (26,'GeometryCollection properties',1,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (27,'Administration',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (28,'Data Manipulation',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (29,'Utility',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (30,'Language Structure',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (31,'Geometry relations',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (32,'Date and Time Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (33,'WKB',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (34,'Procedures',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (35,'Geographic Features',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (36,'Contents',0,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (37,'Geometry properties',35,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (38,'String Functions',39,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (39,'Functions',36,''); -INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (40,'Data Definition',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (1,'Account Management',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (2,'Administration',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (3,'Bit Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (4,'Comparison operators',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (5,'Compound Statements',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (6,'Contents',0,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (7,'Control flow functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (8,'Data Definition',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (9,'Data Manipulation',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (10,'Data Types',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (11,'Date and Time Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (12,'Encryption Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (13,'Functions',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (14,'Functions and Modifiers for Use with GROUP BY',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (15,'Geographic',0,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (16,'Geographic Features',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (17,'Geometry constructors',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (18,'Geometry properties',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (19,'Geometry relations',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (20,'GeometryCollection properties',15,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (21,'Help Metadata',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (22,'Information Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (23,'Language Structure',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (24,'LineString properties',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (25,'Locking Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (26,'Logical operators',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (27,'MBR',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (28,'Miscellaneous Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (29,'Numeric Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (30,'Plugins',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (31,'Point properties',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (32,'Polygon properties',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (33,'Procedures',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (34,'Storage Engines',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (35,'String Functions',13,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (36,'Table Maintenance',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (37,'Transactions',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (38,'User-Defined Functions',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (39,'Utility',6,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (40,'WKB',16,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (41,'WKT',16,''); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (0,28,'JOIN','MySQL supports the following JOIN syntax for the table_references part\nof SELECT statements and multiple-table DELETE and UPDATE statements:\n\ntable_references:\n escaped_table_reference [, escaped_table_reference] ...\n\nescaped_table_reference:\n table_reference\n | { OJ table_reference }\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [PARTITION (partition_names)]\n [[AS] alias] [index_hint_list]\n | table_subquery [AS] alias\n | ( table_references )\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nA table reference (when it refers to a partitioned table) may contain a\nPARTITION option, including a list of comma-separated partitions,\nsubpartitions, or both. This option follows the name of the table and\nprecedes any alias declaration. The effect of this option is that rows\nare selected only from the listed partitions or subpartitions. Any\npartitions or subpartitions not named in the list are ignored. For more\ninformation and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nThe syntax of table_factor is extended in MySQL in comparison with\nstandard SQL. The standard accepts only table_reference, not a list of\nthem inside a pair of parentheses.\n\nThis is a conservative extension if each comma in a list of\ntable_reference items is considered as equivalent to an inner join. For\nexample:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)\n\nIn MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents\n(they can replace each other). In standard SQL, they are not\nequivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used\notherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins. See\nhttp://dev.mysql.com/doc/refman/5.7/en/nested-join-optimization.html.\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/index-hints.html. Optimizer\nhints and the optimizer_switch system variable are other ways to\ninfluence optimizer use of indexes. See\nhttp://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/switchable-optimizations.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/join.html\n\n','SELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.7/en/join.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (1,38,'HEX','Syntax:\nHEX(str), HEX(N)\n\nFor a string argument str, HEX() returns a hexadecimal string\nrepresentation of str where each byte of each character in str is\nconverted to two hexadecimal digits. (Multibyte characters therefore\nbecome more than two digits.) The inverse of this operation is\nperformed by the UNHEX() function.\n\nFor a numeric argument N, HEX() returns a hexadecimal string\nrepresentation of the value of N treated as a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16). The inverse of this operation is\nperformed by CONV(HEX(N),16,10).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT X\'616263\', HEX(\'abc\'), UNHEX(HEX(\'abc\'));\n -> \'abc\', 616263, \'abc\'\nmysql> SELECT HEX(255), CONV(HEX(255),16,10);\n -> \'FF\', 255\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (2,7,'CONTAINS','Contains(g1, g2)\n\nMBRContains() and Contains() are synonyms. For more information, see\nthe description of MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (3,37,'SRID','SRID(g)\n\nST_SRID() and SRID() are synonyms. For more information, see the\ndescription of ST_SRID().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (4,16,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. VARIANCE() is a\nsynonym for the standard SQL function VAR_POP(), provided as a MySQL\nextension.\n\nIf there are no matching rows, VARIANCE() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (5,40,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row in the mysql.servers table is deleted. This statement\nrequires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-server.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (6,26,'ST_GEOMETRYN','ST_GeometryN(gc, N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1. If any argument is NULL or\nthe geometry argument is an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1));\n+-------------------------------------------------+\n| ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1)) |\n+-------------------------------------------------+\n| POINT(1 1) |\n+-------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (7,33,'ST_GEOMCOLLFROMWKB','ST_GeomCollFromWKB(wkb[, srid]), ST_GeometryCollectionFromWKB(wkb[,\nsrid])\n\nConstructs a GeometryCollection value using its WKB representation and\nSRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (8,38,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent nonbinary string form.\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (9,35,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-geometry-class-hierarchy.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (10,38,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(X\'65\')), CHARSET(CHAR(X\'65\' USING utf8));\n+----------------------+---------------------------------+\n| CHARSET(CHAR(X\'65\')) | CHARSET(CHAR(X\'65\' USING utf8)) |\n+----------------------+---------------------------------+\n| binary | utf8 |\n+----------------------+---------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (11,7,'ASYMMETRIC_DECRYPT','Syntax:\nASYMMETRIC_DECRYPT(algorithm, crypt_str, key_str)\n\nDecrypts an encrypted string using the given algorithm and key string,\nand returns the resulting cleartext as a binary string. If decryption\nfails, the result is NULL.\n\nkey_str must be a valid key string in PEM format. For successful\ndecryption, it must be the public or private key string corresponding\nto the private or public key string used with ASYMMETRIC_ENCRYPT() to\nproduce the encrypted string. algorithm indicates the encryption\nalgorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nFor a usage example, see the description of ASYMMETRIC_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (12,27,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows the CREATE TRIGGER statement that creates the\nnamed trigger. This statement requires the TRIGGER privilege for the\ntable associated with the trigger.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-trigger.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (13,27,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nTo use either statement, you must be the user named in the routine\nDEFINER clause or have SELECT access to the mysql.proc table. If you do\nnot have privileges for the routine itself, the value displayed for the\nCreate Procedure or Create Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS char(50) CHARSET latin1\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.7/en/show-create-procedure.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (14,24,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/open.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (15,31,'ST_INTERSECTS','ST_Intersects(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (16,38,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York | new york |\n+-------------+-----------------------------------+\n\nFor collations of Unicode character sets, LOWER() and UPPER() work\naccording to the Unicode Collation Algorithm (UCA) version in the\ncollation name, if there is one, and UCA 4.0.0 if no version is\nspecified. For example, utf8_unicode_520_ci works according to UCA\n5.2.0, whereas utf8_unicode_ci works according to UCA 4.0.0. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-unicode-sets.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (17,40,'CREATE TRIGGER','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name\n trigger_time trigger_event\n ON tbl_name FOR EACH ROW\n [trigger_order]\n trigger_body\n\ntrigger_time: { BEFORE | AFTER }\n\ntrigger_event: { INSERT | UPDATE | DELETE }\n\ntrigger_order: { FOLLOWS | PRECEDES } other_trigger_name\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nTrigger names exist in the schema namespace, meaning that all triggers\nmust have unique names within a schema. Triggers in different schemas\ncan have the same name.\n\nThis section describes CREATE TRIGGER syntax. For additional\ndiscussion, see\nhttp://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. The statement might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section. If\nbinary logging is enabled, CREATE TRIGGER might require the SUPER\nprivilege, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html.\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time, as described\nlater in this section.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\nBasic column value checks occur prior to trigger activation, so you\ncannot use BEFORE triggers to convert values inappropriate for the\ncolumn type to valid values.\n\ntrigger_event indicates the kind of operation that activates the\ntrigger. These trigger_event values are permitted:\n\no INSERT: The trigger activates whenever a new row is inserted into the\n table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger activates whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger activates whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements. DROP TABLE\n and TRUNCATE TABLE statements on the table do not activate this\n trigger, because they do not use DELETE. Dropping a partition does\n not activate DELETE triggers, either.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-trigger.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (18,32,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (19,7,'ASYMMETRIC_ENCRYPT','Syntax:\nASYMMETRIC_ENCRYPT(algorithm, str, key_str)\n\nEncrypts a string using the given algorithm and key string, and returns\nthe resulting ciphertext as a binary string. If encryption fails, the\nresult is NULL.\n\nThe str length cannot be greater than the key_str length − 11, in\nbytes\n\nkey_str must be a valid key string in PEM format. algorithm indicates\nthe encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nTo encrypt a string, pass a private or public key string to\nASYMMETRIC_ENCRYPT(). To recover the original unencrypted string, pass\nthe encrypted string to ASYMMETRIC_DECRYPT(), along with the public or\nprivate key string correponding to the private or public key string\nused for encryption.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','-- Generate private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'RSA\', 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'RSA\', @priv);\n\n-- Encrypt using private key, decrypt using public key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @priv);\nSET @cleartext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @pub);\n\n-- Encrypt using public key, decrypt using private key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @pub);\nSET @cleartext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @priv);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (20,27,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement returns results only for databases and tables for which you\nhave the TRIGGER privilege. The LIKE clause, if present, indicates\nwhich table names (not trigger names) to match and causes the statement\nto display triggers for those tables. The WHERE clause can be given to\nselect rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nFor the ins_sum trigger defined in\nhttp://dev.mysql.com/doc/refman/5.7/en/triggers.html, the output of\nSHOW TRIGGERS is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\n Statement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: 2018-08-08 10:10:12.61\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n Definer: me@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-triggers.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (21,13,'ISCLOSED','IsClosed(ls)\n\nST_IsClosed() and IsClosed() are synonyms. For more information, see\nthe description of ST_IsClosed().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (22,38,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nReturns 1 if the string expr matches the regular expression specified\nby the pattern pat, 0 otherwise. If either expr or pat is NULL, the\nreturn value is NULL.\n\nRLIKE is a synonym for REGEXP.\n\nThe pattern can be an extended regular expression, the syntax for which\nis discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/regexp.html#regexp-syntax. The\npattern need not be a literal string. For example, it can be specified\nas a string expression or table column.\n\n*Note*:\n\nBecause MySQL uses the C escape syntax in strings (for example, \\n to\nrepresent the newline character), you must double any \\ that you use in\nyour REGEXP arguments.\n\nRegular expression operations use the character set and collation of\nthe string expression and pattern arguments when deciding the type of a\ncharacter and performing the comparison. If the arguments have\ndifferent character sets or collations, coercibility rules apply as\ndescribed in\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-collation-coercibility.h\ntml. If either argument is a binary string, the arguments are handled\nin case-sensitive fashion as binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/regexp.html\n\n','mysql> SELECT \'Michael!\' REGEXP \'.*\';\n+------------------------+\n| \'Michael!\' REGEXP \'.*\' |\n+------------------------+\n| 1 |\n+------------------------+\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n+---------------------------------------+\n| \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\' |\n+---------------------------------------+\n| 0 |\n+---------------------------------------+\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n+---------------------+\n| \'a\' REGEXP \'^[a-d]\' |\n+---------------------+\n| 1 |\n+---------------------+\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n+----------------+-----------------------+\n| \'a\' REGEXP \'A\' | \'a\' REGEXP BINARY \'A\' |\n+----------------+-----------------------+\n| 1 | 0 |\n+----------------+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/regexp.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (23,13,'ST_POINTN','ST_PointN(ls, N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1. If any argument is NULL or the geometry argument is\nan empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_PointN(ST_GeomFromText(@ls),2));\n+----------------------------------------------+\n| ST_AsText(ST_PointN(ST_GeomFromText(@ls),2)) |\n+----------------------------------------------+\n| POINT(2 2) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (24,24,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nThe IF statement for stored programs implements a basic conditional\nconstruct.\n\n*Note*:\n\nThere is also an IF() function, which differs from the IF statement\ndescribed here. See\nhttp://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html. The\nIF statement can have THEN, ELSE, and ELSEIF clauses, and it is\nterminated with END IF.\n\nIf the search_condition evaluates to true, the corresponding THEN or\nELSEIF clause statement_list executes. If no search_condition matches,\nthe ELSE clause statement_list executes.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/if.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/if.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (25,12,'VALIDATE_PASSWORD_STRENGTH','Syntax:\nVALIDATE_PASSWORD_STRENGTH(str)\n\nGiven an argument representing a cleartext password, this function\nreturns an integer to indicate how strong the password is. The return\nvalue ranges from 0 (weak) to 100 (strong).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (26,7,'WITHIN','Within(g1, g2)\n\nMBRWithin() and Within() are synonyms. For more information, see the\ndescription of MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (27,27,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins.\n\nExample of SHOW PLUGINS output:\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n Name: CSV\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n Name: MEMORY\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n Name: MyISAM\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-plugins.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (28,8,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a SQL statement and assigns it a name,\nstmt_name, by which to refer to the statement later. The prepared\nstatement is executed with EXECUTE and released with DEALLOCATE\nPREPARE. For examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.h\ntml.\n\nStatement names are not case-sensitive. preparable_stmt is either a\nstring literal or a user variable that contains the text of the SQL\nstatement. The text must represent a single statement, not multiple\nstatements. Within the statement, ? characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query\nlater when you execute it. The ? characters should not be enclosed\nwithin quotation marks, even if you intend to bind them to string\nvalues. Parameter markers can be used only where data values should\nappear, not for SQL keywords, identifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nThe scope of a prepared statement is the session within which it is\ncreated, which as several implications:\n\no A prepared statement created in one session is not available to other\n sessions.\n\no When a session ends, whether normally or abnormally, its prepared\n statements no longer exist. If auto-reconnect is enabled, the client\n is not notified that the connection was lost. For this reason,\n clients may wish to disable auto-reconnect. See\n http://dev.mysql.com/doc/refman/5.7/en/c-api-auto-reconnect.html.\n\no A prepared statement created within a stored program continues to\n exist after the program finishes executing and can be executed\n outside the program later.\n\no A statement prepared in stored program context cannot refer to stored\n procedure or function parameters or local variables because they go\n out of scope when the program ends and would be unavailable were the\n statement to be executed later outside the program. As a workaround,\n refer instead to user-defined variables, which also have session\n scope; see\n http://dev.mysql.com/doc/refman/5.7/en/user-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/prepare.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (29,8,'LOCK','Syntax:\nLOCK TABLES\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type: {\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n}\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail later in this\nsection.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/lock-tables-and-triggers.html.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession. LOCK TABLES implicitly releases any table locks held by the\ncurrent session before acquiring new locks.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/lock-tables.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (30,27,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-binary-logs.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (31,25,'POLYGON','Polygon(ls [, ls] ...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (32,32,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (33,38,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (34,17,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nThe value returned by CONNECTION_ID() is the same type of value as\ndisplayed in the ID column of the INFORMATION_SCHEMA.PROCESSLIST table,\nthe Id column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column\nof the Performance Schema threads table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n -> 23786\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (35,28,'DELETE','Syntax:\nDELETE is a DML statement that removes rows from a table.\n\nSingle-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nThe DELETE statement deletes rows from tbl_name and returns the number\nof deleted rows. To check the number of deleted rows, call the\nROW_COUNT() function described in\nhttp://dev.mysql.com/doc/refman/5.7/en/information-functions.html.\n\nMain Clauses\n\nThe conditions in the optional WHERE clause identify which rows to\ndelete. With no WHERE clause, all rows are deleted.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nIf the ORDER BY clause is specified, the rows are deleted in the order\nthat is specified. The LIMIT clause places a limit on the number of\nrows that can be deleted. These clauses apply to single-table deletes,\nbut not multi-table deletes.\n\nMultiple-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nPrivileges\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nPerformance\n\nWhen you do not need to know the number of deleted rows, the TRUNCATE\nTABLE statement is a faster way to empty a table than a DELETE\nstatement with no WHERE clause. Unlike DELETE, TRUNCATE TABLE cannot be\nused within a transaction or if you have a lock on the table. See [HELP\nTRUNCATE TABLE] and [HELP LOCK].\n\nThe speed of delete operations may also be affected by factors\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/delete-optimization.html.\n\nTo ensure that a given DELETE statement does not take too much time,\nthe MySQL-specific LIMIT row_count clause for DELETE specifies the\nmaximum number of rows to be deleted. If the number of rows to delete\nis larger than the limit, repeat the DELETE statement until the number\nof affected rows is less than the LIMIT value.\n\nSubqueries\n\nYou cannot delete from a table and select from the same table in a\nsubquery.\n\nPartitioned Tables\n\nDELETE supports explicit partition selection using the PARTITION\noption, which takes a list of the comma-separated names of one or more\npartitions or subpartitions (or both) from which to select rows to be\ndropped. Partitions not included in the list are ignored. Given a\npartitioned table t with a partition named p0, executing the statement\nDELETE FROM t PARTITION (p0) has the same effect on the table as\nexecuting ALTER TABLE t TRUNCATE PARTITION (p0); in both cases, all\nrows in partition p0 are dropped.\n\nPARTITION can be used along with a WHERE condition, in which case the\ncondition is tested only on rows in the listed partitions. For example,\nDELETE FROM t PARTITION (p0) WHERE c < 5 deletes rows only from\npartition p0 for which the condition c < 5 is true; rows in any other\npartitions are not checked and thus not affected by the DELETE.\n\nThe PARTITION option can also be used in multiple-table DELETE\nstatements. You can use up to one such option per table named in the\nFROM option.\n\nFor more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/delete.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (36,7,'JSON_SEARCH','Syntax:\nJSON_SEARCH(json_doc, one_or_all, search_str[, escape_char[, path]\n...])\n\nReturns the path to the given string within a JSON document. Returns\nNULL if any of the json_doc, search_str, or path arguments are NULL; no\npath exists within the document; or search_str is not found. An error\noccurs if the json_doc argument is not a valid JSON document, any path\nargument is not a valid path expression, one_or_all is not \'one\' or\n\'all\', or escape_char is not a constant expression.\n\nThe one_or_all argument affects the search as follows:\n\no \'one\': The search terminates after the first match and returns one\n path string. It is undefined which match is considered first.\n\no \'all\': The search returns all matching path strings such that no\n duplicate paths are included. If there are multiple strings, they are\n autowrapped as an array. The order of the array elements is\n undefined.\n\nWithin the search_str search string argument, the % and _ characters\nwork as for the LIKE operator: % matches any number of characters\n(including zero characters), and _ matches exactly one character.\n\nTo specify a literal % or _ character in the search string, precede it\nby the escape character. The default is \\ if the escape_char argument\nis missing or NULL. Otherwise, escape_char must be a constant that is\nempty or one character.\n\nFor more information about matching and escape character behavior, see\nthe description of LIKE in\nhttp://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n. For escape character handling, a difference from the LIKE behavior is\nthat the escape character for JSON_SEARCH() must evaluate to a constant\nat compile time, not just at execution time. For example, if\nJSON_SEARCH() is used in a prepared statement and the escape_char\nargument is supplied using a ? parameter, the parameter value might be\nconstant at execution time, but is not at compile time.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SET @j = \'["abc", [{"k": "10"}, "def"], {"x":"abc"}, {"y":"bcd"}]\';\n\nmysql> SELECT JSON_SEARCH(@j, \'one\', \'abc\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'one\', \'abc\') |\n+-------------------------------+\n| "$[0]" |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'abc\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'abc\') |\n+-------------------------------+\n| ["$[0]", "$[2].x"] |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'ghi\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'ghi\') |\n+-------------------------------+\n| NULL |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\');\n+------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\') |\n+------------------------------+\n| "$[1][0].k" |\n+------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$\');\n+-----------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$\') |\n+-----------------------------------------+\n| "$[1][0].k" |\n+-----------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*]\');\n+--------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*]\') |\n+--------------------------------------------+\n| "$[1][0].k" |\n+--------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$**.k\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$**.k\') |\n+---------------------------------------------+\n| "$[1][0].k" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*][0].k\');\n+-------------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*][0].k\') |\n+-------------------------------------------------+\n| "$[1][0].k" |\n+-------------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1]\');\n+--------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1]\') |\n+--------------------------------------------+\n| "$[1][0].k" |\n+--------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1][0]\');\n+-----------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1][0]\') |\n+-----------------------------------------------+\n| "$[1][0].k" |\n+-----------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'abc\', NULL, \'$[2]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'abc\', NULL, \'$[2]\') |\n+---------------------------------------------+\n| "$[2].x" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%a%\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%a%\') |\n+-------------------------------+\n| ["$[0]", "$[2].x"] |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\') |\n+-------------------------------+\n| ["$[0]", "$[2].x", "$[3].y"] |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[0]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[0]\') |\n+---------------------------------------------+\n| "$[0]" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[2]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[2]\') |\n+---------------------------------------------+\n| "$[2].x" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[1]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[1]\') |\n+---------------------------------------------+\n| NULL |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[1]\');\n+-------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[1]\') |\n+-------------------------------------------+\n| NULL |\n+-------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[3]\');\n+-------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[3]\') |\n+-------------------------------------------+\n| "$[3].y" |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (37,24,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nAn error occurs if the cursor is not open.\n\nIf not closed explicitly, a cursor is closed at the end of the BEGIN\n... END block in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/close.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (38,38,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (39,29,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable; # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable; # selects from db2.mytable\n\nThe database name must be specified on a single line. Newlines in\ndatabase names are not supported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/use.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (40,6,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first CASE syntax returns the result for the first\nvalue=compare_value comparison that is true. The second syntax returns\nthe result for the first condition that is true. If no comparison or\ncondition is true, the result after ELSE is returned, or NULL if there\nis no ELSE part.\n\n*Note*:\n\nThe syntax of the CASE expression described here differs slightly from\nthat of the SQL CASE statement described in [HELP CASE statement], for\nuse inside stored programs. The CASE statement cannot have an ELSE NULL\nclause, and it is terminated with END CASE instead of END.\n\nThe return type of a CASE expression result is the aggregated type of\nall result values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n -> WHEN 2 THEN \'two\' ELSE \'more\' END;\n -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n -> WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (41,27,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS\\G\n*************************** 1. row ***************************\n File: master-bin.000002\n Position: 1307\n Binlog_Do_DB: test\n Binlog_Ignore_DB: manual, mysql\nExecuted_Gtid_Set: 3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-master-status.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (42,32,'TO_SECONDS','Syntax:\nTO_SECONDS(expr)\n\nGiven a date or datetime expr, returns the number of seconds since the\nyear 0. If expr is not a valid date or datetime value, returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TO_SECONDS(950501);\n -> 62966505600\nmysql> SELECT TO_SECONDS(\'2009-11-29\');\n -> 63426672000\nmysql> SELECT TO_SECONDS(\'2009-11-29 13:43:32\');\n -> 63426721412\nmysql> SELECT TO_SECONDS( NOW() );\n -> 63426721458\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (43,32,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 − datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n -> 128885\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (44,35,'SPATIAL','For InnoDB and MyISAM tables, MySQL can create spatial indexes using\nsyntax similar to that for creating regular indexes, but using the\nSPATIAL keyword. Columns in spatial indexes must be declared NOT NULL.\nThe following examples demonstrate how to create spatial indexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g));\n\no With ALTER TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL);\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL);\nCREATE SPATIAL INDEX g ON geom (g);\n\nSPATIAL INDEX creates an R-tree index. For storage engines that support\nnonspatial indexing of spatial columns, the engine creates a B-tree\nindex. A B-tree index on spatial values is useful for exact-value\nlookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX g ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-indexes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (45,16,'JSON_ARRAYAGG','Syntax:\nJSON_ARRAYAGG(col_or_expr)\n\nAggregates a result set as a single JSON array whose elements consist\nof the rows. The order of elements in this array is undefined. The\nfunction acts on a column or an expression that evaluates to a single\nvalue. Returns NULL if the result contains no rows, or in the event of\nan error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT o_id, attribute, value FROM t3;\n+------+-----------+-------+\n| o_id | attribute | value |\n+------+-----------+-------+\n| 2 | color | red |\n| 2 | fabric | silk |\n| 3 | color | green |\n| 3 | shape | square|\n+------+-----------+-------+\n4 rows in set (0.00 sec)\n\nmysql> SELECT o_id, JSON_ARRAYAGG(attribute) AS attributes \n > FROM t3 GROUP BY o_id;\n+------+---------------------+\n| o_id | attributes |\n+------+---------------------+\n| 2 | ["color", "fabric"] |\n| 3 | ["color", "shape"] |\n+------+---------------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (46,38,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (47,20,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n -> 0\nmysql> SELECT ISNULL(1/0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (48,13,'ST_STARTPOINT','ST_StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\nIf the argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_StartPoint(ST_GeomFromText(@ls)));\n+------------------------------------------------+\n| ST_AsText(ST_StartPoint(ST_GeomFromText(@ls))) |\n+------------------------------------------------+\n| POINT(1 1) |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (49,23,'BINARY','BINARY[(M)]\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. An optional length M\nrepresents the column length in bytes. If omitted, M defaults to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (50,23,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/blob.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (51,17,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (52,20,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (53,27,'SHOW PROFILES','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILES statement, together with SHOW PROFILE, displays\nprofiling information that indicates resource usage for statements\nexecuted during the course of the current session. For more\ninformation, see [HELP SHOW PROFILE].\n\n*Note*:\n\nThe SHOW PROFILE and SHOW PROFILES statements are deprecated and will\nbe removed in a future MySQL release. Use the Performance Schema\ninstead; see\nhttp://dev.mysql.com/doc/refman/5.7/en/performance-schema-query-profili\nng.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-profiles.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-profiles.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (54,28,'UPDATE','Syntax:\nUPDATE is a DML statement that modifies rows in a table.\n\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n SET assignment_list\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nvalue:\n {expr | DEFAULT}\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET assignment_list\n [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. Each matching row is\nupdated once, even if it matches the conditions multiple times. For\nmultiple-table syntax, ORDER BY and LIMIT cannot be used.\n\nFor partitioned tables, both the single-single and multiple-table forms\nof this statement support the use of a PARTITION option as part of a\ntable reference. This option takes a list of one or more partitions or\nsubpartitions (or both). Only the partitions (or subpartitions) listed\nare checked for matches, and a row that is not in any of these\npartitions or subpartitions is not updated, whether it satisfies the\nwhere_condition or not.\n\n*Note*:\n\nUnlike the case when using PARTITION with an INSERT or REPLACE\nstatement, an otherwise valid UPDATE ... PARTITION statement is\nconsidered successful even if no rows in the listed partitions (or\nsubpartitions) match the where_condition.\n\nFor more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated. For expression syntax, see\nhttp://dev.mysql.com/doc/refman/5.7/en/expressions.html.\n\ntable_references and where_condition are specified as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no With the LOW_PRIORITY modifier, execution of the UPDATE is delayed\n until no other clients are reading from the table. This affects only\n storage engines that use only table-level locking (such as MyISAM,\n MEMORY, and MERGE).\n\no With the IGNORE modifier, the update statement does not abort even if\n errors occur during the update. Rows for which duplicate-key\n conflicts occur on a unique key value are not updated. Rows updated\n to values that would cause data conversion errors are updated to the\n closest valid values instead. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#ignore-strict-co\n mparison.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/update.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (55,24,'CASE STATEMENT','Syntax:\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct.\n\n*Note*:\n\nThere is also a CASE expression, which differs from the CASE statement\ndescribed here. See\nhttp://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nFor the first syntax, case_value is an expression. This value is\ncompared to the when_value expression in each WHEN clause until one of\nthem is equal. When an equal when_value is found, the corresponding\nTHEN clause statement_list executes. If no when_value is equal, the\nELSE clause statement_list executes, if there is one.\n\nThis syntax cannot be used to test for equality with NULL because NULL\n= NULL is false. See\nhttp://dev.mysql.com/doc/refman/5.7/en/working-with-null.html.\n\nFor the second syntax, each WHEN clause search_condition expression is\nevaluated until one is true, at which point its corresponding THEN\nclause statement_list executes. If no search_condition is equal, the\nELSE clause statement_list executes, if there is one.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nTo handle situations where no value is matched by any WHEN clause, use\nan ELSE containing an empty BEGIN ... END block, as shown in this\nexample. (The indentation used here in the ELSE clause is for purposes\nof clarity only, and is not otherwise significant.)\n\nDELIMITER |\n\nCREATE PROCEDURE p()\n BEGIN\n DECLARE v INT DEFAULT 1;\n\n CASE v\n WHEN 2 THEN SELECT v;\n WHEN 3 THEN SELECT 0;\n ELSE\n BEGIN\n END;\n END CASE;\n END;\n |\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/case.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/case.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (56,7,'ST_SIMPLIFY','ST_Simplify(g, max_distance)\n\nSimplifies a geometry using the Douglas-Peucker algorithm and returns a\nsimplified value of the same type. If any argument is NULL, the return\nvalue is NULL.\n\nThe geometry may be any geometry type, although the Douglas-Peucker\nalgorithm may not actually process every type. A geometry collection is\nprocessed by giving its components one by one to the simplification\nalgorithm, and the returned geometries are put into a geometry\ncollection as result.\n\nThe max_distance argument is the distance (in units of the input\ncoordinates) of a vertex to other segments to be removed. Vertices\nwithin this distance of the simplified linestring are removed. If the\nmax_distance argument is not positive, or is NaN, an ER_WRONG_ARGUMENTS\nerror occurs.\n\nAccording to Boost.Geometry, geometries might become invalid as a\nresult of the simplification process, and the process might create\nself-intersections. To check the validity of the result, pass it to\nST_IsValid().\n\nIf the geometry argument is not a syntactically well-formed geometry\nbyte string, an ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @g = ST_GeomFromText(\'LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3)\');\nmysql> SELECT ST_AsText(ST_Simplify(@g, 0.5));\n+---------------------------------+\n| ST_AsText(ST_Simplify(@g, 0.5)) |\n+---------------------------------+\n| LINESTRING(0 0,0 1,1 1,2 3,3 3) |\n+---------------------------------+\nmysql> SELECT ST_AsText(ST_Simplify(@g, 1.0));\n+---------------------------------+\n| ST_AsText(ST_Simplify(@g, 1.0)) |\n+---------------------------------+\n| LINESTRING(0 0,3 3) |\n+---------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (57,8,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/execute.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (58,40,'DROP INDEX','Syntax:\nDROP INDEX index_name ON tbl_name\n [algorithm_option | lock_option] ...\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-index.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (59,3,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n -> 2\nmysql> SELECT ABS(-32);\n -> 32\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (60,14,'IS_IPV4','Syntax:\nIS_IPV4(expr)\n\nReturns 1 if the argument is a valid IPv4 address specified as a\nstring, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4(\'10.0.5.9\'), IS_IPV4(\'10.0.5.256\');\n -> 1, 0\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (61,33,'POLYFROMWKB','PolyFromWKB(wkb[, srid]), PolygonFromWKB(wkb[, srid])\n\nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB(), and\nPolygonFromWKB() are synonyms. For more information, see the\ndescription of ST_PolyFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (62,38,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (63,38,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n -> \' \'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (64,16,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nIf there are no matching rows, MAX() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (65,22,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name\n RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the base name of the shared library file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/udf-compiling.html.\n\nTo create a function, you must have the INSERT privilege for the mysql\nsystem database. This is necessary because CREATE FUNCTION adds a row\nto the mysql.func system table that records the function\'s name, type,\nand shared library name. If you do not have this table, you should run\nthe mysql_upgrade command to create it. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-upgrade.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-function-udf.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (66,23,'TIMESTAMP','TIMESTAMP[(fsp)]\n\nA timestamp. The range is \'1970-01-01 00:00:01.000000\' UTC to\n\'2038-01-19 03:14:07.999999\' UTC. TIMESTAMP values are stored as the\nnumber of seconds since the epoch (\'1970-01-01 00:00:00\' UTC). A\nTIMESTAMP cannot represent the value \'1970-01-01 00:00:00\' because that\nis equivalent to 0 seconds from the epoch and the value 0 is reserved\nfor representing \'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nAn optional fsp value in the range from 0 to 6 may be given to specify\nfractional seconds precision. A value of 0 signifies that there is no\nfractional part. If omitted, the default precision is 0.\n\nThe way the server handles TIMESTAMP definitions depends on the value\nof the explicit_defaults_for_timestamp system variable (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html).\n\nIf explicit_defaults_for_timestamp is enabled, there is no automatic\nassignment of the DEFAULT CURRENT_TIMESTAMP or ON UPDATE\nCURRENT_TIMESTAMP attributes to any TIMESTAMP column. They must be\nincluded explicitly in the column definition. Also, any TIMESTAMP not\nexplicitly declared as NOT NULL permits NULL values.\n\nIf explicit_defaults_for_timestamp is disabled, the server handles\nTIMESTAMP as follows:\n\nUnless specified otherwise, the first TIMESTAMP column in a table is\ndefined to be automatically set to the date and time of the most recent\nmodification if not explicitly assigned a value. This makes TIMESTAMP\nuseful for recording the timestamp of an INSERT or UPDATE operation.\nYou can also set any TIMESTAMP column to the current date and time by\nassigning it a NULL value, unless it has been defined with the NULL\nattribute to permit NULL values.\n\nAutomatic initialization and updating to the current date and time can\nbe specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE\nCURRENT_TIMESTAMP column definition clauses. By default, the first\nTIMESTAMP column has these properties, as previously noted. However,\nany TIMESTAMP column in a table can be defined to have these\nproperties.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (67,7,'CREATE_ASYMMETRIC_PUB_KEY','Syntax:\nCREATE_ASYMMETRIC_PUB_KEY(algorithm, priv_key_str)\n\nDerives a public key from the given private key using the given\nalgorithm, and returns the key as a binary string in PEM format. If key\nderivation fails, the result is NULL.\n\npriv_key_str must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nFor a usage example, see the description of\nCREATE_ASYMMETRIC_PRIV_KEY().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (68,27,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n [PARTITION (partition_list | ALL)]\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE 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: http://dev.mysql.com/doc/refman/5.7/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/cache-index.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (69,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (70,28,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for InnoDB and MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/handler.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (71,9,'HELP_DATE','This help information was generated from the MySQL 5.7 Reference Manual\non: 2018-10-03\n','',''); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (72,40,'RENAME TABLE','Syntax:\nRENAME TABLE\n tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nRENAME TABLE renames one or more tables. You must have ALTER and DROP\nprivileges for the original table, and CREATE and INSERT privileges for\nthe new table.\n\nFor example, to rename a table named old_table to to new_table, use\nthis statement:\n\nRENAME TABLE old_table TO new_table;\n\nThat statement is equivalent to the following ALTER TABLE statement:\n\nALTER TABLE old_table RENAME new_table;\n\nRENAME TABLE, unlike ALTER TABLE, can rename multiple tables within a\nsingle statement:\n\nRENAME TABLE old_table1 TO new_table1,\n old_table2 TO new_table2,\n old_table3 TO new_table3;\n\nRenaming operations are performed left to right. Thus, to swap two\ntable names, do this (assuming that a table with the intermediary name\ntmp_table does not already exist):\n\nRENAME TABLE old_table TO tmp_table,\n new_table TO old_table,\n tmp_table TO new_table;\n\nTo execute RENAME TABLE, there must be no active transactions or tables\nlocked with LOCK TABLES. With the transaction table locking conditions\nsatisfied, the rename operation is done atomically; no other session\ncan access any of the tables while the rename is in progress.\n\nIf any errors occur during a RENAME TABLE, the statement fails and no\nchanges are made.\n\nYou can use RENAME TABLE to move a table from one database to another:\n\nRENAME TABLE current_db.tbl_name TO other_db.tbl_name;\n\nUsing this method to move all tables from one database to a different\none in effect renames the database (an operation for which MySQL has no\nsingle statement), except that the original database continues to\nexist, albeit with no tables.\n\nLike RENAME TABLE, ALTER TABLE ... RENAME can also be used to move a\ntable to a different database. Regardless of the statement used, if the\nrename operation would move the table to a database located on a\ndifferent file system, the success of the outcome is platform specific\nand depends on the underlying operating system calls used to move table\nfiles.\n\nIf a table has triggers, attempts to rename the table into a different\ndatabase fail with a Trigger in wrong schema (ER_TRG_IN_WRONG_SCHEMA)\nerror.\n\nTo rename TEMPORARY tables, RENAME TABLE does not work. Use ALTER TABLE\ninstead.\n\nRENAME TABLE works for views, except that views cannot be renamed into\na different database.\n\nAny privileges granted specifically for a renamed table or view are not\nmigrated to the new name. They must be changed manually.\n\nRENAME TABLE changes internally generated foreign key constraint names\nand user-defined foreign key constraint names that contain the string\n"tbl_name_ibfk_" to reflect the new table name. InnoDB interprets\nforeign key constraint names that contain the string "tbl_name_ibfk_"\nas internally generated names.\n\nForeign key constraint names that point to the renamed table are\nautomatically updated unless there is a conflict, in which case the\nstatement fails with an error. A conflict occurs if the renamed\nconstraint name already exists. In such cases, you must drop and\nre-create the foreign keys for them to function properly.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/rename-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/rename-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (73,23,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (74,7,'JSON_EXTRACT','Syntax:\nJSON_EXTRACT(json_doc, path[, path] ...)\n\nReturns data from a JSON document, selected from the parts of the\ndocument matched by the path arguments. Returns NULL if any argument is\nNULL or no paths locate a value in the document. An error occurs if the\njson_doc argument is not a valid JSON document or any path argument is\nnot a valid path expression.\n\nThe return value consists of all values matched by the path arguments.\nIf it is possible that those arguments could return multiple values,\nthe matched values are autowrapped as an array, in the order\ncorresponding to the paths that produced them. Otherwise, the return\nvalue is the single matched value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\');\n+--------------------------------------------+\n| JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\') |\n+--------------------------------------------+\n| 20 |\n+--------------------------------------------+\nmysql> SELECT JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\', \'$[0]\');\n+----------------------------------------------------+\n| JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\', \'$[0]\') |\n+----------------------------------------------------+\n| [20, 10] |\n+----------------------------------------------------+\nmysql> SELECT JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[2][*]\');\n+-----------------------------------------------+\n| JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[2][*]\') |\n+-----------------------------------------------+\n| [30, 40] |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (75,3,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (76,37,'ST_GEOMETRYTYPE','ST_GeometryType(g)\n\nReturns a binary string indicating the name of the geometry type of\nwhich the geometry instance g is a member, or NULL if the argument is\nNULL. The name corresponds to one of the instantiable Geometry\nsubclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_GeometryType(ST_GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------------+\n| ST_GeometryType(ST_GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------------+\n| POINT |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (77,29,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not\ncase-sensitive.\n\nThe search string can contain the wildcard characters % and _. These\nhave the same meaning as for pattern-matching operations performed with\nthe LIKE operator. For example, HELP \'rep%\' returns a list of topics\nthat begin with rep.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/help.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (78,38,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (79,27,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n [IN \'log_name\']\n [FROM pos]\n [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (80,33,'MPOLYFROMWKB','MPolyFromWKB(wkb[, srid]), MultiPolygonFromWKB(wkb[, srid])\n\nST_MPolyFromWKB(), ST_MultiPolygonFromWKB(), MPolyFromWKB(), and\nMultiPolygonFromWKB() are synonyms. For more information, see the\ndescription of ST_MPolyFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (81,24,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "start the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/iterate.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/iterate.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (82,28,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nExample: This SELECT statement pauses, but also produces a result set:\n\nmysql> SELECT SLEEP(5);\n+----------+\n| SLEEP(5) |\n+----------+\n| 0 |\n+----------+\n1 row in set (5.02 sec)\n\nDO, on the other hand, pauses without producing a result set.:\n\nmysql> DO SLEEP(5);\nQuery OK, 0 rows affected (4.99 sec)\n\nThis could be useful, for example in a stored function or trigger,\nwhich prohibit statements that produce result sets.\n\nDO only executes expressions. It cannot be used in all cases where\nSELECT can be used. For example, DO id FROM t1 is invalid because it\nreferences a table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/do.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (83,38,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmultibyte character counts as a single character. This means that for a\nstring containing five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (84,23,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but permits assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (85,33,'ST_ASTEXT','ST_AsText(g), ST_AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nIf the argument is NULL, the return value is NULL. If the argument is\nnot a syntactically well-formed geometry, an ER_GIS_INVALID_DATA error\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,2 2,3 3) |\n+--------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (86,7,'JSON_TYPE','Syntax:\nJSON_TYPE(json_val)\n\nReturns a utf8mb4 string indicating the type of a JSON value. This can\nbe an object, an array, or a scalar type, as shown here:\n\nmysql> SET @j = \'{"a": [10, true]}\';\nmysql> SELECT JSON_TYPE(@j);\n+---------------+\n| JSON_TYPE(@j) |\n+---------------+\n| OBJECT |\n+---------------+\nmysql> SELECT JSON_TYPE(JSON_EXTRACT(@j, \'$.a\'));\n+------------------------------------+\n| JSON_TYPE(JSON_EXTRACT(@j, \'$.a\')) |\n+------------------------------------+\n| ARRAY |\n+------------------------------------+\nmysql> SELECT JSON_TYPE(JSON_EXTRACT(@j, \'$.a[0]\'));\n+---------------------------------------+\n| JSON_TYPE(JSON_EXTRACT(@j, \'$.a[0]\')) |\n+---------------------------------------+\n| INTEGER |\n+---------------------------------------+\nmysql> SELECT JSON_TYPE(JSON_EXTRACT(@j, \'$.a[1]\'));\n+---------------------------------------+\n| JSON_TYPE(JSON_EXTRACT(@j, \'$.a[1]\')) |\n+---------------------------------------+\n| BOOLEAN |\n+---------------------------------------+\n\nJSON_TYPE() returns NULL if the argument is NULL:\n\nmysql> SELECT JSON_TYPE(NULL);\n+-----------------+\n| JSON_TYPE(NULL) |\n+-----------------+\n| NULL |\n+-----------------+\n\nAn error occurs if the argument is not a valid JSON value:\n\nmysql> SELECT JSON_TYPE(1);\nERROR 3146 (22032): Invalid data type for JSON data in argument 1\nto function json_type; a JSON string or JSON type is required.\n\nFor a non-NULL, non-error result, the following list describes the\npossible JSON_TYPE() return values:\n\no Purely JSON types:\n\n o OBJECT: JSON objects\n\n o ARRAY: JSON arrays\n\n o BOOLEAN: The JSON true and false literals\n\n o NULL: The JSON null literal\n\no Numeric types:\n\n o INTEGER: MySQL TINYINT, SMALLINT, MEDIUMINT and INT and BIGINT\n scalars\n\n o DOUBLE: MySQL DOUBLE FLOAT scalars\n\n o DECIMAL: MySQL DECIMAL and NUMERIC scalars\n\no Temporal types:\n\n o DATETIME: MySQL DATETIME and TIMESTAMP scalars\n\n o DATE: MySQL DATE scalars\n\n o TIME: MySQL TIME scalars\n\no String types:\n\n o STRING: MySQL utf8 character type scalars: CHAR, VARCHAR, TEXT,\n ENUM, and SET\n\no Binary types:\n\n o BLOB: MySQL binary type scalars: BINARY, VARBINARY, BLOB\n\n o BIT: MySQL BIT scalars\n\no All other types:\n\n o OPAQUE (raw bits)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (87,38,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe element or elements matched by the XPath expression.\n\nUsing this function is the equivalent of performing a match using the\nxpath_expr after appending /text(). In other words,\nExtractValue(\'Sakila\', \'/a/b\') and\nExtractValue(\'Sakila\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, the content of the first child text node\nof each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text())---for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed---an empty string is returned. No distinction is made between a\nmatch on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1 |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*:\n\nExtractValue() returns only CDATA, and does not return any tags that\nmight be contained within a matching tag, nor any of their content (see\nthe result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html\n\n','mysql> SELECT\n -> ExtractValue(\'cccddd\', \'/a\') AS val1,\n -> ExtractValue(\'cccddd\', \'/a/b\') AS val2,\n -> ExtractValue(\'cccddd\', \'//b\') AS val3,\n -> ExtractValue(\'cccddd\', \'/b\') AS val4,\n -> ExtractValue(\'cccdddeee\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (88,12,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added when the implementation of PASSWORD() was\nchanged in MySQL 4.1 to improve security. OLD_PASSWORD() returned the\nvalue of the pre-4.1 implementation of PASSWORD() as a string, and was\nintended to permit you to reset passwords for any pre-4.1 clients that\nneed to connect to your MySQL server without locking them out. See\nhttp://dev.mysql.com/doc/refman/5.7/en/password-hashing.html.\n\nPasswords that use the pre-4.1 hashing method are less secure than\npasswords that use the native password hashing method. Support for\npre-4.1 passwords was removed in MySQL 5.7.5, as was OLD_PASSWORD().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (89,38,'FORMAT','Syntax:\nFORMAT(X,D[,locale])\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nThe optional third parameter enables a locale to be specified to be\nused for the result number\'s decimal point, thousands separator, and\ngrouping between separators. Permissible locale values are the same as\nthe legal values for the lc_time_names system variable (see\nhttp://dev.mysql.com/doc/refman/5.7/en/locale-support.html). If no\nlocale is specified, the default is \'en_US\'.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n -> \'12,332\'\nmysql> SELECT FORMAT(12332.2,2,\'de_DE\');\n -> \'12.332,20\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (90,38,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n -> 32\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (91,2,'EXTERIORRING','ExteriorRing(poly)\n\nST_ExteriorRing() and ExteriorRing() are synonyms. For more\ninformation, see the description of ST_ExteriorRing().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (92,33,'GEOMFROMWKB','GeomFromWKB(wkb[, srid]), GeometryFromWKB(wkb[, srid])\n\nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB(), and\nGeometryFromWKB() are synonyms. For more information, see the\ndescription of ST_GeomFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (93,20,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.7/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (94,25,'MULTIPOLYGON','MultiPolygon(poly [, poly] ...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (95,38,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (96,13,'ST_ISCLOSED','ST_IsClosed(ls)\n\nFor a LineString value ls, ST_IsClosed() returns 1 if ls is closed\n(that is, its ST_StartPoint() and ST_EndPoint() values are the same).\nIf the argument is NULL or an empty geometry, the return value is NULL.\n\nFor a MultiLineString value ls, ST_IsClosed() returns 1 if ls is closed\n(that is, the ST_StartPoint() and ST_EndPoint() values are the same for\neach LineString in ls).\n\nST_IsClosed() returns 0 if ls is not closed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls1 = \'LineString(1 1,2 2,3 3,2 2)\';\nmysql> SET @ls2 = \'LineString(1 1,2 2,3 3,1 1)\';\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls1));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls1)) |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls2));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls2)) |\n+------------------------------------+\n| 1 |\n+------------------------------------+\n\nmysql> SET @ls3 = \'MultiLineString((1 1,2 2,3 3),(4 4,5 5))\';\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls3));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls3)) |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (97,27,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/query-cache-status-and-maintenance.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (98,23,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... SET\nvalues are represented internally as integers.\n\nA SET column can have a maximum of 64 distinct members. A table can\nhave no more than 255 unique element list definitions among its ENUM\nand SET columns considered as a group. For more information on this\nlimit, see http://dev.mysql.com/doc/refman/5.7/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (99,3,'RAND','Syntax:\nRAND([N])\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. To\nobtain a random integer R in the range i <= R < j, use the expression\nFLOOR(i + RAND() * (j − i)). For example, to obtain a random integer\nin the range the range 7 <= R < 12, use the following statement:\n\nSELECT FLOOR(7 + (RAND() * 5));\n\nIf an integer argument N is specified, it is used as the seed value:\n\no With a constant initializer argument, the seed is initialized once\n when the statement is prepared, prior to execution.\n\no With a nonconstant initializer argument (such as a column name), the\n seed is initialized with the value for each invocation of RAND().\n\nOne implication of this behavior is that for equal argument values,\nRAND(N) returns the same value each time, and thus produces a\nrepeatable sequence of column values. In the following example, the\nsequence of values produced by RAND(3) is the same both places it\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (100,38,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (101,23,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (102,38,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'Aa\', \'Bb\', \'Cc\', \'Dd\');\n -> \'Aa\'\nmysql> SELECT ELT(4, \'Aa\', \'Bb\', \'Cc\', \'Dd\');\n -> \'Dd\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (103,7,'ST_LONGFROMGEOHASH','ST_LongFromGeoHash(geohash_str)\n\nReturns the longitude from a geohash string value, as a DOUBLE value in\nthe range [−180, 180].\n\nIf the argument is NULL, the return value is NULL. If the argument is\ninvalid, an error occurs.\n\nThe remarks in the description of ST_LatFromGeoHash() regarding the\nmaximum number of characters processed from the geohash_str argument\nalso apply to ST_LongFromGeoHash().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SELECT ST_LongFromGeoHash(ST_GeoHash(45,-20,10));\n+-------------------------------------------+\n| ST_LongFromGeoHash(ST_GeoHash(45,-20,10)) |\n+-------------------------------------------+\n| 45 |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (104,40,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW see [HELP CREATE VIEW]). This\nstatement requires the CREATE VIEW and DROP privileges for the view,\nand some privilege for each column referred to in the SELECT statement.\nALTER VIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-view.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (105,27,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-databases.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (106,32,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (107,38,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str. Returns NULL if substr\nor str is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n -> 7\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (108,27,'SHOW EVENTS','Syntax:\nSHOW EVENTS\n [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement displays information about Event Manager events, which\nare discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/event-scheduler.html. It\nrequires the EVENT privilege for the database from which the events are\nto be shown.\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW 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: 1\n Interval field: DAY\n Starts: 2018-08-08 11:06:34\n Ends: NULL\n Status: ENABLED\n Originator: 1\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-events.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (109,7,'JSON_INSERT','Syntax:\nJSON_INSERT(json_doc, path, val[, path, val] ...)\n\nInserts data into a JSON document and returns the result. Returns NULL\nif any argument is NULL. An error occurs if the json_doc argument is\nnot a valid JSON document or any path argument is not a valid path\nexpression or contains a * or ** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nA path-value pair for an existing path in the document is ignored and\ndoes not overwrite the existing document value. A path-value pair for a\nnonexisting path in the document adds the value to the document if the\npath identifies one of these types of values:\n\no A member not present in an existing object. The member is added to\n the object and associated with the new value.\n\no A position past the end of an existing array. The array is extended\n with the new value. If the existing value is not an array, it is\n autowrapped as an array, then extended with the new value.\n\nOtherwise, a path-value pair for a nonexisting path in the document is\nignored and has no effect.\n\nFor a comparison of JSON_INSERT(), JSON_REPLACE(), and JSON_SET(), see\nthe discussion of JSON_SET().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'{ "a": 1, "b": [2, 3]}\';\nmysql> SELECT JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+----------------------------------------------------+\n| JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+----------------------------------------------------+\n| {"a": 1, "b": [2, 3], "c": "[true, false]"} |\n+----------------------------------------------------+\n\nmysql> SELECT JSON_INSERT(@j, \'$.a\', 10, \'$.c\', CAST(\'[true, false]\' AS JSON));\n+------------------------------------------------------------------+\n| JSON_INSERT(@j, \'$.a\', 10, \'$.c\', CAST(\'[true, false]\' AS JSON)) |\n+------------------------------------------------------------------+\n| {"a": 1, "b": [2, 3], "c": [true, false]} |\n+------------------------------------------------------------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (110,7,'JSON_UNQUOTE','Syntax:\nJSON_UNQUOTE(json_val)\n\nUnquotes JSON value and returns the result as a utf8mb4 string. Returns\nNULL if the argument is NULL. An error occurs if the value starts and\nends with double quotes but is not a valid JSON string literal.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'"abc"\';\nmysql> SELECT @j, JSON_UNQUOTE(@j);\n+-------+------------------+\n| @j | JSON_UNQUOTE(@j) |\n+-------+------------------+\n| "abc" | abc |\n+-------+------------------+\nmysql> SET @j = \'[1, 2, 3]\';\nmysql> SELECT @j, JSON_UNQUOTE(@j);\n+-----------+------------------+\n| @j | JSON_UNQUOTE(@j) |\n+-----------+------------------+\n| [1, 2, 3] | [1, 2, 3] |\n+-----------+------------------+\n\nmysql> SELECT @@sql_mode;\n+------------+\n| @@sql_mode |\n+------------+\n| |\n+------------+\n\nmysql> SELECT JSON_UNQUOTE(\'"\\\\t\\\\u0032"\');\n+------------------------------+\n| JSON_UNQUOTE(\'"\\\\t\\\\u0032"\') |\n+------------------------------+\n| 2 |\n+------------------------------+\n\nmysql> SET @@sql_mode = \'NO_BACKSLASH_ESCAPES\';\nmysql> SELECT JSON_UNQUOTE(\'"\\\\t\\\\u0032"\');\n+------------------------------+\n| JSON_UNQUOTE(\'"\\\\t\\\\u0032"\') |\n+------------------------------+\n| \\t\\u0032 |\n+------------------------------+\n\nmysql> SELECT JSON_UNQUOTE(\'"\\t\\u0032"\');\n+----------------------------+\n| JSON_UNQUOTE(\'"\\t\\u0032"\') |\n+----------------------------+\n| 2 |\n+----------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (111,23,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 − 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\n4-byte length prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (112,27,'KILL','Syntax:\nKILL [CONNECTION | QUERY] processlist_id\n\nEach connection to mysqld runs in a separate thread. You can kill a\nthread with the KILL processlist_id statement.\n\nThread processlist identifiers can be determined from the ID column of\nthe INFORMATION_SCHEMA PROCESSLIST table, the Id column of SHOW\nPROCESSLIST output, and the PROCESSLIST_ID column of the Performance\nSchema threads table. The value for the current thread is returned by\nthe CONNECTION_ID() function.\n\nKILL permits an optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n the connection associated with the given processlist_id, after\n terminating any statement the connection is executing.\n\no KILL QUERY terminates the statement the connection is currently\n executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*:\n\nYou cannot use KILL with the Embedded MySQL Server library because the\nembedded server merely runs inside the threads of the host application.\nIt does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/kill.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (113,7,'DISJOINT','Disjoint(g1, g2)\n\nMBRDisjoint() and Disjoint() are synonyms. For more information, see\nthe description of MBRDisjoint().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (114,38,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (115,7,'OVERLAPS','Overlaps(g1, g2)\n\nMBROverlaps() and Overlaps() are synonyms. For more information, see\nthe description of MBROverlaps().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (116,8,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-global-sql-slave-skip-counter.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (117,7,'MBREQUAL','MBREqual(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (118,34,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\n*Note*:\n\nPROCEDURE ANALYSE() is deprecated as of MySQL 5.7.18, and is removed in\nMySQL 8.0.\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nA PROCEDURE clause is not permitted in a UNION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/procedure-analyse.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (119,9,'HELP_VERSION','This help information was generated from the MySQL 5.7 Reference Manual\non: 2018-10-03 (revision: 59320)\n\nThis information applies to MySQL 5.7 through 5.7.25.\n','',''); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (120,38,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (121,27,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-privileges.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (122,40,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n\n InnoDB and NDB:\n ADD DATAFILE \'file_name\'\n\n InnoDB only:\n [FILE_BLOCK_SIZE = value]\n\n NDB only:\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] \'string\']\n\n InnoDB and NDB:\n [ENGINE [=] engine_name]\n\nThis statement is used to create a tablespace. The precise syntax and\nsemantics depend on the storage engine used. In standard MySQL 5.7\nreleases, this is always an InnoDB tablespace. MySQL NDB Cluster 7.5\nalso supports tablespaces using the NDB storage engine in addition to\nthose using InnoDB.\n\nConsiderations for InnoDB\n\nAn InnoDB tablespace created using CREATE TABLESPACE is referred to as\na general tablespace. This is a shared tablespace, similar to the\nsystem tablespace. It can hold multiple tables, and supports all table\nrow formats. General tablespaces can be created in a location relative\nto or independent of the MySQL data directory.\n\nAfter creating an InnoDB general tablespace, you can use CREATE TABLE\ntbl_name ... TABLESPACE [=] tablespace_name or ALTER TABLE tbl_name\nTABLESPACE [=] tablespace_name to add tables to the tablespace.\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/general-tablespaces.html.\n\nConsiderations for NDB Cluster\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for NDB Cluster Disk Data\ntables (see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data.html).\nOne data file is created and added to the tablespace using this\nstatement. Additional data files may be added to the tablespace by\nusing the ALTER TABLESPACE statement (see [HELP ALTER TABLESPACE]).\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see [HELP CREATE LOGFILE GROUP]). Multiple tablespaces\nmay use the same log file group for UNDO logging.\n\nWhen setting EXTENT_SIZE or INITIAL_SIZE, you may optionally follow the\nnumber with a one-letter abbreviation for an order of magnitude,\nsimilar to those used in my.cnf. Generally, this is one of the letters\nM (for megabytes) or G (for gigabytes).\n\nINITIAL_SIZE and EXTENT_SIZE are subject to rounding as follows:\n\no EXTENT_SIZE is rounded up to the nearest whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K;\n this result is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nWhen CREATE TABLESPACE is used with ENGINE [=] NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. (See the example\nlater in this section.)\n\n(See http://dev.mysql.com/doc/refman/5.7/en/files-table.html.)\n\nOptions\n\no ADD DATAFILE: Defines the name of a tablespace data file; this option\n is always required. An InnoDB tablespace supports only a single data\n file, whose name must include a .ibd extension. An NDB Cluster\n tablespace supports multiple data files which can have any legal file\n names; more data files can be added to an NDB Cluster tablespace\n following its creation by using an ALTER TABLESPACE statement.\n\n *Note*:\n\n ALTER TABLESPACE is not supported by InnoDB.\n\n To place the data file in a location outside of the MySQL data\n directory (datadir), include an absolute directory path or a path\n relative to the MySQL data directory. If you do not specify a path,\n the tablespace is created in the MySQL data directory. An isl file is\n created in the MySQL data directory when an InnoDB tablespace is\n created outside of the MySQL data directory.\n\n To avoid conflicts with implicitly created file-per-table\n tablespaces, creating a general tablespace in a subdirectory under\n the MySQL data directory is not supported. Also, when creating a\n general tablespace outside of the MySQL data directory, the directory\n must exist prior to creating the tablespace.\n\n The file_name, including the path (optional), must be quoted with\n single or double quotations marks. File names (not counting any\n ".ibd" extension for InnoDB files) and directory names must be at\n least one byte in length. Zero length file names and directory names\n are not supported.\n\no FILE_BLOCK_SIZE: This option---which is specific to InnoDB, and is\n ignored by NDB---defines the block size for the tablespace data file.\n Values can be specified in bytes or kilobytes. For example, an 8\n kilobyte file block size can be specified as 8192 or 8K. If you do\n not specify this option, FILE_BLOCK_SIZE defaults to\n innodb_page_size. FILE_BLOCK_SIZE is required when you intend to use\n the tablespace for storing compressed InnoDB tables\n (ROW_FORMAT=COMPRESSED).\n\n If FILE_BLOCK_SIZE is equal innodb_page_size, the tablespace can\n contain only tables having an uncompressed row format (COMPACT,\n REDUNDANT, or DYNAMIC). The physical page size for tables using\n COMPRESSED differs from that of uncompressed tables; this means that\n compressed tables and uncompressed tables cannot coexist in the same\n tablespace.\n\n For a general tablespace to contain compressed tables,\n FILE_BLOCK_SIZE must be specified, and the FILE_BLOCK_SIZE value must\n be a valid compressed page size in relation to the innodb_page_size\n value. Also, the physical page size of the compressed table\n (KEY_BLOCK_SIZE) must be equal to FILE_BLOCK_SIZE/1024. For example,\n if innodb_page_size=16K, and FILE_BLOCK_SIZE=8K, the KEY_BLOCK_SIZE\n of the table must be 8. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/general-tablespaces.html.\n\no USE LOGFILE GROUP: Required for NDB, this is the name of a log file\n group previously created using CREATE LOGFILE GROUP. Not supported\n for InnoDB, where it fails with an error.\n\no EXTENT_SIZE: This option is specific to NDB, and is not supported by\n InnoDB, where it fails with an error. EXTENT_SIZE sets the size, in\n bytes, of the extents used by any files belonging to the tablespace.\n The default value is 1M. The minimum size is 32K, and theoretical\n maximum is 2G, although the practical maximum size depends on a\n number of factors. In most cases, changing the extent size does not\n have any measurable effect on performance, and the default value is\n recommended for all but the most unusual situations.\n\n An extent is a unit of disk space allocation. One extent is filled\n with as much data as that extent can contain before another extent is\n used. In theory, up to 65,535 (64K) extents may used per data file;\n however, the recommended maximum is 32,768 (32K). The recommended\n maximum size for a single data file is 32G---that is, 32K extents x 1\n MB per extent. In addition, once an extent is allocated to a given\n partition, it cannot be used to store data from a different\n partition; an extent cannot store data from more than one partition.\n This means, for example that a tablespace having a single datafile\n whose INITIAL_SIZE (described in the following item) is 256 MB and\n whose EXTENT_SIZE is 128M has just two extents, and so can be used to\n store data from at most two different disk data table partitions.\n\n You can see how many extents remain free in a given data file by\n querying the INFORMATION_SCHEMA.FILES table, and so derive an\n estimate for how much space remains free in the file. For further\n discussion and examples, see\n http://dev.mysql.com/doc/refman/5.7/en/files-table.html.\n\no INITIAL_SIZE: This option is specific to NDB, and is not supported by\n InnoDB, where it fails with an error.\n\n The INITIAL_SIZE parameter sets the total size in bytes of the data\n file that was specific using ADD DATATFILE. Once this file has been\n created, its size cannot be changed; however, you can add more data\n files to the tablespace using ALTER TABLESPACE ... ADD DATAFILE.\n\n INITIAL_SIZE is optional; its default value is 134217728 (128 MB).\n\n On 32-bit systems, the maximum supported value for INITIAL_SIZE is\n 4294967296 (4 GB).\n\no AUTOEXTEND_SIZE: Currently ignored by MySQL; reserved for possible\n future use. Has no effect in any release of MySQL 5.7 or MySQL NDB\n Cluster 7.5, regardless of the storage engine used.\n\no MAX_SIZE: Currently ignored by MySQL; reserved for possible future\n use. Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster\n 7.5, regardless of the storage engine used.\n\no NODEGROUP: Currently ignored by MySQL; reserved for possible future\n use. Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster\n 7.5, regardless of the storage engine used.\n\no WAIT: Currently ignored by MySQL; reserved for possible future use.\n Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster 7.5,\n regardless of the storage engine used.\n\no COMMENT: Currently ignored by MySQL; reserved for possible future\n use. Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster\n 7.5, regardless of the storage engine used.\n\no ENGINE: Defines the storage engine which uses the tablespace, where\n engine_name is the name of the storage engine. Currently, only the\n InnoDB storage engine is supported by standard MySQL 5.7 releases.\n MySQL NDB Cluster 7.5 supports both NDB and InnoDB tablespaces. The\n value of the default_storage_engine system variable is used for\n ENGINE if the option is not specified.\n\nNotes\n\no For the rules covering the naming of MySQL tablespaces, see\n http://dev.mysql.com/doc/refman/5.7/en/identifiers.html. In addition\n to these rules, the slash character ("/") is not permitted, nor can\n you use names beginning with innodb_, as this prefix is reserved for\n system use.\n\no Tablespaces do not support temporary tables.\n\no innodb_file_per_table, innodb_file_format, and innodb_file_format_max\n settings have no influence on CREATE TABLESPACE operations.\n innodb_file_per_table does not need to be enabled. General\n tablespaces support all table row formats regardless of file format\n settings. Likewise, general tablespaces support the addition of\n tables of any row format using CREATE TABLE ... TABLESPACE,\n regardless of file format settings.\n\no innodb_strict_mode is not applicable to general tablespaces.\n Tablespace management rules are strictly enforced independently of\n innodb_strict_mode. If CREATE TABLESPACE parameters are incorrect or\n incompatible, the operation fails regardless of the\n innodb_strict_mode setting. When a table is added to a general\n tablespace using CREATE TABLE ... TABLESPACE or ALTER TABLE ...\n TABLESPACE, innodb_strict_mode is ignored but the statement is\n evaluated as if innodb_strict_mode is enabled.\n\no Use DROP TABLESPACE to remove a tablespace. All tables must be\n dropped from a tablespace using DROP TABLE prior to dropping the\n tablespace. Before dropping an NDB Cluster tablespace you must also\n remove all its data files using one or more ALTER TABLESPACE ... DROP\n DATATFILE statements. See\n http://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data-object\n s.html.\n\no All parts of an InnoDB table added to an InnoDB general tablespace\n reside in the general tablespace, including indexes and BLOB pages.\n\n For an NDB table assigned to a tablespace, only those columns which\n are not indexed are stored on disk, and actually use the tablespace\n data files. Indexes and indexed columns for all NDB tables are always\n kept in memory.\n\no Similar to the system tablespace, truncating or dropping tables\n stored in a general tablespace creates free space internally in the\n general tablespace .ibd data file which can only be used for new\n InnoDB data. Space is not released back to the operating system as it\n is for file-per-table tablespaces.\n\no A general tablespace is not associated with any database or schema.\n\no ALTER TABLE ... DISCARD TABLESPACE and ALTER TABLE ...IMPORT\n TABLESPACE are not supported for tables that belong to a general\n tablespace.\n\no The server uses tablespace-level metadata locking for DDL that\n references general tablespaces. By comparison, the server uses\n table-level metadata locking for DDL that references file-per-table\n tablespaces.\n\no A generated or existing tablespace cannot be changed to a general\n tablespace.\n\no Tables stored in a general tablespace can only be opened in MySQL\n 5.7.6 or later due to the addition of new table flags.\n\no There is no conflict between general tablespace names and\n file-per-table tablespace names. The "/" character, which is present\n in file-per-table tablespace names, is not permitted in general\n tablespace names.\n\no mysqldump and mysqlpump do not dump InnoDB CREATE TABLESPACE\n statements.\n\nInnoDB Examples\n\nThis example demonstrates creating a general tablespace and adding\nthree uncompressed tables of different row formats.\n\nmysql> CREATE TABLESPACE `ts1`\n -> ADD DATAFILE \'ts1.ibd\'\n -> ENGINE=INNODB;\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> CREATE TABLE t1 (c1 INT PRIMARY KEY)\n -> TABLESPACE ts1\n -> ROW_FORMAT=REDUNDANT;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CREATE TABLE t2 (c1 INT PRIMARY KEY)\n -> TABLESPACE ts1\n -> ROW_FORMAT=COMPACT;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CREATE TABLE t3 (c1 INT PRIMARY KEY)\n -> TABLESPACE ts1\n -> ROW_FORMAT=DYNAMIC;\nQuery OK, 0 rows affected (0.00 sec)\n\nThis example demonstrates creating a general tablespace and adding a\ncompressed table. The example assumes a default innodb_page_size of\n16KB. The FILE_BLOCK_SIZE of 8192 requires that the compressed table\nhave a KEY_BLOCK_SIZE of 8.\n\nmysql> CREATE TABLESPACE `ts2`\n -> ADD DATAFILE \'ts2.ibd\'\n -> FILE_BLOCK_SIZE = 8192\n -> ENGINE=INNODB;\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> CREATE TABLE t4 (c1 INT PRIMARY KEY)\n -> TABLESPACE ts2\n -> ROW_FORMAT=COMPRESSED\n -> KEY_BLOCK_SIZE=8;\nQuery OK, 0 rows affected (0.00 sec)\n\nNDB Example\n\nSuppose that you wish to create an NDB Cluster Disk Data tablespace\nnamed myts using a datafile named mydata-1.dat. An NDB tablespace\nalways requires the use of a log file group consisting of one or more\nundo log files. For this example, we first create a log file group\nnamed mylg that contains one undo long file named myundo-1.dat, using\nthe CREATE LOGFILE GROUP statement shown here:\n\nmysql> CREATE LOGFILE GROUP myg1\n -> ADD UNDOFILE \'myundo-1.dat\'\n -> ENGINE=NDB;\nQuery OK, 0 rows affected (3.29 sec)\n\nNow you can create the tablespace previously described using the\nfollowing statement:\n\nmysql> CREATE TABLESPACE myts\n -> ADD DATAFILE \'mydata-1.dat\'\n -> USE LOGFILE GROUP mylg\n -> ENGINE=NDB;\nQuery OK, 0 rows affected (2.98 sec)\n\nYou can now create a Disk Data table using a CREATE TABLE statement\nwith the TABLESPACE and STORAGE DISK options, similar to what is shown\nhere:\n\nmysql> CREATE TABLE mytable (\n -> id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> lname VARCHAR(50) NOT NULL,\n -> fname VARCHAR(50) NOT NULL,\n -> dob DATE NOT NULL,\n -> joined DATE NOT NULL,\n -> INDEX(last_name, first_name)\n -> )\n -> TABLESPACE myts STORAGE DISK\n -> ENGINE=NDB;\nQuery OK, 0 rows affected (1.41 sec)\n\nIt is important to note that only the dob and joined columns from\nmytable are actually stored on disk, due to the fact that the id,\nlname, and fname columns are all indexed.\n\nAs mentioned previously, when CREATE TABLESPACE is used with ENGINE [=]\nNDB, a tablespace and associated data file are created on each NDB\nCluster data node. You can verify that the data files were created and\nobtain information about them by querying the INFORMATION_SCHEMA.FILES\ntable, as shown here:\n\nmysql> SELECT FILE_NAME, FILE_TYPE, LOGFILE_GROUP_NAME, STATUS, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'myts\';\n\n+--------------+------------+--------------------+--------+----------------+\n| file_name | file_type | logfile_group_name | status | extra |\n+--------------+------------+--------------------+--------+----------------+\n| mydata-1.dat | DATAFILE | mylg | NORMAL | CLUSTER_NODE=5 |\n| mydata-1.dat | DATAFILE | mylg | NORMAL | CLUSTER_NODE=6 |\n| NULL | TABLESPACE | mylg | NORMAL | NULL |\n+--------------+------------+--------------------+--------+----------------+\n3 rows in set (0.01 sec)\n\nFor additional information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data-objects.\nhtml.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (123,4,'ST_GEOMFROMTEXT','ST_GeomFromText(wkt[, srid]), ST_GeometryFromText(wkt[, srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (124,38,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (125,15,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n -> 0\nmysql> SELECT 1 XOR 0;\n -> 1\nmysql> SELECT 1 XOR NULL;\n -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (126,10,'GRANT','Syntax:\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH {GRANT OPTION | resource_option} ...]\n\nGRANT PROXY ON user\n TO user [, user] ...\n [WITH GRANT OPTION]\n\nobject_type: {\n TABLE\n | FUNCTION\n | PROCEDURE\n}\n\npriv_level: {\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n}\n\nuser:\n (see http://dev.mysql.com/doc/refman/5.7/en/account-names.html)\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n | IDENTIFIED BY PASSWORD \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n | MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\nThe GRANT statement grants privileges to MySQL user accounts.\n\nTo use GRANT, you must have the GRANT OPTION privilege, and you must\nhave the privileges that you are granting. When the read_only system\nvariable is enabled, GRANT additionally requires the SUPER privilege.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. See [HELP REVOKE].\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\n\nThe host name part of the account, if omitted, defaults to \'%\'.\n\nNormally, a database administrator first uses CREATE USER to create an\naccount and define its nonprivilege characteristics such as its\npassword, whether it uses secure connections, and limits on access to\nserver resources, then uses GRANT to define its privileges. ALTER USER\nmay be used to change the nonprivilege characteristics of existing\naccounts. For example:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'password\';\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\nGRANT SELECT ON db2.invoice TO \'jeffrey\'@\'localhost\';\nALTER USER \'jeffrey\'@\'localhost\' WITH MAX_QUERIES_PER_HOUR 90;\n\n*Note*:\n\nExamples shown here include no IDENTIFIED clause. It is assumed that\nyou establish passwords with CREATE USER at account-creation time to\navoid creating insecure accounts.\n\n*Note*:\n\nIf an account named in a GRANT statement does not already exist, GRANT\nmay create it under the conditions described later in the discussion of\nthe NO_AUTO_CREATE_USER SQL mode. It is also possible to use GRANT to\nspecify nonprivilege account characteristics such as whether it uses\nsecure connections and limits on access to server resources.\n\nHowever, use of GRANT to create accounts or define nonprivilege\ncharacteristics is deprecated as of MySQL 5.7.6. Instead, perform these\ntasks using CREATE USER or ALTER USER.\n\nFrom the mysql program, GRANT responds with Query OK, 0 rows affected\nwhen executed successfully. To determine what privileges result from\nthe operation, use SHOW GRANTS. See [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/grant.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (127,7,'MBRINTERSECTS','MBRIntersects(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (128,20,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (129,3,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n -> 2\nmysql> SELECT SQRT(20);\n -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (130,33,'ST_MPOLYFROMWKB','ST_MPolyFromWKB(wkb[, srid]), ST_MultiPolygonFromWKB(wkb[, srid])\n\nConstructs a MultiPolygon value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (131,40,'CREATE INDEX','Syntax:\nCREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name\n [index_type]\n ON tbl_name (key_part,...)\n [index_option]\n [algorithm_option | lock_option] ...\n\nkey_part:\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\nindex_type:\n USING {BTREE | HASH}\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT | INPLACE | COPY}\n\nlock_option:\n LOCK [=] {DEFAULT | NONE | SHARED | EXCLUSIVE}\n\nNormally, you create all indexes on a table at the time the table\nitself is created with CREATE TABLE. See [HELP CREATE TABLE]. This\nguideline is especially important for InnoDB tables, where the primary\nkey determines the physical layout of rows in the data file. CREATE\nINDEX enables you to add indexes to existing tables.\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-index.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (132,40,'ALTER DATABASE','Syntax:\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\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nNational Language Characteristics\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.7/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nIf you change the default character set or collation for a database,\nstored routines that use the database defaults must be dropped and\nrecreated so that they use the new defaults. (In a stored routine,\nvariables with character data types use the database defaults if the\ncharacter set or collation are not specified explicitly. See [HELP\nCREATE PROCEDURE].)\n\nUpgrading from Versions Older than MySQL 5.1\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates\nthe name of the directory associated with the database to use the\nencoding implemented in MySQL 5.1 for mapping database names to\ndatabase directory names (see\nhttp://dev.mysql.com/doc/refman/5.7/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n versions.\n\no It is intended to update a database directory name to the current\n encoding format if the name contains special characters that need\n encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example, if a database in MySQL 5.0 has the name a-b-c, the name\ncontains instances of the - (dash) character. In MySQL 5.0, the\ndatabase directory is also named a-b-c, which is not necessarily safe\nfor all file systems. In MySQL 5.1 and later, the same database name is\nencoded as a@002db@002dc to produce a file system-neutral directory\nname.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\n*Note*:\n\nThe UPGRADE DATA DIRECTORY NAME clause is deprecated in MySQL 5.7.6 and\nwill be removed in a future version of MySQL. If it is necessary to\nconvert MySQL 5.0 database or table names, a workaround is to upgrade a\nMySQL 5.0 installation to MySQL 5.1 before upgrading to a more recent\nrelease.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-database.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (133,7,'JSON_ARRAY','Syntax:\nJSON_ARRAY([val[, val] ...])\n\nEvaluates a (possibly empty) list of values and returns a JSON array\ncontaining those values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html\n\n','mysql> SELECT JSON_ARRAY(1, "abc", NULL, TRUE, CURTIME());\n+---------------------------------------------+\n| JSON_ARRAY(1, "abc", NULL, TRUE, CURTIME()) |\n+---------------------------------------------+\n| [1, "abc", null, true, "11:30:24.000000"] |\n+---------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (134,26,'GEOMETRYN','GeometryN(gc, N)\n\nST_GeometryN() and GeometryN() are synonyms. For more information, see\nthe description of ST_GeometryN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (135,19,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nThe result is an unsigned 64-bit integer. The value is truncated to 64\nbits. In particular, if the shift count is greater or equal to the\nwidth of an unsigned 64-bit number, the result is zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (136,27,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-table-status.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (137,38,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n -> 50\nmysql> SELECT ASCII(2);\n -> 50\nmysql> SELECT ASCII(\'dx\');\n -> 100\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (138,3,'DIV','Syntax:\nDIV\n\nInteger division. Discards from the division result any fractional part\nto the right of the decimal point.\n\nIf either operand has a noninteger type, the operands are converted to\nDECIMAL and divided using DECIMAL arithmetic before converting the\nresult to BIGINT. If the result exceeds BIGINT range, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2, -5 DIV 2, 5 DIV -2, -5 DIV -2;\n -> 2, -2, -2, 2\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (139,27,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS [FOR CHANNEL channel]\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: localhost\n Master_User: repl\n Master_Port: 13000\n Connect_Retry: 60\n Master_Log_File: master-bin.000002\n Read_Master_Log_Pos: 1307\n Relay_Log_File: slave-relay-bin.000003\n Relay_Log_Pos: 1508\n Relay_Master_Log_File: master-bin.000002\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: 1307\n Relay_Log_Space: 1858\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n Master_Server_Id: 1\n Master_UUID: 3e11fa47-71ca-11e1-9e33-c80aa9429562\n Master_Info_File: /var/mysqld.2/data/master.info\n SQL_Delay: 0\n SQL_Remaining_Delay: NULL\n Slave_SQL_Running_State: Reading event from the relay log\n Master_Retry_Count: 10\n Master_Bind:\n Last_IO_Error_Timestamp:\n Last_SQL_Error_Timestamp:\n Master_SSL_Crl:\n Master_SSL_Crlpath:\n Retrieved_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Executed_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Auto_Position: 1\n Replicate_Rewrite_DB:\n Channel_name:\n Master_TLS_Version: TLSv1.2\n\nThe Performance Schema provides tables that expose replication\ninformation. This is similar to the information available from the SHOW\nSLAVE STATUS statement, but represented in table form. For details, see\nhttp://dev.mysql.com/doc/refman/5.7/en/performance-schema-replication-t\nables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (140,35,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Spatial columns\nare supported for MyISAM, InnoDB, NDB, and ARCHIVE tables. See also the\nnotes about spatial indexes under [HELP SPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-columns.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (141,19,'&','Syntax:\n&\n\nBitwise AND.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n -> 13\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (142,15,'ASSIGN-EQUAL','Syntax:\n=\n\nThis operator is used to perform value assignments in two cases,\ndescribed in the next two paragraphs.\n\nWithin a SET statement, = is treated as an assignment operator that\ncauses the user variable on the left hand side of the operator to take\non the value to its right. (In other words, when used in a SET\nstatement, = is treated identically to :=.) The value on the right hand\nside may be a literal value, another variable storing a value, or any\nlegal expression that yields a scalar value, including the result of a\nquery (provided that this value is a scalar value). You can perform\nmultiple assignments in the same SET statement.\n\nIn the SET clause of an UPDATE statement, = also acts as an assignment\noperator; in this case, however, it causes the column named on the left\nhand side of the operator to assume the value given to the right,\nprovided any WHERE conditions that are part of the UPDATE are met. You\ncan make multiple assignments in the same SET clause of an UPDATE\nstatement.\n\nIn any other context, = is treated as a comparison operator.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n','http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (143,38,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() function takes an expression of any type and produces a\nresult value of the specified type.\n\nDiscussion of CONVERT(expr, type) syntax here also applies to CAST(expr\nAS type), which is equivalent.\n\nCONVERT(... USING ...) is standard SQL syntax. The non-USING form of\nCONVERT() is ODBC syntax.\n\nCONVERT() with USING converts data between different character sets. In\nMySQL, transcoding names are the same as the corresponding character\nset names. For example, this statement converts the string \'abc\' in the\ndefault character set to the corresponding string in the utf8 character\nset:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nCONVERT() without USING and CAST() take an expression and a type value\nspecifying the result type. These type values are permitted:\n\no BINARY[(N)]\n\n Produces a string with the BINARY data type. See\n http://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html for a\n description of how this affects comparisons. If the optional length N\n is given, BINARY(N) causes the cast to use no more than N bytes of\n the argument. Values shorter than N bytes are padded with 0x00 bytes\n to a length of N.\n\no CHAR[(N)] [charset_info]\n\n Produces a string with the CHAR data type. If the optional length N\n is given, CHAR(N) causes the cast to use no more than N characters of\n the argument. No padding occurs for values shorter than N characters.\n\n With no charset_info clause, CHAR produces a string with the default\n character set. To specify the character set explicitly, these\n charset_info values are permitted:\n\n o CHARACTER SET charset_name: Produces a string with the given\n character set.\n\n o ASCII: Shorthand for CHARACTER SET latin1.\n\n o UNICODE: Shorthand for CHARACTER SET ucs2.\n\n In all cases, the string has the default collation for the character\n set.\n\no DATE\n\n Produces a DATE value.\n\no DATETIME\n\n Produces a DATETIME value.\n\no DECIMAL[(M[,D])]\n\n Produces a DECIMAL value. If the optional M and D values are given,\n they specify the maximum number of digits (the precision) and the\n number of digits following the decimal point (the scale).\n\no JSON (added in MySQL 5.7.8)\n\n Produces a JSON value. For details on the rules for conversion of\n values between JSON and other types, see\n http://dev.mysql.com/doc/refman/5.7/en/json.html#json-comparison.\n\no NCHAR[(N)]\n\n Like CHAR, but produces a string with the national character set. See\n http://dev.mysql.com/doc/refman/5.7/en/charset-national.html.\n\n Unlike CHAR, NCHAR does not permit trailing character set information\n to be specified.\n\no SIGNED [INTEGER]\n\n Produces a signed integer value.\n\no TIME\n\n Produces a TIME value.\n\no UNSIGNED [INTEGER]\n\n Produces an unsigned integer value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (144,24,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n -> BEGIN\n -> SET @x = 0;\n -> REPEAT\n -> SET @x = @x + 1;\n -> UNTIL @x > p1 END REPEAT;\n -> END\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/repeat.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (145,7,'ST_ISVALID','ST_IsValid(g)\n\nReturns 1 if the argument is syntactically well-formed and is\ngeometrically valid, 0 if the argument is not syntactically well-formed\nor is not geometrically valid. If the argument is NULL, the return\nvalue is NULL. Geometry validity is defined by the OGC specification.\n\nThe only valid empty geometry is represented in the form of an empty\ngeometry collection value. ST_IsValid() returns 1 in this case.\n\nST_IsValid() works only for the Cartesian coordinate system and\nrequires a geometry argument with an SRID of 0. An ER_WRONG_ARGUMENTS\nerror occurs otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @ls1 = ST_GeomFromText(\'LINESTRING(0 0,-0.00 0,0.0 0)\');\nmysql> SET @ls2 = ST_GeomFromText(\'LINESTRING(0 0, 1 1)\');\nmysql> SELECT ST_IsValid(@ls1);\n+------------------+\n| ST_IsValid(@ls1) |\n+------------------+\n| 0 |\n+------------------+\nmysql> SELECT ST_IsValid(@ls2);\n+------------------+\n| ST_IsValid(@ls2) |\n+------------------+\n| 1 |\n+------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (146,23,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (147,23,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (148,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multibyte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 256^2) ...\n\nIf the leftmost character is not a multibyte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (149,37,'ENVELOPE','Envelope(g)\n\nST_Envelope() and Envelope() are synonyms. For more information, see\nthe description of ST_Envelope().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (150,37,'ST_ISEMPTY','ST_IsEmpty(g)\n\nThis function is a placeholder that returns 0 for any valid geometry\nvalue, 1 for any invalid geometry value, or NULL if the argument is\nNULL.\n\nMySQL does not support GIS EMPTY values such as POINT EMPTY.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (151,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n -> 167773449\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (152,37,'ISSIMPLE','IsSimple(g)\n\nST_IsSimple() and IsSimple() are synonyms. For more information, see\nthe description of ST_IsSimple().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (153,3,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n -> -2\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (154,32,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME([fsp])\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (155,4,'WKT DEFINITION','The Well-Known Text (WKT) representation of geometry values is designed\nfor exchanging geometry data in ASCII form. The OpenGIS specification\nprovides a Backus-Naur grammar that specifies the formal production\nrules for writing WKT values (see\nhttp://dev.mysql.com/doc/refman/5.7/en/spatial-types.html).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (156,11,'ST_Y','ST_Y(p)\n\nReturns the Y-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','mysql> SELECT ST_Y(Point(56.7, 53.34));\n+--------------------------+\n| ST_Y(Point(56.7, 53.34)) |\n+--------------------------+\n| 53.34 |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (157,10,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL [PRIVILEGES], GRANT OPTION\n FROM user [, user] ...\n\nREVOKE PROXY ON user\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts.\n\nWhen the read_only system variable is enabled, REVOKE requires the\nSUPER privilege in addition to any other required privileges described\nin the following discussion.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type, priv_level, and object_type values, and the syntax for\nspecifying users and passwords, see [HELP GRANT].\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege, or the UPDATE privilege for the mysql system database.\n\nUser accounts from which privileges are to be revoked must exist.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/revoke.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (158,32,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (159,23,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (160,12,'RANDOM_BYTES','Syntax:\nRANDOM_BYTES(len)\n\nThis function returns a binary string of len random bytes generated\nusing the random number generator of the SSL library. Permitted values\nof len range from 1 to 1024. For values outside that range,\nRANDOM_BYTES() generates a warning and returns NULL.\n\nRANDOM_BYTES() can be used to provide the initialization vector for the\nAES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len\nmust be at least 16. Larger values are permitted, but bytes in excess\nof 16 are ignored.\n\nRANDOM_BYTES() generates a random value, which makes its result\nnondeterministic. Consequently, statements that use this function are\nunsafe for statement-based replication and cannot be stored in the\nquery cache.\n\nThis function is available as of MySQL 5.7.4.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (161,38,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (162,29,'EXPLAIN','Syntax:\n{EXPLAIN | DESCRIBE | DESC}\n tbl_name [col_name | wild]\n\n{EXPLAIN | DESCRIBE | DESC}\n [explain_type]\n {explainable_stmt | FOR CONNECTION connection_id}\n\nexplain_type: {\n EXTENDED\n | PARTITIONS\n | FORMAT = format_name\n}\n\nformat_name: {\n TRADITIONAL\n | JSON\n}\n\nexplainable_stmt: {\n SELECT statement\n | DELETE statement\n | INSERT statement\n | REPLACE statement\n | UPDATE statement\n}\n\nThe DESCRIBE and EXPLAIN statements are synonyms. In practice, the\nDESCRIBE keyword is more often used to obtain information about table\nstructure, whereas EXPLAIN is used to obtain a query execution plan\n(that is, an explanation of how MySQL would execute a query).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/explain.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (163,3,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (164,3,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the operand.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n -> -2\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (165,23,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters. See\nhttp://dev.mysql.com/doc/refman/5.7/en/column-count-limit.html.\n\nMySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A\nVARCHAR column uses one length byte if values require no more than 255\nbytes, two length bytes if values may require more than 255 bytes.\n\n*Note*:\n\nMySQL follows the standard SQL specification, and does not remove\ntrailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL uses utf8 as this predefined character\nset. http://dev.mysql.com/doc/refman/5.7/en/charset-national.html.\nNVARCHAR is shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (166,38,'UNHEX','Syntax:\n\nUNHEX(str)\n\nFor a string argument str, UNHEX(str) interprets each pair of\ncharacters in the argument as a hexadecimal number and converts it to\nthe byte represented by the number. The return value is a binary\nstring.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n -> \'MySQL\'\nmysql> SELECT X\'4D7953514C\';\n -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (167,40,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER requires the TRIGGER privilege for the table\nassociated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS].\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-trigger.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (168,8,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\n\n*Warning*:\n\nUse this statement with caution to ensure you do not lose binary log\nfile data.\n\nRESET MASTER also clears the values of the gtid_purged system variable\nas well as the global value of the gtid_executed system variable (but\nnot its session value); that is, executing this statement sets each of\nthese values to an empty string (\'\'). In MySQL 5.7.5 and later, this\nstatement also clears the mysql.gtid_executed table (see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html#\nreplication-gtids-gtid-executed-table).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/reset-master.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (169,3,'PI','Syntax:\nPI()\n\nReturns the value of π (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (170,14,'ANY_VALUE','ANY_VALUE(arg)\n\nThis function is useful for GROUP BY queries when the\nONLY_FULL_GROUP_BY SQL mode is enabled, for cases when MySQL rejects a\nquery that you know is valid for reasons that MySQL cannot determine.\nThe function return value and type are the same as the return value and\ntype of its argument, but the function result is not checked for the\nONLY_FULL_GROUP_BY SQL mode.\n\nFor example, if name is a nonindexed column, the following query fails\nwith ONLY_FULL_GROUP_BY enabled:\n\nmysql> SELECT name, address, MAX(age) FROM t GROUP BY name;\nERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP\nBY clause and contains nonaggregated column \'mydb.t.address\' which\nis not functionally dependent on columns in GROUP BY clause; this\nis incompatible with sql_mode=only_full_group_by\n\nThe failure occurs because address is a nonaggregated column that is\nneither named among GROUP BY columns nor functionally dependent on\nthem. As a result, the address value for rows within each name group is\nnondeterministic. There are multiple ways to cause MySQL to accept the\nquery:\n\no Alter the table to make name a primary key or a unique NOT NULL\n column. This enables MySQL to determine that address is functionally\n dependent on name; that is, address is uniquely determined by name.\n (This technique is inapplicable if NULL must be permitted as a valid\n name value.)\n\no Use ANY_VALUE() to refer to address:\n\nSELECT name, ANY_VALUE(address), MAX(age) FROM t GROUP BY name;\n\n In this case, MySQL ignores the nondeterminism of address values\n within each name group and accepts the query. This may be useful if\n you simply do not care which value of a nonaggregated column is\n chosen for each group. ANY_VALUE() is not an aggregate function,\n unlike functions such as SUM() or COUNT(). It simply acts to suppress\n the test for nondeterminism.\n\no Disable ONLY_FULL_GROUP_BY. This is equivalent to using ANY_VALUE()\n with ONLY_FULL_GROUP_BY enabled, as described in the previous item.\n\nANY_VALUE() is also useful if functional dependence exists between\ncolumns but MySQL cannot determine it. The following query is valid\nbecause age is functionally dependent on the grouping column age-1, but\nMySQL cannot tell that and rejects the query with ONLY_FULL_GROUP_BY\nenabled:\n\nSELECT age FROM t GROUP BY age-1;\n\nTo cause MySQL to accept the query, use ANY_VALUE():\n\nSELECT ANY_VALUE(age) FROM t GROUP BY age-1;\n\nANY_VALUE() can be used for queries that refer to aggregate functions\nin the absence of a GROUP BY clause:\n\nmysql> SELECT name, MAX(age) FROM t;\nERROR 1140 (42000): In aggregated query without GROUP BY, expression\n#1 of SELECT list contains nonaggregated column \'mydb.t.name\'; this\nis incompatible with sql_mode=only_full_group_by\n\nWithout GROUP BY, there is a single group and it is nondeterministic\nwhich name value to choose for the group. ANY_VALUE() tells MySQL to\naccept the query:\n\nSELECT ANY_VALUE(name), MAX(age) FROM t;\n\nIt may be that, due to some property of a given data set, you know that\na selected nonaggregated column is effectively functionally dependent\non a GROUP BY column. For example, an application may enforce\nuniqueness of one column with respect to another. In this case, using\nANY_VALUE() for the effectively functionally dependent column may make\nsense.\n\nFor additional discussion, see\nhttp://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (171,3,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n -> 0.60\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (172,8,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.7/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.7/en/purge-binary-logs.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (173,16,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nIf there are no matching rows, STDDEV_SAMP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (174,31,'ST_TOUCHES','ST_Touches(g1, g2)\n\nTwo geometries spatially touch if their interiors do not intersect, but\nthe boundary of one of the geometries intersects either the boundary or\nthe interior of the other.\n\nThis function returns 1 or 0 to indicate whether g1 spatially touches\ng2.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if either of the\narguments is a Point or MultiPoint.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (175,17,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (176,7,'MBREQUALS','MBREquals(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (177,33,'MLINEFROMWKB','MLineFromWKB(wkb[, srid]), MultiLineStringFromWKB(wkb[, srid])\n\nST_MLineFromWKB(), ST_MultiLineStringFromWKB(), MLineFromWKB(), and\nMultiLineStringFromWKB() are synonyms. For more information, see the\ndescription of ST_MLineFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (178,27,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the named table. To use\nthis statement, you must have some privilege for the table. This\nstatement also works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nFor information about how CREATE TABLE statements are stored by MySQL,\nsee\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-statement-retention\n.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-table.html\n\n','mysql> SHOW 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','http://dev.mysql.com/doc/refman/5.7/en/show-create-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (179,28,'DUAL','You are permitted to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/select.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (180,38,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (181,20,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (182,3,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n -> 7.3890560989307\nmysql> SELECT EXP(-2);\n -> 0.13533528323661\nmysql> SELECT EXP(0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (183,37,'ST_ISSIMPLE','ST_IsSimple(g)\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. ST_IsSimple() returns 0 if\nthe argument is not simple, and NULL if the argument is NULL.\n\nThe descriptions of the instantiable geometric classes given under\nhttp://dev.mysql.com/doc/refman/5.7/en/opengis-geometry-model.html\nincludes the specific conditions that cause class instances to be\nclassified as not simple.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (184,13,'POINTN','PointN(ls, N)\n\nST_PointN() and PointN() are synonyms. For more information, see the\ndescription of ST_PointN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (185,38,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT OCT(12);\n -> \'14\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (186,32,'SYSDATE','Syntax:\nSYSDATE([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (187,5,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin system table. UNINSTALL PLUGIN is\nthe complement of INSTALL PLUGIN.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\nsystem table, so that subsequent server restarts will not load and\ninitialize the plugin. UNINSTALL PLUGIN does not remove the plugin\'s\nshared library file.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/uninstall-plugin.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (188,33,'ASBINARY','AsBinary(g), AsWKB(g)\n\nST_AsBinary(), ST_AsWKB(), AsBinary(), and AsWKB() are synonyms. For\nmore information, see the description of ST_AsBinary().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (189,33,'ST_MLINEFROMWKB','ST_MLineFromWKB(wkb[, srid]), ST_MultiLineStringFromWKB(wkb[, srid])\n\nConstructs a MultiLineString value using its WKB representation and\nSRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (190,27,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nMatching performed by the LIKE clause is dependent on the setting of\nthe lower_case_table_names system variable.\n\nThis statement also lists any views in the database. The optional FULL\nmodifier causes SHOW TABLES to display a second output column with\nvalues of BASE TABLE for a table, VIEW for a view, or SYSTEM VIEW for\nan INFORMATION_SCHEMA table.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-tables.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (191,32,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (192,38,'BINARY OPERATOR','Syntax:\nBINARY expr\n\nThe BINARY operator converts the expression to a binary string. A\ncommon use for BINARY is to force a character string comparison to be\ndone byte by byte rather than character by character, in effect\nbecoming case-sensitive. The BINARY operator also causes trailing\nspaces in comparisons to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n -> 0\nmysql> SELECT \'a\' = \'a \';\n -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (193,7,'MBROVERLAPS','MBROverlaps(g1, g2)\n\nTwo geometries spatially overlap if they intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nThis function returns 1 or 0 to indicate whether the minimum bounding\nrectangles of the two geometries g1 and g2 overlap.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (194,33,'ST_LINEFROMWKB','ST_LineFromWKB(wkb[, srid]), ST_LineStringFromWKB(wkb[, srid])\n\nConstructs a LineString value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (195,7,'ASYMMETRIC_DERIVE','Syntax:\nASYMMETRIC_DERIVE(pub_key_str, priv_key_str)\n\nDerives a symmetric key using the private key of one party and the\npublic key of another, and returns the resulting key as a binary\nstring. If key derivation fails, the result is NULL.\n\npub_key_str and priv_key_str must be valid key strings in PEM format.\nThey must be created using the DH algorithm.\n\nSuppose that you have two pairs of public and private keys:\n\nSET @dhp = CREATE_DH_PARAMETERS(1024);\nSET @priv1 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub1 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv1);\nSET @priv2 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub2 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv2);\n\nSuppose further that you use the private key from one pair and the\npublic key from the other pair to create a symmetric key string. Then\nthis symmetric key identity relationship holds:\n\nASYMMETRIC_DERIVE(@pub1, @priv2) = ASYMMETRIC_DERIVE(@pub2, @priv1)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (196,28,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n SELECT ...\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nvalue:\n {expr | DEFAULT}\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom the result of a SELECT statement, which can select from one or\nmany tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/insert-select.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (197,40,'CREATE PROCEDURE','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n FUNCTION sp_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n param_name type\n\ntype:\n Any valid MySQL data type\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nroutine_body:\n Valid SQL routine statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.7/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. Stored functions share\ntheir namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.7/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nCREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE\nprivilege. They might also require the SUPER privilege, depending on\nthe DEFINER value, as described later in this section. If binary\nlogging is enabled, CREATE FUNCTION might require the SUPER privilege,\nas described in\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html.\n\nBy default, MySQL automatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the routine creator. This behavior can be changed by\ndisabling the automatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-routines-privileges.html.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later in this section.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always permissible to have spaces after a stored\nroutine name, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*:\n\nSpecifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. For a FUNCTION, parameters are always regarded as IN\nparameters.\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an OUT or INOUT\nparameter. If you are calling the procedure from within a trigger, you\ncan also pass NEW.col_name as an OUT or INOUT parameter.\n\nRoutine parameters cannot be referenced in statements prepared within\nthe routine; see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html\n.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n -> BEGIN\n -> SELECT COUNT(*) INTO param1 FROM t;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a |\n+------+\n| 3 |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis enables the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type. The COLLATE attribute can be used if preceded by the\nCHARACTER SET attribute.\n\nThe routine_body consists of a valid SQL routine statement. This can be\na simple statement such as SELECT or INSERT, or a compound statement\nwritten using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.7/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL permits routines to contain DDL statements, such as CREATE and\nDROP. MySQL also permits stored procedures (but not stored functions)\nto contain SQL transaction statements such as COMMIT. Stored functions\nmay not contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\npermit them.\n\nStatements that return a result set can be used within a stored\nprocedure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are not permitted. When a routine\nis invoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). The causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not permitted in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting in effect when a\nroutine is created or altered, and always executes the routine with\nthis setting in force, regardless of the current server SQL mode when\nthe routine begins executing.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-procedure.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (198,24,'GET DIAGNOSTICS','Syntax:\nGET [CURRENT | STACKED] DIAGNOSTICS\n{\n statement_information_item\n [, statement_information_item] ...\n | CONDITION condition_number\n condition_information_item\n [, condition_information_item] ...\n}\n\nstatement_information_item:\n target = statement_information_item_name\n\ncondition_information_item:\n target = condition_information_item_name\n\nstatement_information_item_name:\n NUMBER\n | ROW_COUNT\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | RETURNED_SQLSTATE\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_number, target:\n (see following discussion)\n\nSQL statements produce diagnostic information that populates the\ndiagnostics area. The GET DIAGNOSTICS statement enables applications to\ninspect this information. (You can also use SHOW WARNINGS or SHOW\nERRORS to see conditions or errors.)\n\nNo special privileges are required to execute GET DIAGNOSTICS.\n\nThe keyword CURRENT means to retrieve information from the current\ndiagnostics area. The keyword STACKED means to retrieve information\nfrom the second diagnostics area, which is available only if the\ncurrent context is a condition handler. If neither keyword is given,\nthe default is to use the current diagnostics area.\n\nThe GET DIAGNOSTICS statement is typically used in a handler within a\nstored program. It is a MySQL extension that GET [CURRENT] DIAGNOSTICS\nis permitted outside handler context to check the execution of any SQL\nstatement. For example, if you invoke the mysql client program, you can\nenter these statements at the prompt:\n\nmysql> DROP TABLE test.no_such_table;\nERROR 1051 (42S02): Unknown table \'test.no_such_table\'\nmysql> GET DIAGNOSTICS CONDITION 1\n -> @p1 = RETURNED_SQLSTATE, @p2 = MESSAGE_TEXT;\nmysql> SELECT @p1, @p2;\n+-------+------------------------------------+\n| @p1 | @p2 |\n+-------+------------------------------------+\n| 42S02 | Unknown table \'test.no_such_table\' |\n+-------+------------------------------------+\n\nThis extension applies only to the current diagnostics area. It does\nnot apply to the second diagnostics area because GET STACKED\nDIAGNOSTICS is permitted only if the current context is a condition\nhandler. If that is not the case, a GET STACKED DIAGNOSTICS when\nhandler not active error occurs.\n\nFor a description of the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html. Briefly,\nit contains two kinds of information:\n\no Statement information, such as the number of conditions that occurred\n or the affected-rows count.\n\no Condition information, such as the error code and message. If a\n statement raises multiple conditions, this part of the diagnostics\n area has a condition area for each one. If a statement raises no\n conditions, this part of the diagnostics area is empty.\n\nFor a statement that produces three conditions, the diagnostics area\ncontains statement and condition information like this:\n\nStatement information:\n row count\n ... other statement information items ...\nCondition area list:\n Condition area 1:\n error code for condition 1\n error message for condition 1\n ... other condition information items ...\n Condition area 2:\n error code for condition 2:\n error message for condition 2\n ... other condition information items ...\n Condition area 3:\n error code for condition 3\n error message for condition 3\n ... other condition information items ...\n\nGET DIAGNOSTICS can obtain either statement or condition information,\nbut not both in the same statement:\n\no To obtain statement information, retrieve the desired statement items\n into target variables. This instance of GET DIAGNOSTICS assigns the\n number of available conditions and the rows-affected count to the\n user variables @p1 and @p2:\n\nGET DIAGNOSTICS @p1 = NUMBER, @p2 = ROW_COUNT;\n\no To obtain condition information, specify the condition number and\n retrieve the desired condition items into target variables. This\n instance of GET DIAGNOSTICS assigns the SQLSTATE value and error\n message to the user variables @p3 and @p4:\n\nGET DIAGNOSTICS CONDITION 1\n @p3 = RETURNED_SQLSTATE, @p4 = MESSAGE_TEXT;\n\nThe retrieval list specifies one or more target = item_name\nassignments, separated by commas. Each assignment names a target\nvariable and either a statement_information_item_name or\ncondition_information_item_name designator, depending on whether the\nstatement retrieves statement or condition information.\n\nValid target designators for storing item information can be stored\nprocedure or function parameters, stored program local variables\ndeclared with DECLARE, or user-defined variables.\n\nValid condition_number designators can be stored procedure or function\nparameters, stored program local variables declared with DECLARE,\nuser-defined variables, system variables, or literals. A character\nliteral may include a _charset introducer. A warning occurs if the\ncondition number is not in the range from 1 to the number of condition\nareas that have information. In this case, the warning is added to the\ndiagnostics area without clearing it.\n\nWhen a condition occurs, MySQL does not populate all condition items\nrecognized by GET DIAGNOSTICS. For example:\n\nmysql> GET DIAGNOSTICS CONDITION 1\n -> @p5 = SCHEMA_NAME, @p6 = TABLE_NAME;\nmysql> SELECT @p5, @p6;\n+------+------+\n| @p5 | @p6 |\n+------+------+\n| | |\n+------+------+\n\nIn standard SQL, if there are multiple conditions, the first condition\nrelates to the SQLSTATE value returned for the previous SQL statement.\nIn MySQL, this is not guaranteed. To get the main error, you cannot do\nthis:\n\nGET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;\n\nInstead, retrieve the condition count first, then use it to specify\nwhich condition number to inspect:\n\nGET DIAGNOSTICS @cno = NUMBER;\nGET DIAGNOSTICS CONDITION @cno @errno = MYSQL_ERRNO;\n\nFor information about permissible statement and condition information\nitems, and which ones are populated when a condition occurs, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html#diagnostic\ns-area-information-items.\n\nHere is an example that uses GET DIAGNOSTICS and an exception handler\nin stored procedure context to assess the outcome of an insert\noperation. If the insert was successful, the procedure uses GET\nDIAGNOSTICS to get the rows-affected count. This shows that you can use\nGET DIAGNOSTICS multiple times to retrieve information about a\nstatement as long as the current diagnostics area has not been cleared.\n\nCREATE PROCEDURE do_insert(value INT)\nBEGIN\n -- Declare variables to hold diagnostics area information\n DECLARE code CHAR(5) DEFAULT \'00000\';\n DECLARE msg TEXT;\n DECLARE rows INT;\n DECLARE result TEXT;\n -- Declare exception handler for failed insert\n DECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n GET DIAGNOSTICS CONDITION 1\n code = RETURNED_SQLSTATE, msg = MESSAGE_TEXT;\n END;\n\n -- Perform the insert\n INSERT INTO t1 (int_col) VALUES(value);\n -- Check whether the insert was successful\n IF code = \'00000\' THEN\n GET DIAGNOSTICS rows = ROW_COUNT;\n SET result = CONCAT(\'insert succeeded, row count = \',rows);\n ELSE\n SET result = CONCAT(\'insert failed, error = \',code,\', message = \',msg);\n END IF;\n -- Say what happened\n SELECT result;\nEND;\n\nSuppose that t1.int_col is an integer column that is declared as NOT\nNULL. The procedure produces these results when invoked to insert\nnon-NULL and NULL values, respectively:\n\nmysql> CALL do_insert(1);\n+---------------------------------+\n| result |\n+---------------------------------+\n| insert succeeded, row count = 1 |\n+---------------------------------+\n\nmysql> CALL do_insert(NULL);\n+-------------------------------------------------------------------------+\n| result |\n+-------------------------------------------------------------------------+\n| insert failed, error = 23000, message = Column \'int_col\' cannot be null |\n+-------------------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/get-diagnostics.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/get-diagnostics.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (199,38,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/regexp.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (200,24,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. If the label is for the outermost stored program block,\nLEAVE exits the program.\n\nLEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/leave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/leave.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (201,7,'ST_GEOHASH','ST_GeoHash(longitude, latitude, max_length), ST_GeoHash(point,\nmax_length)\n\nReturns a geohash string in the connection character set and collation.\n\nIf any argument is NULL, the return value is NULL. If any argument is\ninvalid, an error occurs.\n\nFor the first syntax, the longitude must be a number in the range\n[−180, 180], and the latitude must be a number in the range [−90,\n90]. For the second syntax, a POINT value is required, where the X and\nY coordinates are in the valid ranges for longitude and latitude,\nrespectively.\n\nThe resulting string is no longer than max_length characters, which has\nan upper limit of 100. The string might be shorter than max_length\ncharacters because the algorithm that creates the geohash value\ncontinues until it has created a string that is either an exact\nrepresentation of the location or max_length characters, whichever\ncomes first.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SELECT ST_GeoHash(180,0,10), ST_GeoHash(-180,-90,15);\n+----------------------+-------------------------+\n| ST_GeoHash(180,0,10) | ST_GeoHash(-180,-90,15) |\n+----------------------+-------------------------+\n| xbpbpbpbpb | 000000000000000 |\n+----------------------+-------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (202,20,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (203,11,'X','X(p)\n\nST_X() and X() are synonyms. For more information, see the description\nof ST_X().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (204,17,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include an SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (205,31,'CROSSES','Crosses(g1, g2)\n\nST_Crosses() and Crosses() are synonyms. For more information, see the\ndescription of ST_Crosses().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (206,26,'ST_UNION','ST_Union(g1, g2)\n\nReturns a geometry that represents the point set union of the geometry\nvalues g1 and g2. If any argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = ST_GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT ST_AsText(ST_Union(@g1, @g2));\n+--------------------------------------+\n| ST_AsText(ST_Union(@g1, @g2)) |\n+--------------------------------------+\n| MULTILINESTRING((1 1,3 3),(1 3,3 1)) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (207,16,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_XOR() returns a neutral value (all\nbits set to 0).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (208,7,'->>','Syntax:\ncolumn->>path\n\nThis is an improved, unquoting extraction operator available in MySQL\n5.7.13 and later. Whereas the -> operator simply extracts a value, the\n->> operator in addition unquotes the extracted result. In other words,\ngiven a JSON column value column and a path expression path, the\nfollowing three expressions return the same value:\n\no JSON_UNQUOTE( JSON_EXTRACT(column, path) )\n\no JSON_UNQUOTE(column -> path)\n\no column->>path\n\nThe ->> operator can be used wherever JSON_UNQUOTE(JSON_EXTRACT())\nwould be allowed. This includes (but is not limited to) SELECT lists,\nWHERE and HAVING clauses, and ORDER BY and GROUP BY clauses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT * FROM jemp WHERE g > 2;\n+-------------------------------+------+\n| c | g |\n+-------------------------------+------+\n| {"id": "3", "name": "Barney"} | 3 |\n| {"id": "4", "name": "Betty"} | 4 |\n+-------------------------------+------+\n2 rows in set (0.01 sec)\n\nmysql> SELECT c->\'$.name\' AS name\n -> FROM jemp WHERE g > 2;\n+----------+\n| name |\n+----------+\n| "Barney" |\n| "Betty" |\n+----------+\n2 rows in set (0.00 sec)\n\nmysql> SELECT JSON_UNQUOTE(c->\'$.name\') AS name\n -> FROM jemp WHERE g > 2;\n+--------+\n| name |\n+--------+\n| Barney |\n| Betty |\n+--------+\n2 rows in set (0.00 sec)\n\nmysql> SELECT c->>\'$.name\' AS name\n -> FROM jemp WHERE g > 2;\n+--------+\n| name |\n+--------+\n| Barney |\n| Betty |\n+--------+\n2 rows in set (0.00 sec)\n\nmysql> CREATE TABLE tj10 (a JSON, b INT);\nQuery OK, 0 rows affected (0.26 sec)\n\nmysql> INSERT INTO tj10 VALUES\n -> (\'[3,10,5,"x",44]\', 33),\n -> (\'[3,10,5,17,[22,"y",66]]\', 0);\nQuery OK, 2 rows affected (0.04 sec)\nRecords: 2 Duplicates: 0 Warnings: 0\n\nmysql> SELECT a->"$[3]", a->"$[4][1]" FROM tj10;\n+-----------+--------------+\n| a->"$[3]" | a->"$[4][1]" |\n+-----------+--------------+\n| "x" | NULL |\n| 17 | "y" |\n+-----------+--------------+\n2 rows in set (0.00 sec)\n\nmysql> SELECT a->>"$[3]", a->>"$[4][1]" FROM tj10;\n+------------+---------------+\n| a->>"$[3]" | a->>"$[4][1]" |\n+------------+---------------+\n| x | NULL |\n| 17 | y |\n+------------+---------------+\n2 rows in set (0.00 sec)\n\nmysql> EXPLAIN SELECT c->>\'$.name\' AS name\n -> FROM jemp WHERE g > 2\\G\n*************************** 1. row ***************************\n id: 1\n select_type: SIMPLE\n table: jemp\n partitions: NULL\n type: range\npossible_keys: i\n key: i\n key_len: 5\n ref: NULL\n rows: 2\n filtered: 100.00\n Extra: Using where\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS\\G\n*************************** 1. row ***************************\n Level: Note\n Code: 1003\nMessage: /* select#1 */ select\njson_unquote(json_extract(`jtest`.`jemp`.`c`,\'$.name\')) AS `name` from\n`jtest`.`jemp` where (`jtest`.`jemp`.`g` > 2)\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (209,27,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL] {\n flush_option [, flush_option] ...\n | tables_option\n}\n\nflush_option: {\n BINARY LOGS\n | DES_KEY_FILE\n | ENGINE LOGS\n | ERROR LOGS\n | GENERAL LOGS\n | HOSTS\n | LOGS\n | PRIVILEGES\n | OPTIMIZER_COSTS\n | QUERY CACHE\n | RELAY LOGS [FOR CHANNEL channel]\n | SLOW LOGS\n | STATUS\n | USER_RESOURCES\n}\n\ntables_option: {\n TABLES\n | TABLES tbl_name [, tbl_name] ...\n | TABLES WITH READ LOCK\n | TABLES tbl_name [, tbl_name] ... WITH READ LOCK\n | TABLES tbl_name [, tbl_name] ... FOR EXPORT\n}\n\nThe FLUSH statement has several variant forms that clear or reload\nvarious internal caches, flush tables, or acquire locks. To execute\nFLUSH, you must have the RELOAD privilege. Specific flush options might\nrequire additional privileges, as described later.\n\n*Note*:\n\nIt is not possible to issue FLUSH statements within stored functions or\ntriggers. However, you may use FLUSH in stored procedures, so long as\nthese are not called from stored functions or triggers. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html\n.\n\nBy default, the server writes FLUSH statements to the binary log so\nthat they replicate to replication slaves. To suppress logging, specify\nthe optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*:\n\nFLUSH LOGS, FLUSH TABLES WITH READ LOCK (with or without a table list),\nand FLUSH TABLES tbl_name ... FOR EXPORT are not written to the binary\nlog in any case because they would cause problems if replicated to a\nslave.\n\nThe FLUSH statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nThe mysqladmin utility provides a command-line interface to some flush\noperations, using commands such as flush-hosts, flush-logs,\nflush-privileges, flush-status, and flush-tables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html.\n\nSending a SIGHUP signal to the server causes several flush operations\nto occur that are similar to various forms of the FLUSH statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-signal-response.html.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/flush.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (210,24,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs (stored procedures and functions,\ntriggers, and events). A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords. statement_list\nrepresents a list of one or more statements, each terminated by a\nsemicolon (;) statement delimiter. The statement_list itself is\noptional, so the empty compound statement (BEGIN END) is legal.\n\nBEGIN ... END blocks can be nested.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. In the mysql\ncommand-line client, this is handled with the delimiter command.\nChanging the ; end-of-statement delimiter (for example, to //) permit ;\nto be used in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. See [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/begin-end.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (211,27,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n Db: test\n Name: sp1\n Type: PROCEDURE\n Definer: testuser@localhost\n Modified: 2018-08-08 13:54:11\n Created: 2018-08-08 13:54:11\n Security_type: DEFINER\n Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.7/en/show-procedure-status.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (212,16,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nIf there are no matching rows, STDDEV_POP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (213,27,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html. For example:\n\nmysql> SHOW 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: http://dev.mysql.com/doc/refman/5.7/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-character-set.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (214,16,'JSON_OBJECTAGG','Syntax:\nJSON_OBJECTAGG(key, value)\n\nTakes two column names or expressions as arguments, the first of these\nbeing used as a key and the second as a value, and returns a JSON\nobject containing key-value pairs. Returns NULL if the result contains\nno rows, or in the event of an error. An error occurs if any key name\nis NULL or the number of arguments is not equal to 2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT o_id, attribute, value FROM t3;\n+------+-----------+-------+\n| o_id | attribute | value |\n+------+-----------+-------+\n| 2 | color | red |\n| 2 | fabric | silk |\n| 3 | color | green |\n| 3 | shape | square|\n+------+-----------+-------+\n4 rows in set (0.00 sec)\n\nmysql> SELECT o_id, JSON_OBJECTAGG(attribute, value) FROM t3 GROUP BY o_id;\n+------+----------------------------------------+\n| o_id | JSON_OBJECTAGG(attribute, name) |\n+------+----------------------------------------+\n| 2 | {"color": "red", "fabric": "silk"} |\n| 3 | {"color": "green", "shape": "square"} |\n+------+----------------------------------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (215,7,'INTERSECTS','Intersects(g1, g2)\n\nMBRIntersects() and Intersects() are synonyms. For more information,\nsee the description of MBRIntersects().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (216,24,'LOOP','Syntax:\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is terminated. Usually,\nthis is accomplished with a LEAVE statement. Within a stored function,\nRETURN can also be used, which exits the function entirely.\n\nNeglecting to include a loop-termination statement results in an\ninfinite loop.\n\nA LOOP statement can be labeled. For the rules regarding label use, see\n[HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/loop.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND;\n','http://dev.mysql.com/doc/refman/5.7/en/loop.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (217,20,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n -> \'C\'\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (218,40,'ALTER INSTANCE','Syntax:\nALTER INSTANCE ROTATE INNODB MASTER KEY\n\nALTER INSTANCE, introduced in MySQL 5.7.11, defines actions applicable\nto a MySQL server instance.\n\nThe ALTER INSTANCE ROTATE INNODB MASTER KEY statement is used to rotate\nthe master encryption key used for InnoDB tablespace encryption. A\nkeyring plugin must be installed and configured to use this statement.\nFor information about keyring plugins, see\nhttp://dev.mysql.com/doc/refman/5.7/en/keyring.html. Key rotation\nrequires the SUPER privilege.\n\nALTER INSTANCE ROTATE INNODB MASTER KEY supports concurrent DML.\nHowever, it cannot be run concurrently with CREATE TABLE ... ENCRYPTION\nor ALTER TABLE ... ENCRYPTION operations, and locks are taken to\nprevent conflicts that could arise from concurrent execution of these\nstatements. If one of the conflicting statements is running, it must\ncomplete before another can proceed.\n\nALTER INSTANCE actions are written to the binary log so that they can\nbe executed on replicated servers.\n\nFor additional ALTER INSTANCE ROTATE INNODB MASTER KEY usage\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-tablespace-encryption.htm\nl. For information about keyring plugins, see\nhttp://dev.mysql.com/doc/refman/5.7/en/keyring.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-instance.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-instance.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (219,31,'ST_CONTAINS','ST_Contains(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as ST_Within().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (220,16,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_AND() returns a neutral value (all\nbits set to 1).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (221,32,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (222,7,'MBRCONTAINS','MBRContains(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\ncontains the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRWithin(@g2,@g1);\n+----------------------+--------------------+\n| MBRContains(@g1,@g2) | MBRWithin(@g2,@g1) |\n+----------------------+--------------------+\n| 1 | 1 |\n+----------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (223,14,'RELEASE_ALL_LOCKS','Syntax:\nRELEASE_ALL_LOCKS()\n\nReleases all named locks held by the current session and returns the\nnumber of locks released (0 if there were none)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (224,3,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n -> -1.5726734063977\nmysql> SELECT COT(0);\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (225,27,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. It requires the EVENT privilege for the database from\nwhich the event is to be shown. For example (using the same event\ne_daily defined and then altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT myschema.e_daily\\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n time_zone: SYSTEM\n Create Event: CREATE DEFINER=`jon`@`ghidora` 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: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.7/en/show-create-event.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (226,15,'OR','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT 1 OR 1;\n -> 1\nmysql> SELECT 1 OR 0;\n -> 1\nmysql> SELECT 0 OR 0;\n -> 0\nmysql> SELECT 0 OR NULL;\n -> NULL\nmysql> SELECT 1 OR NULL;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (227,38,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nThe character_set_filesystem system variable controls interpretation of\nfile names that are given as literal strings.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> UPDATE t\n SET blob_col=LOAD_FILE(\'/tmp/picture\')\n WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (228,4,'POINTFROMTEXT','PointFromText(wkt[, srid])\n\nST_PointFromText() and PointFromText() are synonyms. For more\ninformation, see the description of ST_PointFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (229,32,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n -> \'%D %y %a %d %m %b %j\');\n -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n -> \'%H %k %I %r %T %S %w\');\n -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n -> \'00\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (230,32,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n -> 1987\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (231,20,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (232,40,'ALTER SERVER','Syntax:\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting any of the\noptions permitted in the CREATE SERVER statement. The corresponding\nfields in the mysql.servers table are updated accordingly. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.7/en/alter-server.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (233,24,'RESIGNAL','Syntax:\nRESIGNAL [condition_value]\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nRESIGNAL passes on the error condition information that is available\nduring execution of a condition handler within a compound statement\ninside a stored procedure or function, trigger, or event. RESIGNAL may\nchange some or all information before passing it on. RESIGNAL is\nrelated to SIGNAL, but instead of originating a condition as SIGNAL\ndoes, RESIGNAL relays existing condition information, possibly after\nmodifying it.\n\nRESIGNAL makes it possible to both handle an error and return the error\ninformation. Otherwise, by executing an SQL statement within the\nhandler, information that caused the handler\'s activation is destroyed.\nRESIGNAL also can make some procedures shorter if a given handler can\nhandle part of a situation, then pass the condition "up the line" to\nanother handler.\n\nNo special privileges are required to execute the RESIGNAL statement.\n\nAll forms of RESIGNAL require that the current context be a condition\nhandler. Otherwise, RESIGNAL is illegal and a RESIGNAL when handler not\nactive error occurs.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html.\n\nFor condition_value and signal_information_item, the definitions and\nrules are the same for RESIGNAL as for SIGNAL. For example, the\ncondition_value can be an SQLSTATE value, and the value can indicate\nerrors, warnings, or "not found." For additional information, see [HELP\nSIGNAL].\n\nThe RESIGNAL statement takes condition_value and SET clauses, both of\nwhich are optional. This leads to several possible uses:\n\no RESIGNAL alone:\n\nRESIGNAL;\n\no RESIGNAL with new signal information:\n\nRESIGNAL SET signal_information_item [, signal_information_item] ...;\n\no RESIGNAL with a condition value and possibly new signal information:\n\nRESIGNAL condition_value\n [SET signal_information_item [, signal_information_item] ...];\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/resignal.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/resignal.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (234,7,'MBRCOVERS','MBRCovers(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\ncovers the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRCoveredBy(). See the description of MBRCoveredBy()\nfor examples.\n\nMBRCovers() handles its arguments as follows:\n\no If either argument is NULL or an empty geometry, the return value is\n NULL.\n\no If either argument is not a syntactically well-formed geometry byte\n string, an ER_GIS_INVALID_DATA error occurs.\n\no Otherwise, the return value is non-NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (235,13,'ST_NUMPOINTS','ST_NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls. If the\nargument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_NumPoints(ST_GeomFromText(@ls));\n+------------------------------------+\n| ST_NumPoints(ST_GeomFromText(@ls)) |\n+------------------------------------+\n| 3 |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (236,32,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (237,32,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a - for negative intervals. unit is\na keyword indicating the units in which the expression should be\ninterpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n -> \'2009-01-01 00:00:00\'\nmysql> SELECT INTERVAL 1 DAY + \'2008-12-31\';\n -> \'2009-01-01\'\nmysql> SELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n -> \'2004-12-31 23:59:59\'\nmysql> SELECT DATE_ADD(\'2000-12-31 23:59:59\',\n -> INTERVAL 1 SECOND);\n -> \'2001-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2010-12-31 23:59:59\',\n -> INTERVAL 1 DAY);\n -> \'2011-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n -> INTERVAL \'1:1\' MINUTE_SECOND);\n -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2005-01-01 00:00:00\',\n -> INTERVAL \'1 1:1:1\' DAY_SECOND);\n -> \'2004-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n -> INTERVAL \'-1 10\' DAY_HOUR);\n -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n -> INTERVAL \'1.999999\' SECOND_MICROSECOND);\n -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (238,7,'JSON_VALID','Syntax:\nJSON_VALID(val)\n\nReturns 0 or 1 to indicate whether a value is valid JSON. Returns NULL\nif the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','mysql> SELECT JSON_VALID(\'{"a": 1}\');\n+------------------------+\n| JSON_VALID(\'{"a": 1}\') |\n+------------------------+\n| 1 |\n+------------------------+\nmysql> SELECT JSON_VALID(\'hello\'), JSON_VALID(\'"hello"\');\n+---------------------+-----------------------+\n| JSON_VALID(\'hello\') | JSON_VALID(\'"hello"\') |\n+---------------------+-----------------------+\n| 0 | 1 |\n+---------------------+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (239,37,'ST_ENVELOPE','ST_Envelope(g)\n\nReturns the minimum bounding rectangle (MBR) for the geometry value g,\nor NULL if the argument is NULL. The result is returned as a Polygon\nvalue that is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nmysql> SELECT ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,2 2)\')));\n+----------------------------------------------------------------+\n| ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,2 2)\'))) |\n+----------------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1)) |\n+----------------------------------------------------------------+\n\nAs of MySQL 5.7.6, if the argument is a point or a vertical or\nhorizontal line segment, ST_Envelope() returns the point or the line\nsegment as its MBR rather than returning an invalid polygon:\n\nmysql> SELECT ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,1 2)\')));\n+----------------------------------------------------------------+\n| ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,1 2)\'))) |\n+----------------------------------------------------------------+\n| LINESTRING(1 1,1 2) |\n+----------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (240,38,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using an SQL pattern. Returns 1 (TRUE) or 0 (FALSE).\nIf either expr or pat is NULL, the result is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (241,25,'MULTIPOINT','MultiPoint(pt [, pt2] ...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (242,19,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nThe result is an unsigned 64-bit integer. The value is truncated to 64\nbits. In particular, if the shift count is greater or equal to the\nwidth of an unsigned 64-bit number, the result is zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (243,24,'FETCH','Syntax:\nFETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row for the SELECT statement associated\nwith the specified cursor (which must be open), and advances the cursor\npointer. If a row exists, the fetched columns are stored in the named\nvariables. The number of columns retrieved by the SELECT statement must\nmatch the number of output variables specified in the FETCH statement.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue \'02000\'. To detect this condition, you can set up a handler for\nit (or for a NOT FOUND condition). For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nBe aware that another operation, such as a SELECT or another FETCH, may\nalso cause the handler to execute by raising the same condition. If it\nis necessary to distinguish which operation raised the condition, place\nthe operation within its own BEGIN ... END block so that it can be\nassociated with its own handler.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/fetch.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (244,30,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/boolean-literals.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/boolean-literals.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (245,7,'MBRWITHIN','MBRWithin(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\nis within the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (246,17,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (247,27,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-function.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (248,31,'DISTANCE','Distance(g1, g2)\n\nST_Distance() and Distance() are synonyms. For more information, see\nthe description of ST_Distance().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (249,32,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (250,11,'Y','Y(p)\n\nST_Y() and Y() are synonyms. For more information, see the description\nof ST_Y().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (251,21,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [QUICK | EXTENDED]\n\nCHECKSUM TABLE reports a checksum for the contents of a table. You can\nuse this statement to verify that the contents are the same before and\nafter a backup, rollback, or other operation that is intended to put\nthe data back to a known state.\n\nThis statement requires the SELECT privilege for the table.\n\nThis statement is not supported for views. If you run CHECKSUM TABLE\nagainst a view, the Checksum value is always NULL, and a warning is\nreturned.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nDuring the checksum operation, the table is locked with a read lock for\nInnoDB and MyISAM.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/checksum-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (252,2,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nST_NumInteriorRings() and NumInteriorRings() are synonyms. For more\ninformation, see the description of ST_NumInteriorRings().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (253,2,'INTERIORRINGN','InteriorRingN(poly, N)\n\nST_InteriorRingN() and InteriorRingN() are synonyms. For more\ninformation, see the description of ST_InteriorRingN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (254,32,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME([fsp])\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (255,14,'IS_IPV4_COMPAT','Syntax:\nIS_IPV4_COMPAT(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-compatible IPv6 address, 0 otherwise.\nIPv4-compatible addresses have the form ::ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.5.9\'));\n -> 1\nmysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (256,40,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-function.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (257,4,'ST_POLYFROMTEXT','ST_PolyFromText(wkt[, srid]), ST_PolygonFromText(wkt[, srid])\n\nConstructs a Polygon value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (258,16,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. STDDEV() is a\nsynonym for the standard SQL function STDDEV_POP(), provided for\ncompatibility with Oracle.\n\nIf there are no matching rows, STDDEV() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (259,32,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM. Note that the period argument P is not a\ndate value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n -> 200803\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (260,38,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (261,40,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n [ENGINE [=] engine_name]\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE. It is supported with all MySQL NDB Cluster 7.5\nreleases, and with InnoDB in the standard MySQL Server as well.\n\nENGINE sets the storage engine that uses the tablespace, where\nengine_name is the name of the storage engine. Currently, the values\nInnoDB and NDB are supported. If not set, the value of\ndefault_storage_engine is used. If it is not the same as the storage\nengine used to create the tablespace, the DROP TABLESPACE statement\nfails.\n\nFor an InnoDB tablespace, all tables must be dropped from the\ntablespace prior to a DROP TABLESPACE operation. If the tablespace is\nnot empty, DROP TABLESPACE returns an error.\n\nAs with the InnoDB system tablespace, truncating or dropping InnoDB\ntables stored in a general tablespace creates free space in the\ntablespace .ibd data file, which can only be used for new InnoDB data.\nSpace is not released back to the operating system by such operations\nas it is for file-per-table tablespaces.\n\nAn NDB tablespace to be dropped must not contain any data files; in\nother words, before you can drop an NDB tablespace, you must first drop\neach of its data files using ALTER TABLESPACE ... DROP DATAFILE.\n\nNotes\n\no Tablespaces are not deleted automatically. A tablespace must be\n dropped explicitly using DROP TABLESPACE. DROP DATABASE has no effect\n in this regard, even if the operation drops all tables belonging to\n the tablespace.\n\no A DROP DATABASE operation can drop tables that belong to a general\n tablespace but it cannot drop the tablespace, even if the operation\n drops all tables that belong to the tablespace. The tablespace must\n be dropped explicitly using DROP TABLESPACE tablespace_name.\n\no Similar to the system tablespace, truncating or dropping tables\n stored in a general tablespace creates free space internally in the\n general tablespace .ibd data file which can only be used for new\n InnoDB data. Space is not released back to the operating system as it\n is for file-per-table tablespaces.\n\nInnoDB Example\n\nThis example demonstrates how to drop an InnoDB general tablespace. The\ngeneral tablespace ts1 is created with a single table. Before dropping\nthe tablespace, the table must be dropped.\n\nmysql> CREATE TABLESPACE `ts1`\n -> ADD DATAFILE \'ts1.ibd\'\n -> ENGINE=INNODB;\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> CREATE TABLE t1 (c1 INT PRIMARY KEY)\n -> TABLESPACE ts10\n -> ENGINE=INNODB;\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql> DROP TABLE t1;\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> DROP TABLESPACE ts1;\nQuery OK, 0 rows affected (0.01 sec)\n\nNDB Example\n\nThis example shows how to drop an NDB tablespace myts having a data\nfile named mydata-1.dat after first creating the tablespace, and\nassumes the existence of a log file group named mylg (see [HELP CREATE\nLOGFILE GROUP]).\n\nmysql> CREATE TABLESPACE myts\n -> ADD DATAFILE \'mydata-1.dat\'\n -> USE LOGFILE GROUP mylg\n -> ENGINE=NDB;\n\nYou must remove all data files from the tablespace using ALTER\nTABLESPACE, as shown here, before it can be dropped:\n\nmysql> ALTER TABLESPACE myts\n -> DROP DATAFILE \'mydata-1.dat\'\n -> ENGINE=NDB;\n\nmysql> DROP TABLESPACE myts;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-tablespace.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (262,21,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption: {\n FOR UPGRADE\n | QUICK\n | FAST\n | MEDIUM\n | EXTENDED\n | CHANGED\n}\n\nCHECK TABLE checks a table or tables for errors. For MyISAM tables, the\nkey statistics are updated as well. CHECK TABLE can also check views\nfor problems, such as tables that are referenced in the view definition\nthat no longer exist.\n\nTo check a table, you must have some privilege for it.\n\nCHECK TABLE works for InnoDB, MyISAM, ARCHIVE, and CSV tables.\n\nBefore running CHECK TABLE on InnoDB tables, see\nhttp://dev.mysql.com/doc/refman/5.7/en/check-table.html#check-table-inn\nodb.\n\nCHECK TABLE is supported for partitioned tables, and you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-maintenance.html.\n\nCHECK TABLE ignores virtual generated columns that are not indexed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/check-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (263,38,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (264,7,'JSON_STORAGE_SIZE','JSON_STORAGE_SIZE(json_val)\n\nThis function returns the number of bytes used to store the binary\nrepresentation of a JSON document. When the argument is a JSON column,\nthis is the space used to store the JSON document. json_val must be a\nvalid JSON document or a string which can be parsed as one. In the case\nwhere it is string, the function returns the amount of storage space in\nthe JSON binary representation that is created by parsing the string as\nJSON and converting it to binary. It returns NULL if the argument is\nNULL.\n\nAn error results when json_val is not NULL, and is not---or cannot be\nsuccessfully parsed as---a JSON document.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html\n\n','mysql> CREATE TABLE jtable (jcol JSON);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO jtable VALUES\n -> (\'{"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"}\');\nQuery OK, 1 row affected (0.04 sec)\n\nmysql> SELECT\n -> jcol,\n -> JSON_STORAGE_SIZE(jcol) AS Size\n -> FROM jtable;\n+-----------------------------------------------+------+\n| jcol | Size |\n+-----------------------------------------------+------+\n| {"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"} | 47 |\n+-----------------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> UPDATE jtable\nmysql> SET jcol = \'{"a": 4.55, "b": "wxyz", "c": "[true, false]"}\';\nQuery OK, 1 row affected (0.04 sec)\nRows matched: 1 Changed: 1 Warnings: 0\n\nmysql> SELECT\n -> jcol,\n -> JSON_STORAGE_SIZE(jcol) AS Size\n -> FROM jtable;\n+------------------------------------------------+------+\n| jcol | Size |\n+------------------------------------------------+------+\n| {"a": 4.55, "b": "wxyz", "c": "[true, false]"} | 56 |\n+------------------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SET @j = \'[100, "sakila", [1, 3, 5], 425.05]\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @j, JSON_STORAGE_SIZE(@j) AS Size;\n+------------------------------------+------+\n| @j | Size |\n+------------------------------------+------+\n| [100, "sakila", [1, 3, 5], 425.05] | 45 |\n+------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SET @j = JSON_SET(@j, \'$[1]\', "json");\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @j, JSON_STORAGE_SIZE(@j) AS Size;\n+----------------------------------+------+\n| @j | Size |\n+----------------------------------+------+\n| [100, "json", [1, 3, 5], 425.05] | 43 |\n+----------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SET @j = JSON_SET(@j, \'$[2][0]\', JSON_ARRAY(10, 20, 30));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @j, JSON_STORAGE_SIZE(@j) AS Size;\n+---------------------------------------------+------+\n| @j | Size |\n+---------------------------------------------+------+\n| [100, "json", [[10, 20, 30], 3, 5], 425.05] | 56 |\n+---------------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SELECT\n -> JSON_STORAGE_SIZE(\'[100, "sakila", [1, 3, 5], 425.05]\') AS A,\n -> JSON_STORAGE_SIZE(\'{"a": 1000, "b": "a", "c": "[1, 3, 5, 7]"}\') AS B,\n -> JSON_STORAGE_SIZE(\'{"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"}\') AS C,\n -> JSON_STORAGE_SIZE(\'[100, "json", [[10, 20, 30], 3, 5], 425.05]\') AS D;\n+----+----+----+----+\n| A | B | C | D |\n+----+----+----+----+\n| 45 | 44 | 47 | 56 |\n+----+----+----+----+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (265,25,'MULTILINESTRING','MultiLineString(ls [, ls] ...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (266,27,'SHOW RELAYLOG EVENTS','Syntax:\nSHOW RELAYLOG EVENTS\n [IN \'log_name\']\n [FROM pos]\n [LIMIT [offset,] row_count]\n [channel_option]\n\nchannel_option:\n FOR CHANNEL channel\n\nShows the events in the relay log of a replication slave. If you do not\nspecify \'log_name\', the first relay log is displayed. This statement\nhas no effect on the master.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-relaylog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-relaylog-events.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (267,4,'MPOINTFROMTEXT','MPointFromText(wkt[, srid]), MultiPointFromText(wkt[, srid])\n\nST_MPointFromText(), ST_MultiPointFromText(), MPointFromText(), and\nMultiPointFromText() are synonyms. For more information, see the\ndescription of ST_MPointFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (268,38,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (269,23,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*:\n\nTrailing spaces are removed when CHAR values are retrieved unless the\nPAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (270,16,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nIf there are no matching rows, COUNT(DISTINCT) returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (271,27,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows the CREATE VIEW statement that creates the named\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-view.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (272,20,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (273,32,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n -> \'2000-07-03\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (274,40,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. By\ndefault, that privilege is granted automatically to the procedure\ncreator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-routines-privileges.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-procedure.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (275,19,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N as an\nunsigned 64-bit integer, or NULL if the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n -> 4, 3\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (276,33,'ST_POINTFROMWKB','ST_PointFromWKB(wkb[, srid])\n\nConstructs a Point value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (277,7,'JSON_PRETTY','JSON_PRETTY(json_val)\n\nProvides pretty-printing of JSON values similar to that implemented in\nPHP and by other languages and database systems. The value supplied\nmust be a JSON value or a valid string representation of a JSON value.\nExtraneous whitespaces and newlines present in this value have no\neffect on the output. For a NULL value, the function returns NULL. If\nthe value is not a JSON document, or if it cannot cannot be parsed as\none, the function fails with an error.\n\nFormatting of the output from this function adheres to the following\nrules:\n\no Each array element or object member appears on a separate line,\n indented by one additional level as compared to its parent.\n\no Each level of indentation adds two leading spaces.\n\no A comma separating individual array elements or object members is\n printed before the newline that separates the two elements or\n members.\n\no The key and the value of an object member are separated by a colon\n followed by a space (\': \').\n\no An empty object or array is printed on a single line. No space is\n printed between the opening and closing brace.\n\no Special characters in string scalars and key names are escaped\n employing the same rules used by the JSON_QUOTE() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html\n\n','mysql> SELECT JSON_PRETTY(\'123\'); # scalar\n+--------------------+\n| JSON_PRETTY(\'123\') |\n+--------------------+\n| 123 |\n+--------------------+\n\nmysql> SELECT JSON_PRETTY("[1,3,5]"); # array\n+------------------------+\n| JSON_PRETTY("[1,3,5]") |\n+------------------------+\n| [\n 1,\n 3,\n 5\n] |\n+------------------------+\n\nmysql> SELECT JSON_PRETTY(\'{"a":"10","b":"15","x":"25"}\'); # object\n+---------------------------------------------+\n| JSON_PRETTY(\'{"a":"10","b":"15","x":"25"}\') |\n+---------------------------------------------+\n| {\n "a": "10",\n "b": "15",\n "x": "25"\n} |\n+---------------------------------------------+\n\nmysql> SELECT JSON_PRETTY(\'["a",1,{"key1":\n > "value1"},"5", "77" ,\n > {"key2":["value3","valueX",\n > "valueY"]},"j", "2" ]\')\\G # nested arrays and objects\n*************************** 1. row ***************************\nJSON_PRETTY(\'["a",1,{"key1":\n "value1"},"5", "77" ,\n {"key2":["value3","valuex",\n "valuey"]},"j", "2" ]\'): [\n "a",\n 1,\n {\n "key1": "value1"\n },\n "5",\n "77",\n {\n "key2": [\n "value3",\n "valuex",\n "valuey"\n ]\n },\n "j",\n "2"\n]\n','http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (278,7,'ST_MAKEENVELOPE','ST_MakeEnvelope(pt1, pt2)\n\nReturns the rectangle that forms the envelope around two points, as a\nPoint, LineString, or Polygon. If any argument is NULL, the return\nvalue is NULL.\n\nCalculations are done using the Cartesian coordinate system rather than\non a sphere, spheroid, or on earth.\n\nGiven two points pt1 and pt2, ST_MakeEnvelope() creates the result\ngeometry on an abstract plane like this:\n\no If pt1 and pt2 are equal, the result is the point pt1.\n\no Otherwise, if (pt1, pt2) is a vertical or horizontal line segment,\n the result is the line segment (pt1, pt2).\n\no Otherwise, the result is a polygon using pt1 and pt2 as diagonal\n points.\n\nThe result geometry has an SRID of 0.\n\nST_MakeEnvelope() requires Point geometry arguments with an SRID of 0.\nAn ER_WRONG_ARGUMENTS error occurs otherwise.\n\nIf any argument is not a syntactically well-formed geometry byte\nstring, or if any coordinate value of the two points is infinite or\nNaN, an ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @pt1 = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SET @pt2 = ST_GeomFromText(\'POINT(1 1)\');\nmysql> SELECT ST_AsText(ST_MakeEnvelope(@pt1, @pt2));\n+----------------------------------------+\n| ST_AsText(ST_MakeEnvelope(@pt1, @pt2)) |\n+----------------------------------------+\n| POLYGON((0 0,1 0,1 1,0 1,0 0)) |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (279,31,'ST_WITHIN','ST_Within(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as ST_Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (280,3,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n -> 0\nmysql> SELECT ACOS(1.0001);\n -> NULL\nmysql> SELECT ACOS(0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (281,8,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION\n transaction_characteristic [, transaction_characteristic] ...\n\ntransaction_characteristic: {\n ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n}\n\nlevel: {\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n}\n\nThis statement specifies transaction characteristics. It takes a list\nof one or more characteristic values separated by commas. These\ncharacteristics set the transaction isolation level or access mode. The\nisolation level is used for operations on InnoDB tables. The access\nmode may be specified as to whether transactions operate in read/write\nor read-only mode.\n\nIn addition, SET TRANSACTION can include an optional GLOBAL or SESSION\nkeyword to indicate the scope of the statement.\n\nScope of Transaction Characteristics\n\nYou can set transaction characteristics globally, for the current\nsession, or for the next transaction:\n\no With the GLOBAL keyword, the statement applies globally for all\n subsequent sessions. Existing sessions are unaffected.\n\no With the SESSION keyword, the statement applies to all subsequent\n transactions performed within the current session.\n\no Without any SESSION or GLOBAL keyword, the statement applies to the\n next (not started) transaction performed within the current session.\n Subsequent transactions revert to using the SESSION isolation level.\n\nA global change to transaction characteristics requires the SUPER\nprivilege. Any session is free to change its session characteristics\n(even in the middle of a transaction), or the characteristics for its\nnext transaction.\n\nSET TRANSACTION without GLOBAL or SESSION is not permitted while there\nis an active transaction:\n\nmysql> START TRANSACTION;\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed\nwhile a transaction is in progress\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option to mysqld on the command line or\nin an option file. Values of level for this option use dashes rather\nthan spaces, so the permissible values are READ-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set\nthe default isolation level to REPEATABLE READ, use these lines in the\n[mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\n\nIt is possible to check or set the global and session transaction\nisolation levels at runtime by using the transaction_isolation system\nvariable:\n\nSELECT @@GLOBAL.transaction_isolation, @@transaction_isolation;\nSET GLOBAL transaction_isolation=\'REPEATABLE-READ\';\nSET SESSION transaction_isolation=\'SERIALIZABLE\';\n\nPrior to MySQL 5.7.20, use tx_isolation rather than\ntransaction_isolation.\n\nSimilarly, to set the transaction access mode at server startup or at\nruntime, use the --transaction-read-only option or\ntransaction_read_only system variable. By default, these are OFF (the\nmode is read/write) but can be set to ON for a default mode of read\nonly.\n\nPrior to MySQL 5.7.20, use tx_read_only rather than\ntransaction_read_only.\n\nSetting the global or session value of transaction_isolation or\ntransaction_read_only is equivalent to setting the isolation level or\naccess mode with SET GLOBAL TRANSACTION or SET SESSION TRANSACTION.\n\nTransaction Isolation Levels\n\nFor information about transaction isolation levels, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-transaction-isolation-lev\nels.html.\n\nTransaction Access Mode\n\nThe transaction access mode may be specified with SET TRANSACTION. By\ndefault, a transaction takes place in read/write mode, with both reads\nand writes permitted to tables used in the transaction. This mode may\nbe specified explicitly using an access mode of READ WRITE.\n\nIf the transaction access mode is set to READ ONLY, changes to tables\nare prohibited. This may enable storage engines to make performance\nimprovements that are possible when writes are not permitted.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the\nsame statement.\n\nIn read-only mode, it remains possible to change tables created with\nthe TEMPORARY keyword using DML statements. Changes made with DDL\nstatements are not permitted, just as with permanent tables.\n\nThe READ WRITE and READ ONLY access modes also may be specified for an\nindividual transaction using the START TRANSACTION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-transaction.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (282,3,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (283,26,'ST_BUFFER','ST_Buffer(g, d[, strategy1[, strategy2[, strategy3]]])\n\nReturns a geometry that represents all points whose distance from the\ngeometry value g is less than or equal to a distance of d, or NULL if\nany argument is NULL. The SRID of the geometry argument must be 0\nbecause ST_Buffer() supports only the Cartesian coordinate system. If\nany geometry argument is not a syntactically well-formed geometry, an\nER_GIS_INVALID_DATA error occurs.\n\nIf the geometry argument is empty, ST_Buffer() returns an empty\ngeometry.\n\nIf the distance is 0, ST_Buffer() returns the geometry argument\nunchanged:\n\nmysql> SET @pt = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SELECT ST_AsText(ST_Buffer(@pt, 0));\n+------------------------------+\n| ST_AsText(ST_Buffer(@pt, 0)) |\n+------------------------------+\n| POINT(0 0) |\n+------------------------------+\n\nST_Buffer() supports negative distances for Polygon and MultiPolygon\nvalues, and for geometry collections containing Polygon or MultiPolygon\nvalues. The result may be an empty geometry. An ER_WRONG_ARGUMENTS\nerror occurs for ST_Buffer() with a negative distance for Point,\nMultiPoint, LineString, and MultiLineString values, and for geometry\ncollections not containing any Polygon or MultiPolygon values.\n\nAs of MySQL 5.7.7, ST_Buffer() permits up to three optional strategy\narguments following the distance argument. Strategies influence buffer\ncomputation. These arguments are byte string values produced by the\nST_Buffer_Strategy() function, to be used for point, join, and end\nstrategies:\n\no Point strategies apply to Point and MultiPoint geometries. If no\n point strategy is specified, the default is\n ST_Buffer_Strategy(\'point_circle\', 32).\n\no Join strategies apply to LineString, MultiLineString, Polygon, and\n MultiPolygon geometries. If no join strategy is specified, the\n default is ST_Buffer_Strategy(\'join_round\', 32).\n\no End strategies apply to LineString and MultiLineString geometries. If\n no end strategy is specified, the default is\n ST_Buffer_Strategy(\'end_round\', 32).\n\nUp to one strategy of each type may be specified, and they may be given\nin any order. If multiple strategies of a given type are specified, an\nER_WRONG_ARGUMENTS error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @pt = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SET @pt_strategy = ST_Buffer_Strategy(\'point_square\');\nmysql> SELECT ST_AsText(ST_Buffer(@pt, 2, @pt_strategy));\n+--------------------------------------------+\n| ST_AsText(ST_Buffer(@pt, 2, @pt_strategy)) |\n+--------------------------------------------+\n| POLYGON((-2 -2,2 -2,2 2,-2 2,-2 -2)) |\n+--------------------------------------------+\n\nmysql> SET @ls = ST_GeomFromText(\'LINESTRING(0 0,0 5,5 5)\');\nmysql> SET @end_strategy = ST_Buffer_Strategy(\'end_flat\');\nmysql> SET @join_strategy = ST_Buffer_Strategy(\'join_round\', 10);\nmysql> SELECT ST_AsText(ST_Buffer(@ls, 5, @end_strategy, @join_strategy))\n+---------------------------------------------------------------+\n| ST_AsText(ST_Buffer(@ls, 5, @end_strategy, @join_strategy)) |\n+---------------------------------------------------------------+\n| POLYGON((5 5,5 10,0 10,-3.5355339059327373 8.535533905932738, |\n| -5 5,-5 0,0 0,5 0,5 5)) |\n+---------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (284,26,'BUFFER','Buffer(g, d[, strategy1[, strategy2[, strategy3]]])\n\nST_Buffer() and Buffer() are synonyms. For more information, see the\ndescription of ST_Buffer().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (285,7,'JSON_OBJECT','Syntax:\nJSON_OBJECT([key, val[, key, val] ...])\n\nEvaluates a (possibly empty) list of key-value pairs and returns a JSON\nobject containing those pairs. An error occurs if any key name is NULL\nor the number of arguments is odd.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html\n\n','mysql> SELECT JSON_OBJECT(\'id\', 87, \'name\', \'carrot\');\n+-----------------------------------------+\n| JSON_OBJECT(\'id\', 87, \'name\', \'carrot\') |\n+-----------------------------------------+\n| {"id": 87, "name": "carrot"} |\n+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (286,7,'WAIT_FOR_EXECUTED_GTID_SET','Syntax:\nWAIT_FOR_EXECUTED_GTID_SET(gtid_set[, timeout])\n\nWait until the server has applied all of the transactions whose global\ntransaction identifiers are contained in gtid_set; that is, until the\ncondition GTID_SUBSET(gtid_subset, @@global.gtid_executed) holds. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html\nfor a definition of GTID sets.\n\nIf a timeout is specified, and timeout seconds elapse before all of the\ntransactions in the GTID set have been applied, the function stops\nwaiting. timeout is optional, and the default timeout is 0 seconds, in\nwhich case the function always waits until all of the transactions in\nthe GTID set have been applied.\n\nWAIT_FOR_EXECUTED_GTID_SET() monitors all the GTIDs that are applied on\nthe server, including transactions that arrive from all replication\nchannels and user clients. It does not take into account whether\nreplication channels have been started or stopped.\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','mysql> SELECT WAIT_FOR_EXECUTED_GTID_SET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (287,20,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (288,32,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (289,2,'ST_CENTROID','ST_Centroid({poly|mpoly})\n\nReturns the mathematical centroid for the Polygon or MultiPolygon\nargument as a Point. The result is not guaranteed to be on the\nMultiPolygon. If the argument is NULL or an empty geometry, the return\nvalue is NULL.\n\nThis function processes geometry collections by computing the centroid\npoint for components of highest dimension in the collection. Such\ncomponents are extracted and made into a single MultiPolygon,\nMultiLineString, or MultiPoint for centroid computation. If the\nargument is an empty geometry collection, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n ST_GeomFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))\');\nmysql> SELECT ST_GeometryType(@poly),ST_AsText(ST_Centroid(@poly));\n+------------------------+--------------------------------------------+\n| ST_GeometryType(@poly) | ST_AsText(ST_Centroid(@poly)) |\n+------------------------+--------------------------------------------+\n| POLYGON | POINT(4.958333333333333 4.958333333333333) |\n+------------------------+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (290,23,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 − 1) bytes. Each\nTINYBLOB value is stored using a 1-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (291,17,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (292,21,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table, for certain storage\nengines only.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nAlthough normally you should never have to run REPAIR TABLE, if\ndisaster strikes, this statement is very likely to get back all your\ndata from a MyISAM table. If your tables become corrupted often, try to\nfind the reason for it, to eliminate the need to use REPAIR TABLE. See\nhttp://dev.mysql.com/doc/refman/5.7/en/crashing.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/myisam-table-problems.html.\n\nREPAIR TABLE checks the table to see whether an upgrade is required. If\nso, it performs the upgrade, following the same rules as CHECK TABLE\n... FOR UPGRADE. See [HELP CHECK TABLE], for more information.\n\n*Important*:\n\no Make a backup of a table before performing a table repair operation;\n under some circumstances the operation might cause data loss.\n Possible causes include but are not limited to file system errors.\n See http://dev.mysql.com/doc/refman/5.7/en/backup-and-recovery.html.\n\no If the server crashes during a REPAIR TABLE operation, it is\n essential after restarting it that you immediately execute another\n REPAIR TABLE statement for the table before performing any other\n operations on it. In the worst case, you might have a new clean index\n file without information about the data file, and then the next\n operation you perform could overwrite the data file. This is an\n unlikely but possible scenario that underscores the value of making a\n backup first.\n\no In the event that a table on the master becomes corrupted and you run\n REPAIR TABLE on it, any resulting changes to the original table are\n not propagated to slaves.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/repair-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (293,18,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column data types and\nindex information. You cannot merge MyISAM tables in which the columns\nare listed in a different order, do not have exactly the same data\ntypes in corresponding columns, or have the indexes in different order.\nHowever, any or all of the MyISAM tables can be compressed with\nmyisampack. See http://dev.mysql.com/doc/refman/5.7/en/myisampack.html.\nDifferences between tables such as these do not matter:\n\no Names of corresponding columns and indexes can differ.\n\no Comments for tables, columns, and indexes can differ.\n\no Table options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS can\n differ.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n -> a INT NOT NULL AUTO_INCREMENT,\n -> message CHAR(20), INDEX(a))\n -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.7/en/merge-storage-engine.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (294,27,'SHOW CREATE USER','Syntax:\nSHOW CREATE USER user\n\nThis statement shows the CREATE USER statement that creates the named\nuser. An error occurs if the user does not exist. The statement\nrequires the SELECT privilege for the mysql system database, except to\ndisplay information for the current user.\n\nTo name the account, use the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. The host\nname part of the account name, if omitted, defaults to \'%\'. It is also\npossible to specify CURRENT_USER or CURRENT_USER() to refer to the\naccount associated with the current session.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-user.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (295,31,'ST_DISTANCE','ST_Distance(g1, g2)\n\nReturns the distance between g1 and g2. If either argument is NULL or\nan empty geometry, the return value is NULL.\n\nThis function processes geometry collections by returning the shortest\ndistance among all combinations of the components of the two geometry\narguments.\n\nIf an intermediate or final result produces NaN or a negative number,\nan ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = Point(1,1);\nmysql> SET @g2 = Point(2,2);\nmysql> SELECT ST_Distance(@g1, @g2);\n+-----------------------+\n| ST_Distance(@g1, @g2) |\n+-----------------------+\n| 1.4142135623730951 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (296,40,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n [IGNORE | REPLACE]\n [AS] query_expression\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n col_name column_definition\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (key_part,...)\n [index_option] ...\n | {INDEX|KEY} [index_name] [index_type] (key_part,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n [index_name] [index_type] (key_part,...)\n [index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (key_part,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (col_name,...) reference_definition\n | CHECK (expr)\n\ncolumn_definition:\n data_type [NOT NULL | NULL] [DEFAULT default_value]\n [AUTO_INCREMENT] [UNIQUE [KEY]] [[PRIMARY] KEY]\n [COMMENT \'string\']\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [STORAGE {DISK|MEMORY|DEFAULT}]\n [reference_definition]\n | data_type [GENERATED ALWAYS] AS (expression)\n [VIRTUAL | STORED] [NOT NULL | NULL]\n [UNIQUE [KEY]] [[PRIMARY] KEY]\n [COMMENT \'string\']\n\ndata_type:\n (see http://dev.mysql.com/doc/refman/5.7/en/data-types.html)\n\nkey_part:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nreference_definition:\n REFERENCES tbl_name (key_part,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | COMPRESSION [=] {\'ZLIB\'|\'LZ4\'|\'NONE\'}\n | CONNECTION [=] \'connect_string\'\n | {DATA|INDEX} DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTION [=] {\'Y\' | \'N\'}\n | ENGINE [=] engine_name\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] value\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list)\n | RANGE{(expr) | COLUMNS(column_list)}\n | LIST{(expr) | COLUMNS(column_list)} }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n PARTITION partition_name\n [VALUES\n {LESS THAN {(expr | value_list) | MAXVALUE}\n |\n IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'string\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'string\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n\nquery_expression:\n SELECT ... (Some valid select or union statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nBy default, tables are created in the default database, using the\nInnoDB storage engine. An error occurs if the table exists, if there is\nno default database, or if the database does not exist.\n\nFor information about the physical representation of a table, see\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-files.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (297,32,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n -> 123456\nmysql> SELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n -> 10\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (298,40,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\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\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nin the servers table in the mysql database. This statement requires the\nSUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name is an identifier and may be quoted with single\nquotation marks.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*:\n\nThe OWNER option is currently not applied, and has no effect on the\nownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'198.51.100.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.7/en/create-server.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (299,7,'ST_DISTANCE_SPHERE','ST_Distance_Sphere(g1, g2 [, radius])\n\nReturns the mimimum spherical distance between two points and/or\nmultipoints on a sphere, in meters, or NULL if any geometry argument is\nNULL or empty.\n\nCalculations use a spherical earth and a configurable radius. The\noptional radius argument should be given in meters. If omitted, the\ndefault radius is 6,370,986 meters. An ER_WRONG_ARGUMENTS error occurs\nif the radius argument is present but not positive.\n\nThe geometry arguments should consist of points that specify\n(longitude, latitude) coordinate values:\n\no Longitude and latitude are the first and second coordinates of the\n point, respectively.\n\no Both coordinates are in degrees.\n\no Longitude values must be in the range (-180, 180]. Positive values\n are east of the prime meridian.\n\no Latitude values must be in the range [-90, 90]. Positive values are\n north of the equator.\n\nSupported argument combinations are (Point, Point), (Point,\nMultiPoint), and (MultiPoint, Point). An ER_GIS_UNSUPPORTED_ARGUMENT\nerror occurs for other combinations.\n\nIf any geometry argument is not a syntactically well-formed geometry\nbyte string, an ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @pt1 = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SET @pt2 = ST_GeomFromText(\'POINT(180 0)\');\nmysql> SELECT ST_Distance_Sphere(@pt1, @pt2);\n+--------------------------------+\n| ST_Distance_Sphere(@pt1, @pt2) |\n+--------------------------------+\n| 20015042.813723423 |\n+--------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (300,33,'ST_POLYFROMWKB','ST_PolyFromWKB(wkb[, srid]), ST_PolygonFromWKB(wkb[, srid])\n\nConstructs a Polygon value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (301,32,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nThe second argument can have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (302,32,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n -> 20080613\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (303,10,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] = password_option\n\npassword_option: {\n \'auth_string\'\n | PASSWORD(\'auth_string\')\n}\n\nThe SET PASSWORD statement assigns a password to a MySQL user account.\n\'auth_string\' represents a cleartext (unencrypted) password.\n\n*Note*:\n\no SET PASSWORD ... = PASSWORD(\'auth_string\') syntax is deprecated as of\n MySQL 5.7.6 and will be removed in a future MySQL release.\n\no SET PASSWORD ... = \'auth_string\' syntax is not deprecated, but ALTER\n USER is the preferred statement for account alterations, including\n assigning passwords. For example:\n\nALTER USER user IDENTIFIED BY \'auth_string\';\n\n*Important*:\n\nUnder some circumstances, SET PASSWORD may be recorded in server logs\nor on the client side in a history file such as ~/.mysql_history, which\nmeans that cleartext passwords may be read by anyone having read access\nto that information. For information about the conditions under which\nthis occurs for the server logs and how to control it, see\nhttp://dev.mysql.com/doc/refman/5.7/en/password-logging.html. For\nsimilar information about client-side logging, see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-logging.html.\n\nSET PASSWORD can be used with or without a FOR clause that explicitly\nnames a user account:\n\no With a FOR user clause, the statement sets the password for the named\n account, which must exist:\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = \'auth_string\';\n\no With no FOR user clause, the statement sets the password for the\n current user:\n\nSET PASSWORD = \'auth_string\';\n\n Any client who connects to the server using a nonanonymous account\n can change the password for that account. (In particular, you can\n change your own password.) To see which account the server\n authenticated you as, invoke the CURRENT_USER() function:\n\nSELECT CURRENT_USER();\n\nSetting the password for a named account (with a FOR clause) requires\nthe UPDATE privilege for the mysql system database. Setting the\npassword for yourself (for a nonanonymous account with no FOR clause)\nrequires no special privileges. When the read_only system variable is\nenabled, SET PASSWORD requires the SUPER privilege in addition to any\nother required privileges.\n\nIf a FOR user clause is given, the account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.7/en/account-names.html.\nFor example:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = \'auth_string\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nThe password can be specified in these ways:\n\no Use a string without PASSWORD()\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = \'password\';\n\n SET PASSWORD interprets the string as a cleartext string, passes it\n to the authentication plugin associated with the account, and stores\n the result returned by the plugin in the mysql.user account row. (The\n plugin is given the opportunity to hash the value into the encryption\n format it expects. The plugin may use the value as specified, in\n which case no hashing occurs.)\n\no Use the PASSWORD() function (deprecated as of MySQL 5.7.6)\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'password\');\n\n The PASSWORD() argument is the cleartext (unencrypted) password.\n PASSWORD() hashes the password and returns the encrypted password\n string for storage in the mysql.user account row.\n\n The PASSWORD() function hashes the password using the hashing method\n determined by the value of the old_passwords system variable value.\n Be sure that old_passwords has the value corresponding to the hashing\n method expected by the authentication plugin associated with the\n account. For example, if the account uses the mysql_native_password\n plugin, the old_passwords value must be 0:\n\nSET old_passwords = 0;\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'password\');\n\n If the old_passwords value differs from that required by the\n authentication plugin, the hashed password value returned by\n PASSWORD() will not by usable by the plugin and correct\n authentication of client connections will not occur.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-password.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (304,7,'JSON_QUOTE','Syntax:\nJSON_QUOTE(string)\n\nQuotes a string as a JSON value by wrapping it with double quote\ncharacters and escaping interior quote and other characters, then\nreturning the result as a utf8mb4 string. Returns NULL if the argument\nis NULL.\n\nThis function is typically used to produce a valid JSON string literal\nfor inclusion within a JSON document.\n\nCertain special characters are escaped with backslashes per the escape\nsequences shown in\nhttp://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n#json-unquote-character-escape-sequences.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html\n\n','mysql> SELECT JSON_QUOTE(\'null\'), JSON_QUOTE(\'"null"\');\n+--------------------+----------------------+\n| JSON_QUOTE(\'null\') | JSON_QUOTE(\'"null"\') |\n+--------------------+----------------------+\n| "null" | "\\"null\\"" |\n+--------------------+----------------------+\nmysql> SELECT JSON_QUOTE(\'[1, 2, 3]\');\n+-------------------------+\n| JSON_QUOTE(\'[1, 2, 3]\') |\n+-------------------------+\n| "[1, 2, 3]" |\n+-------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (305,17,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n -> \'test\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (306,6,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL), IF() returns expr2.\nOtherwise, it returns expr3.\n\n*Note*:\n\nThere is also an IF statement, which differs from the IF() function\ndescribed here. See [HELP IF statement].\n\nIf only one of expr2 or expr3 is explicitly NULL, the result type of\nthe IF() function is the type of the non-NULL expression.\n\nThe default return type of IF() (which may matter when it is stored\ninto a temporary table) is calculated as follows:\n\no If expr2 or expr3 produce a string, the result is a string.\n\n If expr2 and expr3 are both strings, the result is case-sensitive if\n either string is case sensitive.\n\no If expr2 or expr3 produce a floating-point value, the result is a\n floating-point value.\n\no If expr2 or expr3 produce an integer, the result is an integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n -> \'no\'\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (307,33,'POINTFROMWKB','PointFromWKB(wkb[, srid])\n\nST_PointFromWKB() and PointFromWKB() are synonyms. For more\ninformation, see the description of ST_PointFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (308,3,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (309,3,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (310,27,'SHOW PROFILE','Syntax:\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}\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\n*Note*:\n\nThe SHOW PROFILE and SHOW PROFILES statements are deprecated and will\nbe removed in a future MySQL release. Use the Performance Schema\ninstead; see\nhttp://dev.mysql.com/doc/refman/5.7/en/performance-schema-query-profili\nng.html.\n\nTo control profiling, use the profiling session variable, which has a\ndefault value of 0 (OFF). Enable profiling by setting profiling to 1 or\nON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nserver. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILE and SHOW PROFILES, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthough there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.7/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n with the name and line number of the file in which the function\n occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-profile.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+----------+--------------------------+\n| 0 | 0.000088 | SET PROFILING = 1 |\n| 1 | 0.000136 | DROP TABLE IF EXISTS t1 |\n| 2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table | 0.000056 |\n| After create | 0.011363 |\n| query end | 0.000375 |\n| freeing items | 0.000089 |\n| logging slow query | 0.000019 |\n| cleaning up | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| query end | 0.000107 |\n| freeing items | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 | 0.000002 |\n| creating table | 0.000056 | 0.000028 | 0.000028 |\n| After create | 0.011363 | 0.000217 | 0.001571 |\n| query end | 0.000375 | 0.000013 | 0.000028 |\n| freeing items | 0.000089 | 0.000010 | 0.000014 |\n| logging slow query | 0.000019 | 0.000009 | 0.000010 |\n| cleaning up | 0.000005 | 0.000003 | 0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/show-profile.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (311,3,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0.0E0, the function returns NULL and (as\nof MySQL 5.7.4) a warning "Invalid argument for logarithm" is reported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n -> 0.69314718055995\nmysql> SELECT LN(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (312,27,'SET CHARACTER SET','Syntax:\nSET {CHARACTER SET | CHARSET}\n {\'charset_name\' | DEFAULT}\n\nThis statement maps all strings sent between the server and the current\nclient with the given mapping. SET CHARACTER SET sets three session\nsystem variables: character_set_client and character_set_results are\nset to the given character set, and character_set_connection to the\nvalue of character_set_database. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html.\n\ncharset_name may be quoted or unquoted.\n\nThe default character set mapping can be restored by using the value\nDEFAULT. The default depends on the server configuration.\n\nSome character sets cannot be used as the client character set.\nAttempting to use them with SET CHARACTER SET produces an error. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html#charset-\nconnection-impermissible-client-charset.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-character-set.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (313,24,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\nThe LEAVE statement can be used to exit a stored program of those\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/return.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (314,8,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {OFF|ON}\n\nThe sql_log_bin variable controls whether logging to the binary log is\nenabled for the current session (assuming that the binary log itself is\nenabled). The default value is ON. To disable or enable binary logging\nfor the current session, set the session sql_log_bin variable to OFF or\nON.\n\nSet this variable to OFF for a session to temporarily disable binary\nlogging while making changes to the master you do not want replicated\nto the slave.\n\nSetting the session value of this system variable is a restricted\noperation. The session user must have privileges sufficient to set\nrestricted session variables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/system-variable-privileges.html.\n\nIt is not possible to set the session value of sql_log_bin within a\ntransaction or subquery.\n\nSetting this variable to OFF prevents GTIDs from being assigned to\ntransactions in the binary log. If you are using GTIDs for replication,\nthis means that even when binary logging is later enabled again, the\nGTIDs written into the log from this point do not account for any\ntransactions that occurred in the meantime, so in effect those\ntransactions are lost.\n\nThe global sql_log_bin variable is read only and cannot be modified.\nThe global scope is deprecated and will be removed in a future MySQL\nrelease.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-sql-log-bin.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (315,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str[,init_vector])\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nThe optional initialization vector argument, init_vector, is available\nas of MySQL 5.7.4. As of that version, statements that use\nAES_DECRYPT() are unsafe for statement-based replication and cannot be\nstored in the query cache.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (316,17,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n -> 0\nmysql> SELECT COERCIBILITY(USER());\n -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n -> 4\nmysql> SELECT COERCIBILITY(1000);\n -> 5\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (317,23,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (318,13,'GLENGTH','GLength(ls)\n\nGLength() is a nonstandard name. It corresponds to the OpenGIS\nST_Length() function. (There is an existing SQL function Length() that\ncalculates the length of string values.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (319,27,'SHUTDOWN','Syntax:\nSHUTDOWN\n\nThis statement stops the MySQL server. It requires the SHUTDOWN\nprivilege.\n\nSHUTDOWN was added in MySQL 5.7.9. It provides an SQL-level interface\nto the same functionality available using the mysqladmin shutdown\ncommand or the mysql_shutdown() C API function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/shutdown.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/shutdown.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (320,7,'JSON_REMOVE','Syntax:\nJSON_REMOVE(json_doc, path[, path] ...)\n\nRemoves data from a JSON document and returns the result. Returns NULL\nif any argument is NULL. An error occurs if the json_doc argument is\nnot a valid JSON document or any path argument is not a valid path\nexpression or is $ or contains a * or ** wildcard.\n\nThe path arguments are evaluated left to right. The document produced\nby evaluating one path becomes the new value against which the next\npath is evaluated.\n\nIt is not an error if the element to be removed does not exist in the\ndocument; in that case, the path does not affect the document.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'["a", ["b", "c"], "d"]\';\nmysql> SELECT JSON_REMOVE(@j, \'$[1]\');\n+-------------------------+\n| JSON_REMOVE(@j, \'$[1]\') |\n+-------------------------+\n| ["a", "d"] |\n+-------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (321,7,'ST_ASGEOJSON','ST_AsGeoJSON(g [, max_dec_digits [, options]])\n\nGenerates a GeoJSON object from the geometry g. The object string has\nthe connection character set and collation.\n\nIf any argument is NULL, the return value is NULL. If any non-NULL\nargument is invalid, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html\n\n','mysql> SELECT ST_AsGeoJSON(ST_GeomFromText(\'POINT(11.11111 12.22222)\'),2);\n+-------------------------------------------------------------+\n| ST_AsGeoJSON(ST_GeomFromText(\'POINT(11.11111 12.22222)\'),2) |\n+-------------------------------------------------------------+\n| {"type": "Point", "coordinates": [11.11, 12.22]} |\n+-------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (322,26,'ST_BUFFER_STRATEGY','ST_Buffer_Strategy(strategy[, points_per_circle])\n\nThis function returns a strategy byte string for use with ST_Buffer()\nto influence buffer computation. If any argument is NULL, the return\nvalue is NULL. If any argument is invalid, an ER_WRONG_ARGUMENTS error\noccurs.\n\nInformation about strategies is available at Boost.org\n(http://www.boost.org).\n\nThe first argument must be a string indicating a strategy option:\n\no For point strategies, permitted values are \'point_circle\' and\n \'point_square\'.\n\no For join strategies, permitted values are \'join_round\' and\n \'join_miter\'.\n\no For end strategies, permitted values are \'end_round\' and \'end_flat\'.\n\nIf the first argument is \'point_circle\', \'join_round\', \'join_miter\', or\n\'end_round\', the points_per_circle argument must be given as a positive\nnumeric value. The maximum points_per_circle value is the value of the\nmax_points_in_geometry system variable as of MySQL 5.7.8, 65,536 before\nthat. If the first argument is \'point_square\' or \'end_flat\', the\npoints_per_circle argument must not be given or an ER_WRONG_ARGUMENTS\nerror occurs.\n\nFor examples, see the description of ST_Buffer().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (323,38,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ,\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n -> \'\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (324,38,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by , characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (,) character.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (325,16,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nIf there are no matching rows, MIN() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (326,28,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n {VALUES | VALUE} (value_list) [, (value_list)] ...\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n SET assignment_list\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n SELECT ...\n\nvalue:\n {expr | DEFAULT}\n\nvalue_list:\n value [, value] ...\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL---that\neither inserts or updates---see\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html.\n\nDELAYED inserts and replaces were deprecated in MySQL 5.6. In MySQL\n5.7, DELAYED is not supported. The server recognizes but ignores the\nDELAYED keyword, handles the replace as a nondelayed replace, and\ngenerates an ER_WARN_LEGACY_SYNTAX_CONVERTED warning. ("REPLACE DELAYED\nis no longer supported. The statement was converted to REPLACE.") The\nDELAYED keyword will be removed in a future release.\n\n*Note*:\n\nREPLACE makes sense only if a table has a PRIMARY KEY or UNIQUE index.\nOtherwise, it becomes equivalent to INSERT, because there is no index\nto be used to determine whether a new row duplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nIf a generated column is replaced explicitly, the only permitted value\nis DEFAULT. For information about generated columns, see\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.h\ntml.\n\nREPLACE supports explicit partition selection using the PARTITION\nkeyword with a list of comma-separated names of partitions,\nsubpartitions, or both. As with INSERT, if it is not possible to insert\nthe new row into any of these partitions or subpartitions, the REPLACE\nstatement fails with the error Found a row not matching the given\npartition set. For more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/replace.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (327,32,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP([fsp])\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (328,26,'ST_SYMDIFFERENCE','ST_SymDifference(g1, g2)\n\nReturns a geometry that represents the point set symmetric difference\nof the geometry values g1 and g2, which is defined as:\n\ng1 symdifference g2 := (g1 union g2) difference (g1 intersection g2)\n\nOr, in function call notation:\n\nST_SymDifference(g1, g2) = ST_Difference(ST_Union(g1, g2), ST_Intersection(g1, g2))\n\nIf any argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_AsText(ST_SymDifference(@g1, @g2));\n+---------------------------------------+\n| ST_AsText(ST_SymDifference(@g1, @g2)) |\n+---------------------------------------+\n| MULTIPOINT((1 1),(2 2)) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (329,7,'GTID_SUBSET','Syntax:\nGTID_SUBSET(set1,set2)\n\nGiven two sets of global transaction IDs set1 and set2, returns true if\nall GTIDs in set1 are also in set2. Returns false otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 0\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (330,16,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nIf there are no matching rows, VAR_SAMP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (331,23,'DATETIME','DATETIME[(fsp)]\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00.000000\' to \'9999-12-31 23:59:59.999999\'. MySQL displays\nDATETIME values in \'YYYY-MM-DD HH:MM:SS[.fraction]\' format, but permits\nassignment of values to DATETIME columns using either strings or\nnumbers.\n\nAn optional fsp value in the range from 0 to 6 may be given to specify\nfractional seconds precision. A value of 0 signifies that there is no\nfractional part. If omitted, the default precision is 0.\n\nAutomatic initialization and updating to the current date and time for\nDATETIME columns can be specified using DEFAULT and ON UPDATE column\ndefinition clauses, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (332,8,'CHANGE REPLICATION FILTER','Syntax:\nCHANGE REPLICATION FILTER filter[, filter][, ...]\n\nfilter:\n REPLICATE_DO_DB = (db_list)\n | REPLICATE_IGNORE_DB = (db_list)\n | REPLICATE_DO_TABLE = (tbl_list)\n | REPLICATE_IGNORE_TABLE = (tbl_list)\n | REPLICATE_WILD_DO_TABLE = (wild_tbl_list)\n | REPLICATE_WILD_IGNORE_TABLE = (wild_tbl_list)\n | REPLICATE_REWRITE_DB = (db_pair_list)\n\ndb_list:\n db_name[, db_name][, ...]\n\ntbl_list:\n db_name.table_name[, db_table_name][, ...]\nwild_tbl_list:\n \'db_pattern.table_pattern\'[, \'db_pattern.table_pattern\'][, ...]\n\ndb_pair_list:\n (db_pair)[, (db_pair)][, ...]\n\ndb_pair:\n from_db, to_db\n\nCHANGE REPLICATION FILTER sets one or more replication filtering rules\non the slave in the same way as starting the slave mysqld with\nreplication filtering options such as --replicate-do-db or\n--replicate-wild-ignore-table. Unlike the case with the server options,\nthis statement does not require restarting the server to take effect,\nonly that the slave SQL thread be stopped using STOP SLAVE SQL_THREAD\nfirst (and restarted with START SLAVE SQL_THREAD afterwards). CHANGE\nREPLICATION FILTER requires the SUPER privilege.\n\nReplication filters cannot be set on a MySQL server instance that is\nconfigured for Group Replication, because filtering transactions on\nsome servers would make the group unable to reach agreement on a\nconsistent state.\n\nThe following list shows the CHANGE REPLICATION FILTER options and how\nthey relate to --replicate-* server options:\n\no REPLICATE_DO_DB: Include updates based on database name. Equivalent\n to --replicate-do-db.\n\no REPLICATE_IGNORE_DB: Exclude updates based on database name.\n Equivalent to --replicate-ignore-db.\n\no REPLICATE_DO_TABLE: Include updates based on table name. Equivalent\n to --replicate-do-table.\n\no REPLICATE_IGNORE_TABLE: Exclude updates based on table name.\n Equivalent to --replicate-ignore-table.\n\no REPLICATE_WILD_DO_TABLE: Include updates based on wildcard pattern\n matching table name. Equivalent to --replicate-wild-do-table.\n\no REPLICATE_WILD_IGNORE_TABLE: Exclude updates based on wildcard\n pattern matching table name. Equivalent to\n --replicate-wild-ignore-table.\n\no REPLICATE_REWRITE_DB: Perform updates on slave after substituting new\n name on slave for specified database on master. Equivalent to\n --replicate-rewrite-db.\n\nThe precise effects of REPLICATE_DO_DB and REPLICATE_IGNORE_DB filters\nare dependent on whether statement-based or row-based replication is in\neffect. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-rules.html, for more\ninformation.\n\nMultiple replication filtering rules can be created in a single CHANGE\nREPLICATION FILTER statement by separating the rules with commas, as\nshown here:\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (d1), REPLICATE_IGNORE_DB = (d2);\n\nIssuing the statement just shown is equivalent to starting the slave\nmysqld with the options --replicate-do-db=d1 --replicate-ignore-db=d2.\n\nIf the same filtering rule is specified multiple times, only the last\nsuch rule is actually used. For example, the two statements shown here\nhave exactly the same effect, because the first REPLICATE_DO_DB rule in\nthe first statement is ignored:\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (db1, db2), REPLICATE_DO_DB = (db3, db4);\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (db3,db4);\n\n*Caution*:\n\nThis behavior differs from that of the --replicate-* filter options\nwhere specifying the same option multiple times causes the creation of\nmultiple filter rules.\n\nNames of tables and database not containing any special characters need\nnot be quoted. Values used with REPLICATION_WILD_TABLE and\nREPLICATION_WILD_IGNORE_TABLE are string expressions, possibly\ncontaining (special) wildcard characters, and so must be quoted. This\nis shown in the following example statements:\n\nCHANGE REPLICATION FILTER\n REPLICATE_WILD_DO_TABLE = (\'db1.old%\');\n\nCHANGE REPLICATION FILTER\n REPLICATE_WILD_IGNORE_TABLE = (\'db1.new%\', \'db2.new%\');\n\nValues used with REPLICATE_REWRITE_DB represent pairs of database\nnames; each such value must be enclosed in parentheses. The following\nstatement rewrites statements occurring on database db1 on the master\nto database db2 on the slave:\n\nCHANGE REPLICATION FILTER REPLICATE_REWRITE_DB = ((db1, db2));\n\nThe statement just shown contains two sets of parentheses, one\nenclosing the pair of database names, and the other enclosing the\nentire list. This is perhap more easily seen in the following example,\nwhich creates two rewrite-db rules, one rewriting database dbA to dbB,\nand one rewriting database dbC to dbD:\n\nCHANGE REPLICATION FILTER\n REPLICATE_REWRITE_DB = ((dbA, dbB), (dbC, dbD));\n\nThis statement leaves any existing replication filtering rules\nunchanged; to unset all filters of a given type, set the filter\'s value\nto an explicitly empty list, as shown in this example, which removes\nall existing REPLICATE_DO_DB and REPLICATE_IGNORE_DB rules:\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (), REPLICATE_IGNORE_DB = ();\n\nSetting a filter to empty in this way removes all existing rules, does\nnot create any new ones, and does not restore any rules set at mysqld\nstartup using --replicate-* options on the command line or in the\nconfiguration file.\n\nValues employed with REPLICATE_WILD_DO_TABLE and\nREPLICATE_WILD_IGNORE_TABLE must be in the format db_name.tbl_name.\nPrior to MySQL 5.7.5, this was not strictly enforced, although using\nnonconforming values with these options could lead to erroneous results\n(Bug #18095449).\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-rules.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (333,23,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (334,27,'SHOW COLUMNS','Syntax:\nSHOW [FULL] {COLUMNS | FIELDS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. SHOW COLUMNS displays information only for\nthose columns for which you have some privilege.\n\nmysql> SHOW 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| CountryCode | char(3) | NO | MUL | | |\n| District | char(20) | NO | | | |\n| Population | int(11) | NO | | 0 | |\n+-------------+----------+------+-----+---------+----------------+\n\nAn alternative to tbl_name FROM db_name syntax is db_name.tbl_name.\nThese two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nThe optional FULL keyword causes the output to include the column\ncollation and comments, as well as the privileges you have for each\ncolumn.\n\nThe LIKE clause, if present, indicates which column names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nThe data types may differ from what you expect them to be based on a\nCREATE TABLE statement because MySQL sometimes changes data types when\nyou create or alter a table. The conditions under which this occurs are\ndescribed in\nhttp://dev.mysql.com/doc/refman/5.7/en/silent-column-changes.html.\n\nSHOW COLUMNS displays the following values for each table column:\n\no Field\n\n The column name.\n\no Type\n\n The column data type.\n\no Collation\n\n The collation for nonbinary string columns, or NULL for other\n columns. This value is displayed only if you use the FULL keyword.\n\no Null\n\n The column nullability. The value is YES if NULL values can be stored\n in the column, NO if not.\n\no Key\n\n Whether the column is indexed:\n\n o If Key is empty, the column either is not indexed or is indexed\n only as a secondary column in a multiple-column, nonunique index.\n\n o If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\n o If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index permits multiple NULL values, but you can tell whether\n the column permits NULL by checking the Null field.)\n\n o If Key is MUL, the column is the first column of a nonunique index\n in which multiple occurrences of a given value are permitted within\n the column.\n\n If more than one of the Key values applies to a given column of a\n table, Key displays the one with the highest priority, in the order\n PRI, UNI, MUL.\n\n A UNIQUE index may be displayed as PRI if it cannot contain NULL\n values and there is no PRIMARY KEY in the table. A UNIQUE index may\n display as MUL if several columns form a composite UNIQUE index;\n although the combination of the columns is unique, each column can\n still hold multiple occurrences of a given value.\n\no Default\n\n The default value for the column. This is NULL if the column has an\n explicit default of NULL, or if the column definition includes no\n DEFAULT clause.\n\no Extra\n\n Any additional information that is available about a given column.\n The value is nonempty in these cases:\n\n o auto_increment for columns that have the AUTO_INCREMENT attribute.\n\n o on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that\n have the ON UPDATE CURRENT_TIMESTAMP attribute.\n\n o VIRTUAL GENERATED or VIRTUAL STORED for generated columns.\n\no Privileges\n\n The privileges you have for the column. This value is displayed only\n if you use the FULL keyword.\n\no Comment\n\n Any comment included in the column definition. This value is\n displayed only if you use the FULL keyword.\n\nTable column information is also available from the INFORMATION_SCHEMA\nCOLUMNS table. See\nhttp://dev.mysql.com/doc/refman/5.7/en/columns-table.html.\n\nYou can list a table\'s columns with the mysqlshow db_name tbl_name\ncommand.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee http://dev.mysql.com/doc/refman/5.7/en/describe.html.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-columns.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (335,23,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (336,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout][,channel])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nOn a multithreaded slave, the function waits until expiry of the limit\nset by the slave_checkpoint_group or slave_checkpoint_period system\nvariable, when the checkpoint operation is called to update the status\nof the slave. Depending on the setting for the system variables, the\nfunction might therefore return some time after the specified position\nwas reached.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nThe optional channel value enables you to name which replication\nchannel the function applies to. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (337,19,'^','Syntax:\n^\n\nBitwise XOR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (338,40,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view.\n\nIf any views named in the argument list do not exist, the statement\nreturns an error indicating by name which nonexisting views it was\nunable to drop, but also drops all views in the list that do exist.\n\n*Note*:\n\nIn MySQL 8.0, DROP VIEW fails if any views named in the argument list\ndo not exist. Due to the change in behavior, a partially completed DROP\nVIEW operation on a MySQL 5.7 master fails when replicated to a MySQL\n8.0 slave. To avoid this failure scenario, use IF EXISTS syntax in DROP\nVIEW statements to prevent an error from occurring for views that do\nnot exist. For more information, see Atomic Data Definition Statement\nSupport (http://dev.mysql.com/doc/refman/8.0/en/atomic-ddl.html).\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-view.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (339,32,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (340,22,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\nsystem database. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-function-udf.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (341,7,'ST_VALIDATE','ST_Validate(g)\n\nValidates a geometry according to the OGC specification. A geometry can\nbe syntactically well-formed (WKB value plus SRID) but geometrically\ninvalid. For example, this polygon is geometrically invalid: POLYGON((0\n0, 0 0, 0 0, 0 0, 0 0))\n\nST_Validate() returns the geometry if it is syntactically well-formed\nand is geometrically valid, NULL if the argument is not syntactically\nwell-formed or is not geometrically valid or is NULL.\n\nST_Validate() can be used to filter out invalid geometry data, although\nat a cost. For applications that require more precise results not\ntainted by invalid data, this penalty may be worthwhile.\n\nIf the geometry argument is valid, it is returned as is, except that if\nan input Polygon or MultiPolygon has clockwise rings, those rings are\nreversed before checking for validity. If the geometry is valid, the\nvalue with the reversed rings is returned.\n\nThe only valid empty geometry is represented in the form of an empty\ngeometry collection value. ST_Validate() returns it directly without\nfurther checks in this case.\n\nST_Validate() works only for the Cartesian coordinate system and\nrequires a geometry argument with an SRID of 0. An ER_WRONG_ARGUMENTS\nerror occurs otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @ls1 = ST_GeomFromText(\'LINESTRING(0 0)\');\nmysql> SET @ls2 = ST_GeomFromText(\'LINESTRING(0 0, 1 1)\');\nmysql> SELECT ST_AsText(ST_Validate(@ls1));\n+------------------------------+\n| ST_AsText(ST_Validate(@ls1)) |\n+------------------------------+\n| NULL |\n+------------------------------+\nmysql> SELECT ST_AsText(ST_Validate(@ls2));\n+------------------------------+\n| ST_AsText(ST_Validate(@ls2)) |\n+------------------------------+\n| LINESTRING(0 0,1 1) |\n+------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (342,38,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user.\n\nIf no expression matching xpath_expr is found, or if multiple matches\nare found, the function returns the original xml_target XML fragment.\nAll three arguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html\n\n','mysql> SELECT\n -> UpdateXML(\'ccc\', \'/a\', \'fff\') AS val1,\n -> UpdateXML(\'ccc\', \'/b\', \'fff\') AS val2,\n -> UpdateXML(\'ccc\', \'//b\', \'fff\') AS val3,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val4,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val5\n -> \\G\n\n*************************** 1. row ***************************\nval1: fff\nval2: ccc\nval3: fff\nval4: cccfff\nval5: ccc\n','http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (343,8,'RESET SLAVE','Syntax:\nRESET SLAVE [ALL] [channel_option]\n\nchannel_option:\n FOR CHANNEL channel\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It clears the master info and relay log info repositories,\ndeletes all the relay log files, and starts a new relay log file. It\nalso resets to 0 the replication delay specified with the MASTER_DELAY\noption to CHANGE MASTER TO. RESET SLAVE does not change the values of\ngtid_executed or gtid_purged.\n\n*Note*:\n\nAll relay log files are deleted, even if they have not been completely\nexecuted by the slave SQL thread. (This is a condition likely to exist\non a replication slave if you have issued a STOP SLAVE statement or if\nthe slave is highly loaded.)\n\nTo use RESET SLAVE, the slave replication threads must be stopped, so\non a running slave use STOP SLAVE before issuing RESET SLAVE. To use\nRESET SLAVE on a Group Replication group member, the member status must\nbe OFFLINE, meaning that the plugin is loaded but the member does not\ncurrently belong to any group. A group member can be taken offline by\nusing a STOP GROUP REPLICATION statement.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the RESET SLAVE statement to a specific\nreplication channel. Combining a FOR CHANNEL channel clause with the\nALL option deletes the specified channel. If no channel is named and no\nextra channels exist, the statement applies to the default channel.\nIssuing a RESET SLAVE ALL statement without a FOR CHANNEL channel\nclause when multiple replication channels exist deletes all replication\nchannels and recreates only the default channel. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nRESET SLAVE does not change any replication connection parameters such\nas master host, master port, master user, or master password.\n\no From MySQL 5.7.24, when master_info_repository=TABLE is set on the\n server, replication connection parameters are preserved in the\n crash-safe InnoDB table mysql.slave_master_info as part of the RESET\n SLAVE operation. They are also retained in memory. In the event of a\n server crash or deliberate restart after issuing RESET SLAVE but\n before issuing START SLAVE, the replication connection parameters are\n retrieved from the table and reused for the new connection.\n\no When master_info_repository=FILE is set on the server (which is the\n default in MySQL 5.7), replication connection parameters are only\n retained in memory. If the slave mysqld is restarted immediately\n after issuing RESET SLAVE due to a server crash or deliberate\n restart, the connection parameters are lost. In that case, you must\n issue a CHANGE MASTER TO statement after the server start to\n respecify the connection parameters before issuing START SLAVE.\n\nIf you want to reset the connection parameters intentionally, you need\nto use RESET SLAVE ALL, which clears the connection parameters. In that\ncase, you must issue a CHANGE MASTER TO statement after the server\nstart to specify the new connection parameters.\n\nRESET SLAVE causes an implicit commit of an ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nIf the slave SQL thread was in the middle of replicating temporary\ntables when it was stopped, and RESET SLAVE is issued, these replicated\ntemporary tables are deleted on the slave.\n\nPrior to MySQL 5.7.5, RESET SLAVE also had the effect of resetting both\nthe heartbeat period (Slave_heartbeat_period) and\nSSL_VERIFY_SERVER_CERT. This issue is fixed in MySQL 5.7.5 and later.\n(Bug #18777899, Bug #18778485)\n\nPrior to MySQL 5.7.5, RESET SLAVE ALL did not clear the\nIGNORE_SERVER_IDS list set by CHANGE MASTER TO. In MySQL 5.7.5 and\nlater, the statement clears the list. (Bug #18816897)\n\n*Note*:\n\nWhen used on an NDB Cluster replication slave SQL node, RESET SLAVE\nclears the mysql.ndb_apply_status table. You should keep in mind when\nusing this statement that ndb_apply_status uses the NDB storage engine\nand so is shared by all SQL nodes attached to the slave cluster.\n\nYou can override this behavior by issuing SET GLOBAL\n@@ndb_clear_apply_status=OFF prior to executing RESET SLAVE, which\nkeeps the slave from purging the ndb_apply_status table in such cases.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/reset-slave.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (344,7,'ST_POINTFROMGEOHASH','ST_PointFromGeoHash(geohash_str, srid)\n\nReturns a POINT value containing the decoded geohash value, given a\ngeohash string value.\n\nThe X and Y coordinates of the point are the longitude in the range\n[−180, 180] and the latitude in the range [−90, 90], respectively.\n\nIf any argument is NULL, the return value is NULL. If any argument is\ninvalid, an error occurs.\n\nThe srid argument is an unsigned 32-bit integer.\n\nThe remarks in the description of ST_LatFromGeoHash() regarding the\nmaximum number of characters processed from the geohash_str argument\nalso apply to ST_PointFromGeoHash().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SET @gh = ST_GeoHash(45,-20,10);\nmysql> SELECT ST_AsText(ST_PointFromGeoHash(@gh,0));\n+---------------------------------------+\n| ST_AsText(ST_PointFromGeoHash(@gh,0)) |\n+---------------------------------------+\n| POINT(45 -20) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (345,32,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (346,14,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to RFC\n4122, "A Universally Unique IDentifier (UUID) URN Namespace"\n(http://www.ietf.org/rfc/rfc4122.txt).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate devices not\nconnected to each other.\n\n*Warning*:\n\nAlthough UUID() values are intended to be unique, they are not\nnecessarily unguessable or unpredictable. If unpredictability is\nrequired, UUID values should be generated some other way.\n\nUUID() returns a value that conforms to UUID version 1 as described in\nRFC 4122. The value is a 128-bit number represented as a utf8 string of\nfive hexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\nformat:\n\no The first three numbers are generated from the low, middle, and high\n parts of a timestamp. The high part also includes the UUID version\n number.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n uniqueness. A random number is substituted if the latter is not\n available (for example, because the host device has no Ethernet card,\n or it is unknown how to find the hardware address of an interface on\n the host operating system). In this case, spatial uniqueness cannot\n be guaranteed. Nevertheless, a collision should have very low\n probability.\n\n The MAC address of an interface is taken into account only on FreeBSD\n and Linux. On other operating systems, MySQL uses a randomly\n generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n -> \'6ccd780c-baba-1026-9564-5b8c656024db\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (347,25,'LINESTRING','LineString(pt [, pt] ...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (348,14,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. The duration may have a fractional part. If\nthe argument is NULL or negative, SLEEP() produces a warning, or an\nerror in strict SQL mode.\n\nWhen sleep returns normally (without interruption), it returns 0:\n\nmysql> SELECT SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 0 |\n+-------------+\n\nWhen SLEEP() is the only thing invoked by a query that is interrupted,\nit returns 1 and the query itself returns no error. This is true\nwhether the query is killed or times out:\n\no This statement is interrupted using KILL QUERY from another session:\n\nmysql> SELECT SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 1 |\n+-------------+\n\no This statement is interrupted by timing out:\n\nmysql> SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 1 |\n+-------------+\n\nWhen SLEEP() is only part of a query that is interrupted, the query\nreturns an error:\n\no This statement is interrupted using KILL QUERY from another session:\n\nmysql> SELECT 1 FROM t1 WHERE SLEEP(1000);\nERROR 1317 (70100): Query execution was interrupted\n\no This statement is interrupted by timing out:\n\nmysql> SELECT /*+ MAX_EXECUTION_TIME(1000) */ 1 FROM t1 WHERE SLEEP(1000);\nERROR 3024 (HY000): Query execution was interrupted, maximum statement\nexecution time exceeded\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (349,40,'CREATE LOGFILE GROUP','Syntax:\nCREATE LOGFILE GROUP logfile_group\n ADD UNDOFILE \'undo_file\'\n [INITIAL_SIZE [=] initial_size]\n [UNDO_BUFFER_SIZE [=] undo_buffer_size]\n [REDO_BUFFER_SIZE [=] redo_buffer_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] \'string\']\n ENGINE [=] engine_name\n\nThis statement creates a new log file group named logfile_group having\na single UNDO file named \'undo_file\'. A CREATE LOGFILE GROUP statement\nhas one and only one ADD UNDOFILE clause. For rules covering the naming\nof log file groups, see\nhttp://dev.mysql.com/doc/refman/5.7/en/identifiers.html.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nThere can be only one log file group per NDB Cluster instance at any\ngiven time.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size;\nif not specified, it defaults to 128M (128 megabytes). The optional\nUNDO_BUFFER_SIZE parameter sets the size used by the UNDO buffer for\nthe log file group; The default value for UNDO_BUFFER_SIZE is 8M (eight\nmegabytes); this value cannot exceed the amount of system memory\navailable. Both of these parameters are specified in bytes. You may\noptionally follow either or both of these with a one-letter\nabbreviation for an order of magnitude, similar to those used in\nmy.cnf. Generally, this is one of the letters M (for megabytes) or G\n(for gigabytes).\n\nMemory used for UNDO_BUFFER_SIZE comes from the global pool whose size\nis determined by the value of the SharedGlobalMemory data node\nconfiguration parameter. This includes any default value implied for\nthis option by the setting of the InitialLogFileGroup data node\nconfiguration parameter.\n\nThe maximum permitted for UNDO_BUFFER_SIZE is 629145600 (600 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB).\n\nThe ENGINE option determines the storage engine to be used by this log\nfile group, with engine_name being the name of the storage engine. In\nMySQL 5.7, this must be NDB (or NDBCLUSTER). If ENGINE is not set,\nMySQL tries to use the engine specified by the default_storage_engine\nserver system variable (formerly storage_engine). In any case, if the\nengine is not specified as NDB or NDBCLUSTER, the CREATE LOGFILE GROUP\nstatement appears to succeed but actually fails to create the log file\ngroup, as shown here:\n\nmysql> CREATE LOGFILE GROUP lg1\n -> ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+-------+------+------------------------------------------------------------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------------------------------------------------------------+\n| Error | 1478 | Table storage engine \'InnoDB\' does not support the create option \'TABLESPACE or LOGFILE GROUP\' |\n+-------+------+------------------------------------------------------------------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> DROP LOGFILE GROUP lg1 ENGINE = NDB; \nERROR 1529 (HY000): Failed to drop LOGFILE GROUP\n\nmysql> CREATE LOGFILE GROUP lg1\n -> ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M\n -> ENGINE = NDB;\nQuery OK, 0 rows affected (2.97 sec)\n\nThe fact that the CREATE LOGFILE GROUP statement does not actually\nreturn an error when a non-NDB storage engine is named, but rather\nappears to succeed, is a known issue which we hope to address in a\nfuture release of NDB Cluster.\n\nREDO_BUFFER_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but ignored,\nand so have no effect in MySQL 5.7. These options are intended for\nfuture expansion.\n\nWhen used with ENGINE [=] NDB, a log file group and associated UNDO log\nfile are created on each Cluster data node. You can verify that the\nUNDO files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, LOGFILE_GROUP_NUMBER, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE FILE_NAME = \'undo_10.dat\';\n+--------------------+----------------------+----------------+\n| LOGFILE_GROUP_NAME | LOGFILE_GROUP_NUMBER | EXTRA |\n+--------------------+----------------------+----------------+\n| lg_3 | 11 | CLUSTER_NODE=3 |\n| lg_3 | 11 | CLUSTER_NODE=4 |\n+--------------------+----------------------+----------------+\n2 rows in set (0.06 sec)\n\nCREATE LOGFILE GROUP is useful only with Disk Data storage for NDB\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (350,6,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nThe return value has the same type as the first argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (351,3,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n -> -1\nmysql> SELECT ROUND(-1.58);\n -> -2\nmysql> SELECT ROUND(1.58);\n -> 2\nmysql> SELECT ROUND(1.298, 1);\n -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n -> 1\nmysql> SELECT ROUND(23.298, -1);\n -> 20\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (352,8,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_types]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nchannel_option:\n FOR CHANNEL channel\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\nRecommended best practice is to execute STOP SLAVE on the slave before\nstopping the slave server (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-shutdown.html, for more\ninformation).\n\nWhen using the row-based logging format: You should execute STOP SLAVE\nor STOP SLAVE SQL_THREAD on the slave prior to shutting down the slave\nserver if you are replicating any tables that use a nontransactional\nstorage engine (see the Note later in this section).\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\nSTOP SLAVE causes an implicit commit of an ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nFrom MySQL 5.7, gtid_next must be set to AUTOMATIC before issuing this\nstatement (Bug #16062608).\n\nFrom MySQL 5.7, you can control how long STOP SLAVE waits before timing\nout by setting the rpl_stop_slave_timeout system variable. This can be\nused to avoid deadlocks between STOP SLAVE and other slave SQL\nstatements using different client connections to the slave. When the\ntimeout value is reached, the issuing client returns an error message\nand stops waiting, but the STOP SLAVE instruction remains in effect.\nOnce the slave threads are no longer busy, the STOP SLAVE statement is\nexecuted and the slave stops. (Bug #16856735)\n\nSome CHANGE MASTER TO statements are allowed while the slave is\nrunning, depending on the states of the slave SQL and I/O threads.\nHowever, using STOP SLAVE prior to executing CHANGE MASTER TO in such\ncases is still supported. See [HELP CHANGE MASTER TO], and\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-solutions-switch.htm\nl, for more information.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the STOP SLAVE statement to a specific\nreplication channel. If no channel is named and no extra channels\nexist, the statement applies to the default channel. If a STOP SLAVE\nstatement does not name a channel when using multiple channels, this\nstatement stops the specified threads for all channels. This statement\ncannot be used with the group_replication_recovery channel. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nWhen using statement-based replication: changing the master while it\nhas open temporary tables is potentially unsafe. This is one of the\nreasons why statement-based replication of temporary tables is not\nrecommended. You can find out whether there are any temporary tables on\nthe slave by checking the value of Slave_open_temp_tables; when using\nstatement-based replication, this value should be 0 before executing\nCHANGE MASTER TO. If there are any temporary tables open on the slave,\nissuing a CHANGE MASTER TO statement after issuing a STOP SLAVE causes\nan ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO warning.\n\nWhen using a multithreaded slave (slave_parallel_workers is a nonzero\nvalue), any gaps in the sequence of transactions executed from the\nrelay log are closed as part of stopping the worker threads. If the\nslave is stopped unexpectedly (for example due to an error in a worker\nthread, or another thread issuing KILL) while a STOP SLAVE statement is\nexecuting, the sequence of executed transactions from the relay log may\nbecome inconsistent. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-features-transaction\n-inconsistencies.html, for more information.\n\nIf the current replication event group has modified one or more\nnontransactional tables, STOP SLAVE waits for up to 60 seconds for the\nevent group to complete, unless you issue a KILL QUERY or KILL\nCONNECTION statement for the slave SQL thread. If the event group\nremains incomplete after the timeout, an error message is logged.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/stop-slave.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (353,32,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 − expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nThe result returned by TIMEDIFF() is limited to the range allowed for\nTIME values. Alternatively, you can use either of the functions\nTIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n -> \'2000:01:01 00:00:00.000001\');\n -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n -> \'2008-12-30 01:01:01.000002\');\n -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (354,4,'LINEFROMTEXT','LineFromText(wkt[, srid]), LineStringFromText(wkt[, srid])\n\nST_LineFromText(), ST_LineStringFromText(), LineFromText(), and\nLineStringFromText() are synonyms. For more information, see the\ndescription of ST_LineFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (355,32,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (356,38,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n -> \'HEJ\'\n\nSee the description of LOWER() for information that also applies to\nUPPER(). This included information about how to perform lettercase\nconversion of binary strings (BINARY, VARBINARY, BLOB) for which these\nfunctions are ineffective, and information about case folding for\nUnicode character sets.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (357,23,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 − 1) bytes.\nEach MEDIUMBLOB value is stored using a 3-byte length prefix that\nindicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (358,32,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether\nthe function is used in a string or numeric context. The value is\nexpressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1447430881);\n -> \'2015-11-13 10:08:01\'\nmysql> SELECT FROM_UNIXTIME(1447430881) + 0;\n -> 20151113100801\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2015 13th November 10:08:01 2015\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (359,12,'SHA2','Syntax:\nSHA2(str, hash_length)\n\nCalculates the SHA-2 family of hash functions (SHA-224, SHA-256,\nSHA-384, and SHA-512). The first argument is the cleartext string to be\nhashed. The second argument indicates the desired bit length of the\nresult, which must have a value of 224, 256, 384, 512, or 0 (which is\nequivalent to 256). If either argument is NULL or the hash length is\nnot one of the permitted values, the return value is NULL. Otherwise,\nthe function result is a hash value containing the desired number of\nbits. See the notes at the beginning of this section about storing hash\nvalues efficiently.\n\nThe return value is a string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT SHA2(\'abc\', 224);\n -> \'23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (360,6,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n -> 1\nmysql> SELECT IFNULL(NULL,10);\n -> 10\nmysql> SELECT IFNULL(1/0,10);\n -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (361,27,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-function-code.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (362,27,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nSHOW ERRORS is a diagnostic statement that is similar to SHOW WARNINGS,\nexcept that it displays information only for errors, rather than for\nerrors, warnings, and notes.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nSHOW ERRORS and error_count apply only to errors, not warnings or\nnotes. In other respects, they are similar to SHOW WARNINGS and\nwarning_count. In particular, SHOW ERRORS cannot display information\nfor more than max_error_count messages, and error_count can exceed the\nvalue of max_error_count if the number of errors exceeds\nmax_error_count.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-errors.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (363,27,'SET NAMES','Syntax:\nSET NAMES {\'charset_name\'\n [COLLATE \'collation_name\'] | DEFAULT}\n\nThis statement sets the three session system variables\ncharacter_set_client, character_set_connection, and\ncharacter_set_results to the given character set. Setting\ncharacter_set_connection to charset_name also sets collation_connection\nto the default collation for charset_name. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html.\n\nThe optional COLLATE clause may be used to specify a collation\nexplicitly. If given, the collation must one of the permitted\ncollations for charset_name.\n\ncharset_name and collation_name may be quoted or unquoted.\n\nThe default mapping can be restored by using a value of DEFAULT. The\ndefault depends on the server configuration.\n\nSome character sets cannot be used as the client character set.\nAttempting to use them with SET NAMES produces an error. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html#charset-\nconnection-impermissible-client-charset.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-names.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-names.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (364,20,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If any argument is NULL, the result is NULL. No comparison is needed.\n\no If all arguments are integer-valued, they are compared as integers.\n\no If at least one argument is double precision, they are compared as\n double-precision values. Otherwise, if at least one argument is a\n DECIMAL value, they are compared as DECIMAL values.\n\no If the arguments comprise a mix of numbers and strings, they are\n compared as numbers.\n\no If any argument is a nonbinary (character) string, the arguments are\n compared as nonbinary strings.\n\no In all other cases, the arguments are compared as binary strings.\n\nThe return type of LEAST() is the aggregated type of the comparison\nargument types.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n -> \'A\'\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (365,20,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n -> 0\nmysql> SELECT \'0\' = 0;\n -> 1\nmysql> SELECT \'0.0\' = 0;\n -> 1\nmysql> SELECT \'0.01\' = 0;\n -> 0\nmysql> SELECT \'.01\' = 0.01;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (366,4,'ST_GEOMCOLLFROMTEXT','ST_GeomCollFromText(wkt[, srid]), ST_GeometryCollectionFromText(wkt[,\nsrid]), ST_GeomCollFromTxt(wkt[, srid])\n\nConstructs a GeometryCollection value using its WKT representation and\nSRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','mysql> SET @g = "MULTILINESTRING((10 10, 11 11), (9 9, 10 10))";\nmysql> SELECT ST_AsText(ST_GeomCollFromText(@g));\n+--------------------------------------------+\n| ST_AsText(ST_GeomCollFromText(@g)) |\n+--------------------------------------------+\n| MULTILINESTRING((10 10,11 11),(9 9,10 10)) |\n+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (367,14,'IS_IPV4_MAPPED','Syntax:\nIS_IPV4_MAPPED(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-mapped IPv6 address, 0 otherwise. IPv4-mapped\naddresses have the form ::ffff:ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.5.9\'));\n -> 0\nmysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (368,10,'CREATE USER','Syntax:\nCREATE USER [IF NOT EXISTS]\n user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [password_option | lock_option] ...\n\nuser:\n (see )\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n | IDENTIFIED BY PASSWORD \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\npassword_option: {\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n}\n\nlock_option: {\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nThe CREATE USER statement creates new MySQL accounts. It enables\nauthentication, SSL/TLS, resource-limit, and password-management\nproperties to be established for new accounts, and controls whether\naccounts are initially locked or unlocked.\n\nTo use CREATE USER, you must have the global CREATE USER privilege, or\nthe INSERT privilege for the mysql system database. When the read_only\nsystem variable is enabled, CREATE USER additionally requires the SUPER\nprivilege.\n\nAn error occurs if you try to create an account that already exists. If\nthe IF NOT EXISTS clause is given, the statement produces a warning for\neach named account that already exists, rather than an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-user.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (369,25,'POINT','Point(x, y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (370,38,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (371,7,'CREATE_DH_PARAMETERS','CREATE_DH_PARAMETERS(key_len)\n\nCreates a shared secret for generating a DH private/public key pair and\nreturns a binary string that can be passed to\nCREATE_ASYMMETRIC_PRIV_KEY(). If secret generation fails, the result is\nnull.\n\nSupported key_len values: The minimum and maximum key lengths in bits\nare 1,024 and 10,000. These key-length limits are constraints imposed\nby OpenSSL. Server administrators can impose additional limits on\nmaximum key length by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-usage.html\n.\n\nFor an example showing how to use the return value for generating\nsymmetric keys, see the description of ASYMMETRIC_DERIVE().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','SET @dhp = CREATE_DH_PARAMETERS(1024);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (372,20,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (373,38,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with InnoDB or MyISAM tables, and\n can be created only for CHAR, VARCHAR, or TEXT columns.\n\no As of MySQL 5.7.6, MySQL provides a built-in full-text ngram parser\n that supports Chinese, Japanese, and Korean (CJK), and an installable\n MeCab full-text parser plugin for Japanese. Parsing differences are\n outlined in\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-search-ngram.html,\n and\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-search-mecab.html.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n statement when a table is created, or added later using ALTER TABLE\n or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n that has no FULLTEXT index and then create the index after that, than\n to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a string value that is constant during query evaluation.\nThis rules out, for example, a table column because that can differ for\neach row.\n\nThere are three types of full-text searches:\n\no A natural language search interprets the search string as a phrase in\n natural human language (a phrase in free text). There are no special\n operators, with the exception of double quote (") characters. The\n stopword list applies. For more information about stopword lists, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-stopwords.html.\n\n Full-text searches are natural language searches if the IN NATURAL\n LANGUAGE MODE modifier is given or if no modifier is given. For more\n information, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-natural-language.html\n .\n\no A boolean search interprets the search string using the rules of a\n special query language. The string contains the words to search for.\n It can also contain operators that specify requirements such that a\n word must be present or absent in matching rows, or that it should be\n weighted higher or lower than usual. Certain common words (stopwords)\n are omitted from the search index and do not match if present in the\n search string. The IN BOOLEAN MODE modifier specifies a boolean\n search. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html.\n\no A query expansion search is a modification of a natural language\n search. The search string is used to perform a natural language\n search. Then words from the most relevant rows returned by the search\n are added to the search string and the search is done again. The\n query returns the rows from the second search. The IN NATURAL\n LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n specifies a query expansion search. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE) AS score\n FROM articles WHERE MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n| 6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (374,40,'CREATE EVENT','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\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 \'string\']\n DO event_body;\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\nThis statement creates and schedules a new event. The event will not\nrun unless the Event Scheduler is enabled. For information about\nchecking Event Scheduler status and enabling it if necessary, see\nhttp://dev.mysql.com/doc/refman/5.7/en/events-configuration.html.\n\nCREATE EVENT requires the EVENT privilege for the schema in which the\nevent is to be created. It might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n identifies the event in a database schema.\n\no An ON SCHEDULE clause, which determines when and how often the event\n executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once---one hour following its creation---by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case-sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.7/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-event.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (375,7,'MBR DEFINITION','Its MBR (minimum bounding rectangle), or envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.7/en/gis-class-geometry.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (376,26,'ST_DIFFERENCE','ST_Difference(g1, g2)\n\nReturns a geometry that represents the point set difference of the\ngeometry values g1 and g2. If any argument is NULL, the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(1 1) |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (377,25,'GEOMETRYCOLLECTION','GeometryCollection(g [, g] ...)\n\nConstructs a GeometryCollection value from the geometry arguments.\n\nGeometryCollection() returns all the proper geometries contained in the\narguments even if a nonsupported geometry is present.\n\nGeometryCollection() with no arguments is permitted as a way to create\nan empty geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (378,3,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (379,33,'ST_ASBINARY','ST_AsBinary(g), ST_AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nIf the argument is NULL, the return value is NULL. If the argument is\nnot a syntactically well-formed geometry, an ER_GIS_INVALID_DATA error\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','SELECT ST_AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (380,38,'TO_BASE64','Syntax:\nTO_BASE64(str)\n\nConverts the string argument to base-64 encoded form and returns the\nresult as a character string with the connection character set and\ncollation. If the argument is not a string, it is converted to a string\nbefore conversion takes place. The result is NULL if the argument is\nNULL. Base-64 encoded strings can be decoded using the FROM_BASE64()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (381,12,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.7/en/encrypted-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\n*Note*:\n\nThe DES_ENCRYPT() and DES_DECRYPT() functions are deprecated as of\nMySQL 5.7.6, will be removed in a future MySQL release, and should no\nlonger be used. Consider using AES_ENCRYPT() and AES_DECRYPT() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (382,2,'ST_AREA','ST_Area({poly|mpoly})\n\nReturns a double-precision number indicating the area of the Polygon or\nMultiPolygon argument, as measured in its spatial reference system. For\narguments of dimension 0 or 1, the result is 0. If the argument is an\nempty geometry the return value is 0. If the argument is NULL the\nreturn value is NULL.\n\nThe result is the sum of the area values of all components for a\ngeometry collection. If a geometry collection is empty, its area is\nreturned as 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT ST_Area(ST_GeomFromText(@poly));\n+---------------------------------+\n| ST_Area(ST_GeomFromText(@poly)) |\n+---------------------------------+\n| 4 |\n+---------------------------------+\n\nmysql> SET @mpoly =\n \'MultiPolygon(((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1)))\';\nmysql> SELECT ST_Area(ST_GeomFromText(@mpoly));\n+----------------------------------+\n| ST_Area(ST_GeomFromText(@mpoly)) |\n+----------------------------------+\n| 8 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (383,13,'ENDPOINT','EndPoint(ls)\n\nST_EndPoint() and EndPoint() are synonyms. For more information, see\nthe description of ST_EndPoint().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (384,28,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n {VALUES | VALUE} (value_list) [, (value_list)] ...\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n SET assignment_list\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n SELECT ...\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nvalue:\n {expr | DEFAULT}\n\nvalue_list:\n value [, value] ...\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT with an ON DUPLICATE KEY\nUPDATE clause enables existing rows to be updated if a row to be\ninserted would cause a duplicate value in a UNIQUE index or PRIMARY\nKEY.\n\nFor additional information about INSERT ... SELECT and INSERT ... ON\nDUPLICATE KEY UPDATE, see [HELP INSERT SELECT], and\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html.\n\nIn MySQL 5.7, the DELAYED keyword is accepted but ignored by the\nserver. For the reasons for this, see [HELP INSERT DELAYED],\n\nInserting into a table requires the INSERT privilege for the table. If\nthe ON DUPLICATE KEY UPDATE clause is used and a duplicate key causes\nan UPDATE to be performed instead, the statement requires the UPDATE\nprivilege for the columns to be updated. For columns that are read but\nnot modified you need only the SELECT privilege (such as for a column\nreferenced only on the right hand side of an col_name=expr assignment\nin an ON DUPLICATE KEY UPDATE clause).\n\nWhen inserting into a partitioned table, you can control which\npartitions and subpartitions accept new rows. The PARTITION option\ntakes a list of the comma-separated names of one or more partitions or\nsubpartitions (or both) of the table. If any of the rows to be inserted\nby a given INSERT statement do not match one of the partitions listed,\nthe INSERT statement fails with the error Found a row not matching the\ngiven partition set. For more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/insert.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (385,16,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nIf there are no matching rows, COUNT() returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n FROM student,course\n WHERE student.student_id=course.student_id\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (386,7,'JSON_ARRAY_APPEND','Syntax:\nJSON_ARRAY_APPEND(json_doc, path, val[, path, val] ...)\n\nAppends values to the end of the indicated arrays within a JSON\ndocument and returns the result. Returns NULL if any argument is NULL.\nAn error occurs if the json_doc argument is not a valid JSON document\nor any path argument is not a valid path expression or contains a * or\n** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nIf a path selects a scalar or object value, that value is autowrapped\nwithin an array and the new value is added to that array. Pairs for\nwhich the path does not identify any value in the JSON document are\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'["a", ["b", "c"], "d"]\';\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$[1]\', 1);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$[1]\', 1) |\n+----------------------------------+\n| ["a", ["b", "c", 1], "d"] |\n+----------------------------------+\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$[0]\', 2);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$[0]\', 2) |\n+----------------------------------+\n| [["a", 2], ["b", "c"], "d"] |\n+----------------------------------+\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$[1][0]\', 3);\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$[1][0]\', 3) |\n+-------------------------------------+\n| ["a", [["b", 3], "c"], "d"] |\n+-------------------------------------+\n\nmysql> SET @j = \'{"a": 1, "b": [2, 3], "c": 4}\';\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$.b\', \'x\');\n+------------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$.b\', \'x\') |\n+------------------------------------+\n| {"a": 1, "b": [2, 3, "x"], "c": 4} |\n+------------------------------------+\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$.c\', \'y\');\n+--------------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$.c\', \'y\') |\n+--------------------------------------+\n| {"a": 1, "b": [2, 3], "c": [4, "y"]} |\n+--------------------------------------+\n\nmysql> SET @j = \'{"a": 1}\';\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$\', \'z\');\n+---------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$\', \'z\') |\n+---------------------------------+\n| [{"a": 1}, "z"] |\n+---------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (387,4,'MLINEFROMTEXT','MLineFromText(wkt[, srid]), MultiLineStringFromText(wkt[, srid])\n\nST_MLineFromText(), ST_MultiLineStringFromText(), MLineFromText(), and\nMultiLineStringFromText() are synonyms. For more information, see the\ndescription of ST_MLineFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (388,33,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[, srid]), GeometryCollectionFromWKB(wkb[, srid])\n\nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(),\nGeomCollFromWKB(), and GeometryCollectionFromWKB() are synonyms. For\nmore information, see the description of ST_GeomCollFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (389,23,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 − 1) characters. The\neffective maximum length is less if the value contains multibyte\ncharacters. Each TINYTEXT value is stored using a 1-byte length prefix\nthat indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (390,7,'JSON_MERGE_PATCH()','Syntax:\nJSON_MERGE_PATCH(json_doc, json_doc[, json_doc] ...)\n\nPerforms an RFC 7396 (https://tools.ietf.org/html/rfc7396) compliant\nmerge of two or more JSON documents and returns the merged result,\nwithout preserving members having duplicate keys. Raises an error if at\nleast one of the documents passed as arguments to this function is not\nvalid.\n\n*Note*:\n\nFor an explanation and example of the differences between this function\nand JSON_MERGE_PRESERVE(), see\nhttp://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n#json-merge-patch-json-merge-preserve-compared.\n\nJSON_MERGE_PATCH() performs a merge as follows:\n\n1. If the first argument is not an object, the result of the merge is\n the same as if an empty object had been merged with the second\n argument.\n\n2. If the second argument is not an object, the result of the merge is\n the second argument.\n\n3. If both arguments are objects, the result of the merge is an object\n with the following members:\n\n o All members of the first object which do not have a corresponding\n member with the same key in the second object.\n\n o All members of the second object which do not have a corresponding\n key in the first object, and whose value is not the JSON null\n literal.\n\n o All members with a key that exists in both the first and the second\n object, and whose value in the second object is not the JSON null\n literal. The values of these members are the results of recursively\n merging the value in the first object with the value in the second\n object.\n\nFor additional information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/json.html#json-normalization.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SELECT JSON_MERGE_PATCH(\'[1, 2]\', \'[true, false]\');\n+---------------------------------------------+\n| JSON_MERGE_PATCH(\'[1, 2]\', \'[true, false]\') |\n+---------------------------------------------+\n| [true, false] |\n+---------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{"name": "x"}\', \'{"id": 47}\');\n+-------------------------------------------------+\n| JSON_MERGE_PATCH(\'{"name": "x"}\', \'{"id": 47}\') |\n+-------------------------------------------------+\n| {"id": 47, "name": "x"} |\n+-------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'1\', \'true\');\n+-------------------------------+\n| JSON_MERGE_PATCH(\'1\', \'true\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'[1, 2]\', \'{"id": 47}\');\n+------------------------------------------+\n| JSON_MERGE_PATCH(\'[1, 2]\', \'{"id": 47}\') |\n+------------------------------------------+\n| {"id": 47} |\n+------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\n > \'{ "a": 3, "c":4 }\');\n+-----------------------------------------------------------+\n| JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\'{ "a": 3, "c":4 }\') |\n+-----------------------------------------------------------+\n| {"a": 3, "b": 2, "c": 4} |\n+-----------------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\'{ "a": 3, "c":4 }\',\n > \'{ "a": 5, "d":6 }\');\n+-------------------------------------------------------------------------------+\n| JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\'{ "a": 3, "c":4 }\',\'{ "a": 5, "d":6 }\') |\n+-------------------------------------------------------------------------------+\n| {"a": 5, "b": 2, "c": 4, "d": 6} |\n+-------------------------------------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{"a":1, "b":2}\', \'{"b":null}\');\n+--------------------------------------------------+\n| JSON_MERGE_PATCH(\'{"a":1, "b":2}\', \'{"b":null}\') |\n+--------------------------------------------------+\n| {"a": 1} |\n+--------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{"a":{"x":1}}\', \'{"a":{"y":2}}\');\n+----------------------------------------------------+\n| JSON_MERGE_PATCH(\'{"a":{"x":1}}\', \'{"a":{"y":2}}\') |\n+----------------------------------------------------+\n| {"a": {"x": 1, "y": 2}} |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (391,14,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (392,21,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n\nOPTIMIZE TABLE reorganizes the physical storage of table data and\nassociated index data, to reduce storage space and improve I/O\nefficiency when accessing the table. The exact changes made to each\ntable depend on the storage engine used by that table.\n\nUse OPTIMIZE TABLE in these cases, depending on the type of table:\n\no After doing substantial insert, update, or delete operations on an\n InnoDB table that has its own .ibd file because it was created with\n the innodb_file_per_table option enabled. The table and indexes are\n reorganized, and disk space can be reclaimed for use by the operating\n system.\n\no After doing substantial insert, update, or delete operations on\n columns that are part of a FULLTEXT index in an InnoDB table. Set the\n configuration option innodb_optimize_fulltext_only=1 first. To keep\n the index maintenance period to a reasonable time, set the\n innodb_ft_num_word_optimize option to specify how many words to\n update in the search index, and run a sequence of OPTIMIZE TABLE\n statements until the search index is fully updated.\n\no After deleting a large part of a MyISAM or ARCHIVE table, or making\n many changes to a MyISAM or ARCHIVE table with variable-length rows\n (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted\n rows are maintained in a linked list and subsequent INSERT operations\n reuse old row positions. You can use OPTIMIZE TABLE to reclaim the\n unused space and to defragment the data file. After extensive changes\n to a table, this statement may also improve performance of statements\n that use the table, sometimes significantly.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nOPTIMIZE TABLE works for InnoDB, MyISAM, and ARCHIVE tables. OPTIMIZE\nTABLE is also supported for dynamic columns of in-memory NDB tables. It\ndoes not work for fixed-width columns of in-memory tables, nor does it\nwork for Disk Data tables. The performance of OPTIMIZE on NDB Cluster\ntables can be tuned using --ndb_optimization_delay, which controls the\nlength of time to wait between processing batches of rows by OPTIMIZE\nTABLE. For more information, see Previous NDB Cluster Issues Resolved\nin NDB Cluster 7.3\n(http://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-limitations-resol\nved.html).\n\nFor NDB Cluster tables, OPTIMIZE TABLE can be interrupted by (for\nexample) killing the SQL thread performing the OPTIMIZE operation.\n\nBy default, OPTIMIZE TABLE does not work for tables created using any\nother storage engine and returns a result indicating this lack of\nsupport. You can make OPTIMIZE TABLE work for other storage engines by\nstarting mysqld with the --skip-new option. In this case, OPTIMIZE\nTABLE is just mapped to ALTER TABLE.\n\nThis statement does not work with views.\n\nOPTIMIZE TABLE is supported for partitioned tables. For information\nabout using this statement with partitioned tables and table\npartitions, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-maintenance.html.\n\nBy default, the server writes OPTIMIZE TABLE statements to the binary\nlog so that they replicate to replication slaves. To suppress logging,\nspecify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/optimize-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (393,12,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDECODE() decrypts the encrypted string crypt_str using pass_str as the\npassword. crypt_str should be a string returned from ENCODE().\n\n*Note*:\n\nThe ENCODE() and DECODE() functions are deprecated in MySQL 5.7, will\nbe removed in a future MySQL release, and should no longer be used.\nConsider using AES_ENCRYPT() and AES_DECRYPT() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (394,7,'JSON_ARRAY_INSERT','Syntax:\nJSON_ARRAY_INSERT(json_doc, path, val[, path, val] ...)\n\nUpdates a JSON document, inserting into an array within the document\nand returning the modified document. Returns NULL if any argument is\nNULL. An error occurs if the json_doc argument is not a valid JSON\ndocument or any path argument is not a valid path expression or\ncontains a * or ** wildcard or does not end with an array element\nidentifier.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nPairs for which the path does not identify any array in the JSON\ndocument are ignored. If a path identifies an array element, the\ncorresponding value is inserted at that element position, shifting any\nfollowing values to the right. If a path identifies an array position\npast the end of an array, the value is inserted at the end of the\narray.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'["a", {"b": [1, 2]}, [3, 4]]\';\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[1]\', \'x\');\n+------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[1]\', \'x\') |\n+------------------------------------+\n| ["a", "x", {"b": [1, 2]}, [3, 4]] |\n+------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[100]\', \'x\');\n+--------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[100]\', \'x\') |\n+--------------------------------------+\n| ["a", {"b": [1, 2]}, [3, 4], "x"] |\n+--------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[1].b[0]\', \'x\');\n+-----------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[1].b[0]\', \'x\') |\n+-----------------------------------------+\n| ["a", {"b": ["x", 1, 2]}, [3, 4]] |\n+-----------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[2][1]\', \'y\');\n+---------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[2][1]\', \'y\') |\n+---------------------------------------+\n| ["a", {"b": [1, 2]}, [3, "y", 4]] |\n+---------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[0]\', \'x\', \'$[2][1]\', \'y\');\n+----------------------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[0]\', \'x\', \'$[2][1]\', \'y\') |\n+----------------------------------------------------+\n| ["x", "a", {"b": [1, 2]}, [3, 4]] |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (395,20,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nThe <=> operator is equivalent to the standard SQL IS NOT DISTINCT FROM\noperator.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (396,27,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nreset_option: {\n MASTER\n | QUERY CACHE\n | SLAVE\n}\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nThe RESET statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nThe following list describes the permitted RESET statement reset_option\nvalues:\n\no RESET MASTER\n\n Deletes all binary logs listed in the index file, resets the binary\n log index file to be empty, and creates a new binary log file.\n\no RESET QUERY CACHE\n\n Removes all query results from the query cache.\n\n *Note*:\n\n The query cache is deprecated as of MySQL 5.7.20, and is removed in\n MySQL 8.0. Deprecation includes RESET QUERY CACHE.\n\no RESET SLAVE\n\n Makes the slave forget its replication position in the master binary\n logs. Also resets the relay log by deleting any existing relay log\n files and beginning a new one.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/reset.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (397,14,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. A negative timeout value means infinite\ntimeout. The lock is exclusive. While held by one session, other\nsessions cannot obtain a lock of the same name.\n\nReturns 1 if the lock was obtained successfully, 0 if the attempt timed\nout (for example, because another client has previously locked the\nname), or NULL if an error occurred (such as running out of memory or\nthe thread was killed with mysqladmin kill).\n\nA lock obtained with GET_LOCK() is released explicitly by executing\nRELEASE_LOCK() or implicitly when your session terminates (either\nnormally or abnormally). Lock release may also occur with another call\nto GET_LOCK():\n\no Before 5.7.5, only a single simultaneous lock can be acquired and\n GET_LOCK() releases any existing lock.\n\no In MySQL 5.7.5, GET_LOCK() was reimplemented using the metadata\n locking (MDL) subsystem and its capabilities were extended. Multiple\n simultaneous locks can be acquired and GET_LOCK() does not release\n any existing locks. It is even possible for a given session to\n acquire multiple locks for the same name. Other sessions cannot\n acquire a lock with that name until the acquiring session releases\n all its locks for the name.\n\n As a result of the MDL reimplementation, locks acquired with\n GET_LOCK() appear in the Performance Schema metadata_locks table. The\n OBJECT_TYPE column says USER LEVEL LOCK and the OBJECT_NAME column\n indicates the lock name. Also, the capability of acquiring multiple\n locks introduces the possibility of deadlock among clients. When this\n happens, the server chooses a caller and terminates its\n lock-acquisition request with an ER_USER_LOCK_DEADLOCK error. This\n error does not cause transactions to roll back.\n\nThe difference in lock acquisition behavior as of MySQL 5.7.5 can be\nseen by the following example. Suppose that you execute these\nstatements:\n\nSELECT GET_LOCK(\'lock1\',10);\nSELECT GET_LOCK(\'lock2\',10);\nSELECT RELEASE_LOCK(\'lock2\');\nSELECT RELEASE_LOCK(\'lock1\');\n\nIn MySQL 5.7.5 or later, the second GET_LOCK() acquires a second lock\nand both RELEASE_LOCK() calls return 1 (success). Before MySQL 5.7.5,\nthe second GET_LOCK() releases the first lock (\'lock1\') and the second\nRELEASE_LOCK() returns NULL (failure) because there is no \'lock1\' to\nrelease.\n\nMySQL 5.7.5 and later enforces a maximum length on lock names of 64\ncharacters. Previously, no limit was enforced.\n\nLocks obtained with GET_LOCK() are not released when transactions\ncommit or roll back.\n\nGET_LOCK() can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked within one session, GET_LOCK() blocks any request by\nanother session for a lock with the same name. This enables clients\nthat agree on a given lock name to use the name to perform cooperative\nadvisory locking. But be aware that it also enables a client that is\nnot among the set of cooperating clients to lock a name, either\ninadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of\nthis is to use lock names that are database-specific or\napplication-specific. For example, use lock names of the form\ndb_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (398,23,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (399,32,'CURTIME','Syntax:\nCURTIME([fsp])\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext. The value is expressed in the current time zone.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (400,37,'ST_DIMENSION','ST_Dimension(g)\n\nReturns the inherent dimension of the geometry value g, or NULL if the\nargument is NULL. The dimension can be −1, 0, 1, or 2. The meaning of\nthese values is given in\nhttp://dev.mysql.com/doc/refman/5.7/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_Dimension(ST_GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------------+\n| ST_Dimension(ST_GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------------+\n| 1 |\n+------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (401,27,'SET','Syntax:\nSET variable = expr [, variable = expr] ...\n\nvariable: {\n user_var_name\n | param_name\n | local_var_name\n | {GLOBAL | @@global.} system_var_name\n | [SESSION | @@session. | @@] system_var_name\n}\n\nSET syntax for variable assignment enables you to assign values to\ndifferent types of variables that affect the operation of the server or\nclients:\n\no User-defined variables. See\n http://dev.mysql.com/doc/refman/5.7/en/user-variables.html.\n\no Stored procedure and function parameters, and stored program local\n variables. See\n http://dev.mysql.com/doc/refman/5.7/en/stored-program-variables.html.\n\no System variables. See\n http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n System variables also can be set at server startup, as described in\n http://dev.mysql.com/doc/refman/5.7/en/using-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-variable.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (402,7,'JSON_MERGE','Syntax:\nJSON_MERGE(json_doc, json_doc[, json_doc] ...)\n\nMerges two or more JSON documents. Synonym for JSON_MERGE_PRESERVE();\ndeprecated in MySQL 5.7.22 and subject to removal in a future release.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SELECT JSON_MERGE(\'[1, 2]\', \'[true, false]\');\n+---------------------------------------+\n| JSON_MERGE(\'[1, 2]\', \'[true, false]\') |\n+---------------------------------------+\n| [1, 2, true, false] |\n+---------------------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS\\G\n*************************** 1. row ***************************\n Level: Warning\n Code: 1287\nMessage: \'JSON_MERGE\' is deprecated and will be removed in a future release. \\\n Please use JSON_MERGE_PRESERVE/JSON_MERGE_PATCH instead\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (403,28,'LOAD XML','Syntax:\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'\']\n [IGNORE number {LINES | ROWS}]\n [(field_name_or_user_var\n [, field_name_or_user_var] ...)]\n [SET col_name={expr | DEFAULT},\n [, col_name={expr | DEFAULT}] ...]\n\nThe LOAD XML statement reads data from an XML file into a table. The\nfile_name must be given as a literal string. The tagname in the\noptional ROWS IDENTIFIED BY clause must also be given as a literal\nstring, and must be surrounded by angle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML\noutput mode (that is, starting the client with the --xml option). To\nwrite data from a table to an XML file, you can invoke the mysql client\nwith the --xml and -e options from the system shell, as shown here:\n\nshell> mysql --xml -e \'SELECT * FROM mydb.mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default,\nthe element is considered to be the equivalent of a database\ntable row; this can be changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\no Column names as attributes and column values as attribute values:\n\n\n\no Column names as tags and column values as the content of these tags:\n\n\n value1\n value2\n\n\no Column names are the name attributes of tags, and values are\n the contents of these tags:\n\n\n value1\n value2\n\n\n This is the format used by other MySQL tools, such as mysqldump.\n\nAll three formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it\ncorrectly. Tags are matched based on the tag or attribute name and the\ncolumn name.\n\nThe following clauses work essentially the same way for LOAD XML as\nthey do for LOAD DATA:\n\no LOW_PRIORITY or CONCURRENT\n\no LOCAL\n\no REPLACE or IGNORE\n\no CHARACTER SET\n\no SET\n\nSee [HELP LOAD DATA], for more information about these clauses.\n\n(field_name_or_user_var, ...) is a list of one or more comma-separated\nXML fields or user variables. The name of a user variable used for this\npurpose must match the name of a field from the XML file, prefixed with\n@. You can use field names to select only desired fields. User\nvariables can be employed to store the corresponding field values for\nsubsequent re-use.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first\nnumber rows in the XML file to be skipped. It is analogous to the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/load-xml.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/load-xml.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (404,3,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If from_base\nis a negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+X\'0a\',10,10);\n -> \'40\'\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (405,4,'ST_MPOINTFROMTEXT','ST_MPointFromText(wkt[, srid]), ST_MultiPointFromText(wkt[, srid])\n\nConstructs a MultiPoint value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nAs of MySQL 5.7.9, spatial functions such as ST_MPointFromText() and\nST_GeomFromText() that accept WKT-format representations of MultiPoint\nvalues permit individual points within values to be surrounded by\nparentheses. For example, both of the following function calls are\nvalid, whereas before MySQL 5.7.9 the second one produces an error:\n\nST_MPointFromText(\'MULTIPOINT (1 1, 2 2, 3 3)\')\nST_MPointFromText(\'MULTIPOINT ((1 1), (2 2), (3 3))\')\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (406,15,'ASSIGN-VALUE','Syntax:\n:=\n\nAssignment operator. Causes the user variable on the left hand side of\nthe operator to take on the value to its right. The value on the right\nhand side may be a literal value, another variable storing a value, or\nany legal expression that yields a scalar value, including the result\nof a query (provided that this value is a scalar value). You can\nperform multiple assignments in the same SET statement. You can perform\nmultiple assignments in the same statement.\n\nUnlike =, the := operator is never interpreted as a comparison\noperator. This means you can use := in any valid SQL statement (not\njust in SET statements) to assign a value to a variable.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n\nmysql> SELECT @var1:=COUNT(*) FROM t1;\n -> 4\nmysql> SELECT @var1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (407,27,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.7/en/table-cache.html. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database. The LIKE clause, if present, indicates which table\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-open-tables.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (408,32,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2009-07-02\');\n -> 2009\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n -> 200907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n -> FROM \'2003-01-02 10:30:00.000123\');\n -> 123\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (409,12,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument must be a string with at least two characters\nor the result will be NULL. If no salt argument is given, a random\nvalue is used.\n\n*Note*:\n\nThe ENCRYPT() function is deprecated as of MySQL 5.7.6, will be removed\nin a future MySQL release, and should no longer be used. For one-way\nhashing, consider using SHA2() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (410,27,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\n*Note*:\n\nAs of MySQL 5.7.6, the value of the show_compatibility_56 system\nvariable affects the information available from and privileges required\nfor the statement described here. For details, see the description of\nthat variable in\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nSHOW STATUS provides server status information (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html).\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\n\nStatus variable information is also available from these sources:\n\no Performance Schema tables. See\n http://dev.mysql.com/doc/refman/5.7/en/performance-schema-status-vari\n able-tables.html.\n\no The GLOBAL_STATUS and SESSION_STATUS tables. See\n http://dev.mysql.com/doc/refman/5.7/en/status-table.html.\n\no The mysqladmin extended-status command. See\n http://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html.\n\nFor SHOW STATUS, a LIKE clause, if present, indicates which variable\nnames to match. A WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nSHOW STATUS accepts an optional GLOBAL or SESSION variable scope\nmodifier:\n\no With a GLOBAL modifier, the statement displays the global status\n values. A global status variable may represent status for some aspect\n of the server itself (for example, Aborted_connects), or the\n aggregated status over all connections to MySQL (for example,\n Bytes_received and Bytes_sent). If a variable has no global value,\n the session value is displayed.\n\no With a SESSION modifier, the statement displays the status variable\n values for the current connection. If a variable has no session\n value, the global value is displayed. LOCAL is a synonym for SESSION.\n\no If no modifier is present, the default is SESSION.\n\nThe scope for each status variable is listed at\nhttp://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name | Value |\n+--------------------+----------+\n| Key_blocks_used | 14955 |\n| Key_read_requests | 96854827 |\n| Key_reads | 162040 |\n| Key_write_requests | 7589728 |\n| Key_writes | 3813196 |\n+--------------------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-status.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (411,2,'ST_NUMINTERIORRINGS','ST_NumInteriorRing(poly), ST_NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly. If the\nargument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_NumInteriorRings(ST_GeomFromText(@poly));\n+---------------------------------------------+\n| ST_NumInteriorRings(ST_GeomFromText(@poly)) |\n+---------------------------------------------+\n| 1 |\n+---------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (412,7,'JSON_KEYS','Syntax:\nJSON_KEYS(json_doc[, path])\n\nReturns the keys from the top-level value of a JSON object as a JSON\narray, or, if a path argument is given, the top-level keys from the\nselected path. Returns NULL if any argument is NULL, the json_doc\nargument is not an object, or path, if given, does not locate an\nobject. An error occurs if the json_doc argument is not a valid JSON\ndocument or the path argument is not a valid path expression or\ncontains a * or ** wildcard.\n\nThe result array is empty if the selected object is empty. If the\ntop-level value has nested subobjects, the return value does not\ninclude keys from those subobjects.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\');\n+---------------------------------------+\n| JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\') |\n+---------------------------------------+\n| ["a", "b"] |\n+---------------------------------------+\nmysql> SELECT JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\', \'$.b\');\n+----------------------------------------------+\n| JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\', \'$.b\') |\n+----------------------------------------------+\n| ["c"] |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (413,14,'INET6_ATON','Syntax:\nINET6_ATON(expr)\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary\nstring that represents the numeric value of the address in network byte\norder (big endian). Because numeric-format IPv6 addresses require more\nbytes than the largest integer type, the representation returned by\nthis function has the VARBINARY data type: VARBINARY(16) for IPv6\naddresses and VARBINARY(4) for IPv4 addresses. If the argument is not a\nvalid address, INET6_ATON() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT HEX(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'FDFE0000000000005A55CAFFFEFA9089\'\nmysql> SELECT HEX(INET6_ATON(\'10.0.5.9\'));\n -> \'0A000509\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (414,27,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster.\n\nSHOW SLAVE HOSTS should be executed on a server that acts as a\nreplication master. The statement displays information about servers\nthat are or have been connected as replication slaves, with each row of\nthe result corresponding to one slave server, as shown here:\n\nmysql> SHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+--------------------------------------+\n| Server_id | Host | Port | Master_id | Slave_UUID |\n+------------+-----------+------+-----------+--------------------------------------+\n| 192168010 | iconnect2 | 3306 | 192168011 | 14cb6624-7f93-11e0-b2c0-c80aa9429562 |\n| 1921680101 | athena | 3306 | 192168011 | 07af4990-f41f-11df-a566-7ac56fdaf645 |\n+------------+-----------+------+-----------+--------------------------------------+\n\no Server_id: The unique server ID of the slave server, as configured in\n the slave server\'s option file, or on the command line with\n --server-id=value.\n\no Host: The host name of the slave server as specified on the slave\n with the --report-host option. This can differ from the machine name\n as configured in the operating system.\n\no User: The slave server user name as, specified on the slave with the\n --report-user option. Statement output includes this column only if\n the master server is started with the --show-slave-auth-info option.\n\no Password: The slave server password as, specified on the slave with\n the --report-password option. Statement output includes this column\n only if the master server is started with the --show-slave-auth-info\n option.\n\no Port: The port on the master to which the slave server is listening,\n as specified on the slave with the --report-port option.\n\n A zero in this column means that the slave port (--report-port) was\n not set.\n\no Master_id: The unique server ID of the master server that the slave\n server is replicating from. This is the server ID of the server on\n which SHOW SLAVE HOSTS is executed, so this same value is listed for\n each row in the result.\n\no Slave_UUID: The globally unique ID of this slave, as generated on the\n slave and found in the slave\'s auto.cnf file.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-slave-hosts.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (415,8,'START TRANSACTION','Syntax:\nSTART TRANSACTION\n [transaction_characteristic [, transaction_characteristic] ...]\n\ntransaction_characteristic: {\n WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n}\n\nBEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThese statements provide control over use of transactions:\n\no START TRANSACTION or BEGIN start a new transaction.\n\no COMMIT commits the current transaction, making its changes permanent.\n\no ROLLBACK rolls back the current transaction, canceling its changes.\n\no SET autocommit disables or enables the default autocommit mode for\n the current session.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. The change cannot be\nrolled back.\n\nTo disable autocommit mode implicitly for a single series of\nstatements, use the START TRANSACTION statement:\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nWith START TRANSACTION, autocommit remains disabled until you end the\ntransaction with COMMIT or ROLLBACK. The autocommit mode then reverts\nto its previous state.\n\nSTART TRANSACTION permits several modifiers that control transaction\ncharacteristics. To specify multiple modifiers, separate them by\ncommas.\n\no The WITH CONSISTENT SNAPSHOT modifier starts a consistent read for\n storage engines that are capable of it. This applies only to InnoDB.\n The effect is the same as issuing a START TRANSACTION followed by a\n SELECT from any InnoDB table. See\n http://dev.mysql.com/doc/refman/5.7/en/innodb-consistent-read.html.\n The WITH CONSISTENT SNAPSHOT modifier does not change the current\n transaction isolation level, so it provides a consistent snapshot\n only if the current isolation level is one that permits a consistent\n read. The only isolation level that permits a consistent read is\n REPEATABLE READ. For all other isolation levels, the WITH CONSISTENT\n SNAPSHOT clause is ignored. As of MySQL 5.7.2, a warning is generated\n when the WITH CONSISTENT SNAPSHOT clause is ignored.\n\no The READ WRITE and READ ONLY modifiers set the transaction access\n mode. They permit or prohibit changes to tables used in the\n transaction. The READ ONLY restriction prevents the transaction from\n modifying or locking both transactional and nontransactional tables\n that are visible to other transactions; the transaction can still\n modify or lock temporary tables.\n\n MySQL enables extra optimizations for queries on InnoDB tables when\n the transaction is known to be read-only. Specifying READ ONLY\n ensures these optimizations are applied in cases where the read-only\n status cannot be determined automatically. See\n http://dev.mysql.com/doc/refman/5.7/en/innodb-performance-ro-txn.html\n for more information.\n\n If no access mode is specified, the default mode applies. Unless the\n default has been changed, it is read/write. It is not permitted to\n specify both READ WRITE and READ ONLY in the same statement.\n\n In read-only mode, it remains possible to change tables created with\n the TEMPORARY keyword using DML statements. Changes made with DDL\n statements are not permitted, just as with permanent tables.\n\n For additional information about transaction access mode, including\n ways to change the default mode, see [HELP ISOLATION].\n\n If the read_only system variable is enabled, explicitly starting a\n transaction with START TRANSACTION READ WRITE requires the SUPER\n privilege.\n\n*Important*:\n\nMany APIs used for writing MySQL client applications (such as JDBC)\nprovide their own methods for starting transactions that can (and\nsometimes should) be used instead of sending a START TRANSACTION\nstatement from the client. See\nhttp://dev.mysql.com/doc/refman/5.7/en/connectors-apis.html, or the\ndocumentation for your API, for more information.\n\nTo disable autocommit mode explicitly, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDB) are not made permanent immediately. You must use COMMIT to store\nyour changes to disk or ROLLBACK to ignore the changes.\n\nautocommit is a session variable and must be set for each session. To\ndisable autocommit mode for each new connection, see the description of\nthe autocommit system variable at\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nBEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for\ninitiating a transaction. START TRANSACTION is standard SQL syntax, is\nthe recommended way to start an ad-hoc transaction, and permits\nmodifiers that BEGIN does not.\n\nThe BEGIN statement differs from the use of the BEGIN keyword that\nstarts a BEGIN ... END compound statement. The latter does not begin a\ntransaction. See [HELP BEGIN END].\n\n*Note*:\n\nWithin all stored programs (stored procedures and functions, triggers,\nand events), the parser treats BEGIN [WORK] as the beginning of a BEGIN\n... END block. Begin a transaction in this context with START\nTRANSACTION instead.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The new transaction also uses the\nsame access mode (READ WRITE or READ ONLY) as the just-terminated\ntransaction. The RELEASE clause causes the server to disconnect the\ncurrent client session after terminating the current transaction.\nIncluding the NO keyword suppresses CHAIN or RELEASE completion, which\ncan be useful if the completion_type system variable is set to cause\nchaining or release completion by default.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/commit.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/commit.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (416,32,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (417,40,'CREATE DATABASE','Syntax:\nCREATE {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\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-database.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (418,16,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nIf there are no matching rows, VAR_POP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (419,38,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (420,23,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 − 1) characters.\nThe effective maximum length is less if the value contains multibyte\ncharacters. Each TEXT value is stored using a 2-byte length prefix that\nindicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (421,19,'~','Syntax:\n~\n\nInvert all bits.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (422,3,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (423,17,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nROW_COUNT() returns a value as follows:\n\no DDL statements: 0. This applies to statements such as CREATE TABLE or\n DROP TABLE.\n\no DML statements other than SELECT: The number of affected rows. This\n applies to statements such as UPDATE, INSERT, or DELETE (as before),\n but now also to statements such as ALTER TABLE and LOAD DATA INFILE.\n\no SELECT: -1 if the statement returns a result set, or the number of\n rows "affected" if it does not. For example, for SELECT * FROM t1,\n ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE\n \'file_name\', ROW_COUNT() returns the number of rows written to the\n file.\n\no SIGNAL statements: 0.\n\nFor UPDATE statements, the affected-rows value by default is the number\nof rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() when connecting to mysqld, the affected-rows value\nis the number of rows "found"; that is, matched by the WHERE clause.\n\nFor REPLACE statements, the affected-rows value is 2 if the new row\nreplaced an old row, because in this case, one row was inserted after\nthe duplicate was deleted.\n\nFor INSERT ... ON DUPLICATE KEY UPDATE statements, the affected-rows\nvalue per row is 1 if the row is inserted as a new row, 2 if an\nexisting row is updated, and 0 if an existing row is set to its current\nvalues. If you specify the CLIENT_FOUND_ROWS flag, the affected-rows\nvalue is 1 (not 0) if an existing row is set to its current values.\n\nThe ROW_COUNT() value is similar to the value from the\nmysql_affected_rows() C API function and the row count that the mysql\nclient displays following statement execution.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (424,7,'MBRCOVEREDBY','MBRCoveredBy(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\nis covered by the minimum bounding rectangle of g2. This tests the\nopposite relationship as MBRCovers().\n\nMBRCoveredBy() handles its arguments as follows:\n\no If either argument is NULL or an empty geometry, the return value is\n NULL.\n\no If either argument is not a syntactically well-formed geometry byte\n string, an ER_GIS_INVALID_DATA error occurs.\n\no Otherwise, the return value is non-NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRCovers(@g1,@g2), MBRCoveredby(@g1,@g2);\n+--------------------+-----------------------+\n| MBRCovers(@g1,@g2) | MBRCoveredby(@g1,@g2) |\n+--------------------+-----------------------+\n| 1 | 0 |\n+--------------------+-----------------------+\nmysql> SELECT MBRCovers(@g2,@g1), MBRCoveredby(@g2,@g1);\n+--------------------+-----------------------+\n| MBRCovers(@g2,@g1) | MBRCoveredby(@g2,@g1) |\n+--------------------+-----------------------+\n| 0 | 1 |\n+--------------------+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (425,3,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n -> -1\nmysql> SELECT SIGN(0);\n -> 0\nmysql> SELECT SIGN(234);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (426,23,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Permissible values\nare -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.7/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (427,17,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (428,7,'ASYMMETRIC_VERIFY','Syntax:\nASYMMETRIC_VERIFY(algorithm, digest_str, sig_str, pub_key_str,\ndigest_type)\n\nVerifies whether the signature string matches the digest string, and\nreturns 1 or 0 to indicate whether verification succeeded or failed.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\nsig_str is the signature string. It can be generated by calling\nASYMMETRIC_SIGN().\n\npub_key_str is the public key string of the signer. It corresponds to\nthe private key passed to ASYMMETRIC_SIGN() to generate the signature\nstring and must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','-- Set the encryption algorithm and digest type\nSET @algo = \'RSA\';\nSET @dig_type = \'SHA224\';\n\n-- Create private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(@algo, 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(@algo, @priv);\n\n-- Generate digest from string\nSET @dig = CREATE_DIGEST(@dig_type, \'The quick brown fox\');\n\n-- Generate signature for digest and verify signature against digest\nSET @sig = ASYMMETRIC_SIGN(@algo, @dig, @priv, @dig_type);\nSET @verf = ASYMMETRIC_VERIFY(@algo, @dig, @sig, @pub, @dig_type);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (429,32,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\n\nThe second form enables the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (430,7,'JSON_CONTAINS','Syntax:\nJSON_CONTAINS(target, candidate[, path])\n\nIndicates by returning 1 or 0 whether a given candidate JSON document\nis contained within a target JSON document, or---if a path argument was\nsupplied---whether the candidate is found at a specific path within the\ntarget. Returns NULL if any argument is NULL, or if the path argument\ndoes not identify a section of the target document. An error occurs if\ntarget or candidate is not a valid JSON document, or if the path\nargument is not a valid path expression or contains a * or ** wildcard.\n\nTo check only whether any data exists at the path, use\nJSON_CONTAINS_PATH() instead.\n\nThe following rules define containment:\n\no A candidate scalar is contained in a target scalar if and only if\n they are comparable and are equal. Two scalar values are comparable\n if they have the same JSON_TYPE() types, with the exception that\n values of types INTEGER and DECIMAL are also comparable to each\n other.\n\no A candidate array is contained in a target array if and only if every\n element in the candidate is contained in some element of the target.\n\no A candidate nonarray is contained in a target array if and only if\n the candidate is contained in some element of the target.\n\no A candidate object is contained in a target object if and only if for\n each key in the candidate there is a key with the same name in the\n target and the value associated with the candidate key is contained\n in the value associated with the target key.\n\nOtherwise, the candidate value is not contained in the target document.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SET @j = \'{"a": 1, "b": 2, "c": {"d": 4}}\';\nmysql> SET @j2 = \'1\';\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.a\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.a\') |\n+-------------------------------+\n| 1 |\n+-------------------------------+\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.b\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.b\') |\n+-------------------------------+\n| 0 |\n+-------------------------------+\n\nmysql> SET @j2 = \'{"d": 4}\';\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.a\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.a\') |\n+-------------------------------+\n| 0 |\n+-------------------------------+\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.c\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.c\') |\n+-------------------------------+\n| 1 |\n+-------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (431,32,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (432,3,'%','Syntax:\nN % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (433,33,'ASTEXT','AsText(g), AsWKT(g)\n\nST_AsText(), ST_AsWKT(), AsText(), and AsWKT() are synonyms. For more\ninformation, see the description of ST_AsText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (434,24,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n\nThe DECLARE ... CONDITION statement declares a named error condition,\nassociating a name with a condition that needs specific handling. The\nname can be referred to in a subsequent DECLARE ... HANDLER statement\n(see [HELP DECLARE HANDLER]).\n\nCondition declarations must appear before cursor or handler\ndeclarations.\n\nThe condition_value for DECLARE ... CONDITION indicates the specific\ncondition or class of conditions to associate with the condition name.\nIt can take the following forms:\n\no mysql_error_code: An integer literal indicating a MySQL error code.\n\n Do not use MySQL error code 0 because that indicates success rather\n than an error condition. For a list of MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html.\n\no SQLSTATE [VALUE] sqlstate_value: A 5-character string literal\n indicating an SQLSTATE value.\n\n Do not use SQLSTATE values that begin with \'00\' because those\n indicate success rather than an error condition. For a list of\n SQLSTATE values, see\n http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html.\n\nCondition names referred to in SIGNAL or use RESIGNAL statements must\nbe associated with SQLSTATE values, not MySQL error codes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/declare-condition.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (435,32,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.7/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n -> \'February\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (436,26,'NUMGEOMETRIES','NumGeometries(gc)\n\nST_NumGeometries() and NumGeometries() are synonyms. For more\ninformation, see the description of ST_NumGeometries().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (437,8,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ... [ channel_option ]\n\noption:\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\n | MASTER_RETRY_COUNT = count\n | MASTER_DELAY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | MASTER_AUTO_POSITION = {0|1}\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | MASTER_TLS_VERSION = \'protocol_list\'\n | IGNORE_SERVER_IDS = (server_id_list)\n\nchannel_option:\n FOR CHANNEL channel\n\nserver_id_list:\n [server_id [, server_id] ... ]\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the master\ninfo and relay log info repositories (see\nhttp://dev.mysql.com/doc/refman/5.7/en/slave-logs.html). CHANGE MASTER\nTO requires the SUPER privilege.\n\nPrior to MySQL 5.7.4, the slave replication threads must be stopped,\nusing STOP SLAVE if necessary, before issuing this statement. In MySQL\n5.7.4 and later, you can issue CHANGE MASTER TO statements on a running\nslave without doing this, depending on the states of the slave SQL\nthread and slave I/O thread. The rules governing such use are provided\nlater in this section.\n\nWhen using a multithreaded slave (in other words slave_parallel_workers\nis greater than 0), stopping the slave can cause "gaps" in the sequence\nof transactions that have been executed from the relay log, regardless\nof whether the slave was stopped intentionally or otherwise. When such\ngaps exist, issuing CHANGE MASTER TO fails. The solution in this\nsituation is to issue START SLAVE UNTIL SQL_AFTER_MTS_GAPS which\nensures that the gaps are closed.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the CHANGE MASTER TO statement to a specific\nreplication channel, and is used to add a new channel or modify an\nexisting channel. For example, to add a new channel called channel2:\n\nCHANGE MASTER TO MASTER_HOST=host1, MASTER_PORT=3002 FOR CHANNEL \'channel2\'\n\nIf no clause is named and no extra channels exist, the statement\napplies to the default channel.\n\nWhen using multiple replication channels, if a CHANGE MASTER TO\nstatement does not name a channel using a FOR CHANNEL channel clause,\nan error occurs. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, issue this statement to tell the slave\nabout the new password:\n\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n master host and its TCP/IP port.\n\n *Note*:\n\n Replication cannot use Unix socket files. You must be able to connect\n to the master MySQL server using TCP/IP.\n\n If you specify the MASTER_HOST or MASTER_PORT option, the slave\n assumes that the master server is different from before (even if the\n option value is the same as its current value.) In this case, the old\n values for the master binary log file name and position are\n considered no longer applicable, so if you do not specify\n MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n empty string) is not the same as not setting MASTER_HOST at all.\n Beginning with MySQL 5.5, trying to set MASTER_HOST to an empty\n string fails with an error. Previously, setting MASTER_HOST to an\n empty string caused START SLAVE subsequently to fail. (Bug #28796)\n\n Values used for MASTER_HOST and other CHANGE MASTER TO options are\n checked for linefeed (\\n or 0x0A) characters; the presence of such\n characters in these values causes the statement to fail with\n ER_MASTER_INFO. (Bug #11758581, Bug #50801)\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n account to use for connecting to the master.\n\n MASTER_USER cannot be made empty; setting MASTER_USER = \'\' or leaving\n it unset when setting a value for MASTER_PASSWORD causes an error\n (Bug #13427949).\n\n The password used for a MySQL Replication slave account in a CHANGE\n MASTER TO statement is limited to 32 characters in length; prior to\n MySQL 5.7.5, if the password was longer, the statement succeeded, but\n any excess characters were silently truncated. In MySQL 5.7.5 and\n later, trying to use a password of more than 32 characters causes\n CHANGE MASTER TO to fail. (Bug #11752299, Bug #43439)\n\n The text of a running CHANGE MASTER TO statement, including values\n for MASTER_USER and MASTER_PASSWORD, can be seen in the output of a\n concurrent SHOW PROCESSLIST statement. (The complete text of a START\n SLAVE statement is also visible to SHOW PROCESSLIST.)\n\nThe MASTER_SSL_xxx options, and the MASTER_TLS_VERSION option, specify\nhow the slave uses encryption and ciphers to secure the replication\nconnection. These options can be changed even on slaves that are\ncompiled without SSL support. They are saved to the master info\nrepository, but are ignored if the slave does not have SSL support\nenabled. The MASTER_SSL_xxx options perform the same functions as the\n--ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-options.htm\nl. The correspondence between the two sets of options, and the use of\nthe MASTER_SSL_xxx and MASTER_TLS_VERSION options to set up a secure\nconnection, is explained in\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-solutions-encrypted-\nconnections.html.\n\nAs of MySQL 5.7.3, setting MASTER_SSL=1 means that the slave connection\nto the master must use SSL, or the connection attempt fails. Before\n5.7.3, the use of an SSL connection by the slave was not enforced with\nMASTER_SSL=1. This is analogous to the client-side meaning of the --ssl\ncommand-line option; see\nhttp://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-options.htm\nl.\n\nMASTER_CONNECT_RETRY specifies how many seconds to wait between connect\nretries. The default is 60.\n\nMASTER_RETRY_COUNT limits the number of reconnection attempts and\nupdates the value of the Master_Retry_Count column in the output of\nSHOW SLAVE STATUS. The default value is 24 * 3600 = 86400.\nMASTER_RETRY_COUNT is intended to replace the older\n--master-retry-count server option, and is now the preferred method for\nsetting this limit. You are encouraged not to rely on\n--master-retry-count in new applications and, when upgrading from\nversions earlier than MySQL 5.6, to update any existing applications\nthat rely on it, so that they use CHANGE MASTER TO ...\nMASTER_RETRY_COUNT instead.\n\nMASTER_DELAY specifies how many seconds behind the master the slave\nmust lag. An event received from the master is not executed until at\nleast interval seconds later than its execution on the master. The\ndefault is 0. An error occurs if interval is not a nonnegative integer\nin the range from 0 to 231−1. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-delayed.html.\n\nFrom MySQL 5.7, a CHANGE MASTER TO statement employing the MASTER_DELAY\noption can be executed on a running slave when the slave SQL thread is\nstopped.\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master.\n\nThe address configured with this option, if any, can be seen in the\nMaster_Bind column of the output from SHOW SLAVE STATUS. If you are\nusing slave status log tables (server started with\n--master-info-repository=TABLE), the value can also be seen as the\nMaster_bind column of the mysql.slave_master_info table.\n\nThe ability to bind a replication slave to a specific network interface\nis also supported by NDB Cluster.\n\nMASTER_HEARTBEAT_PERIOD sets the interval in seconds between\nreplication heartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is reset.\ninterval is a decimal value having the range 0 to 4294967 seconds and a\nresolution in milliseconds; the smallest nonzero value is 0.001.\nHeartbeats are sent by the master only if there are no unsent events in\nthe binary log file for a period longer than interval.\n\nPrior to MySQL 5.7.4, not including MASTER_HEARTBEAT_PERIOD caused\nCHANGE MASTER TO to reset the heartbeat period (Slave_heartbeat_period)\nto the default, and Slave_received_heartbeats to 0. (Bug #18185490)\n\nIf you are logging master connection information to tables,\nMASTER_HEARTBEAT_PERIOD can be seen as the value of the Heartbeat\ncolumn of the mysql.slave_master_info table.\n\nSetting interval to 0 disables heartbeats altogether. The default value\nfor interval is equal to the value of slave_net_timeout divided by 2.\n\nSetting @@global.slave_net_timeout to a value less than that of the\ncurrent heartbeat interval results in a warning being issued. The\neffect of issuing RESET SLAVE on the heartbeat interval is to reset it\nto the default value.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIf you specify either of MASTER_LOG_FILE or MASTER_LOG_POS, you also\ncannot specify MASTER_AUTO_POSITION = 1 (described later in this\nsection). If neither of MASTER_LOG_FILE or MASTER_LOG_POS is specified,\nthe slave uses the last coordinates of the slave SQL thread before\nCHANGE MASTER TO was issued. This ensures that there is no\ndiscontinuity in replication, even if the slave SQL thread was late\ncompared to the slave I/O thread, when you merely want to change, say,\nthe password to use.\n\nFrom MySQL 5.7, a CHANGE MASTER TO statement employing RELAY_LOG_FILE,\nRELAY_LOG_POS, or both options can be executed on a running slave when\nthe slave SQL thread is stopped. Prior to MySQL 5.7.4, CHANGE MASTER TO\ndeletes all relay log files and starts a new one, unless you specify\nRELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay log files are\nkept; the relay_log_purge global variable is set silently to 0. In\nMySQL 5.7.4 and later, relay logs are preserved if at least one of the\nslave SQL thread and the slave I/O thread is running; if both threads\nare stopped, all relay log files are deleted unless at least one of\nRELAY_LOG_FILE or RELAY_LOG_POS is specified.\n\nRELAY_LOG_FILE can use either an absolute or relative path, and uses\nthe same base name as MASTER_LOG_FILE. (Bug #12190)\n\nWhen MASTER_AUTO_POSITION = 1 is used with CHANGE MASTER TO, the slave\nattempts to connect to the master using the GTID-based replication\nprotocol. From MySQL 5.7, this option can be employed by CHANGE MASTER\nTO only if both the slave SQL and slave I/O threads are stopped. Both\nthe slave and the master must have GTIDs enabled (GTID_MODE=ON,\nON_PERMISSIVE, or OFF_PERMISSIVE on the slave, and GTID_MODE=ON on the\nmaster). Auto-positioning is used for the connection, so the\ncoordinates represented by MASTER_LOG_FILE and MASTER_LOG_POS are not\nused, and the use of either or both of these options together with\nMASTER_AUTO_POSITION = 1 causes an error. If multi-source replication\nis enabled on the slave, you need to set the MASTER_AUTO_POSITION = 1\noption for each applicable replication channel.\n\nWith MASTER_AUTO_POSITION = 1 set, in the initial connection handshake,\nthe slave sends a GTID set containing the transactions that it has\nalready received, committed, or both. The master responds by sending\nall transactions recorded in its binary log whose GTID is not included\nin the GTID set sent by the slave. This exchange ensures that the\nmaster only sends the transactions with a GTID that the slave has not\nalready recorded or committed. If the slave receives transactions from\nmore than one master, as in the case of a diamond topology, the\nauto-skip function ensures that the transactions are not applied twice.\nFor details of how the GTID set sent by the slave is computed, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-auto-positioni\nng.html.\n\nIf any of the transactions that should be sent by the master have been\npurged from the master\'s binary log, or added to the set of GTIDs in\nthe gtid_purged system variable by another method, the master sends the\nerror ER_MASTER_HAS_PURGED_REQUIRED_GTIDS to the slave, and replication\ndoes not start. Also, if during the exchange of transactions it is\nfound that the slave has recorded or committed transactions with the\nmaster\'s UUID in the GTID, but the master itself has not committed\nthem, the master sends the error ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER to\nthe slave and replication does not start. For information on how to\nhandle these situations, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-auto-positioni\nng.html.\n\nYou can see whether replication is running with auto-positioning\nenabled by checking the Performance Schema\nreplication_connection_status table or the output of SHOW SLAVE STATUS.\nDisabling the MASTER_AUTO_POSITION option again makes the slave revert\nto file-based replication, in which case you must also specify one or\nboth of the MASTER_LOG_FILE or MASTER_LOG_POS options.\n\nIGNORE_SERVER_IDS takes a comma-separated list of 0 or more server IDs.\nEvents originating from the corresponding servers are ignored, with the\nexception of log rotation and deletion events, which are still recorded\nin the relay log.\n\nIn circular replication, the originating server normally acts as the\nterminator of its own events, so that they are not applied more than\nonce. Thus, this option is useful in circular replication when one of\nthe servers in the circle is removed. Suppose that you have a circular\nreplication setup with 4 servers, having server IDs 1, 2, 3, and 4, and\nserver 3 fails. When bridging the gap by starting replication from\nserver 2 to server 4, you can include IGNORE_SERVER_IDS = (3) in the\nCHANGE MASTER TO statement that you issue on server 4 to tell it to use\nserver 2 as its master instead of server 3. Doing so causes it to\nignore and not to propagate any statements that originated with the\nserver that is no longer in use.\n\nIf a CHANGE MASTER TO statement is issued without any IGNORE_SERVER_IDS\noption, any existing list is preserved. To clear the list of ignored\nservers, it is necessary to use the option with an empty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\n\nPrior to MySQL 5.7.5, RESET SLAVE ALL has no effect on the server ID\nlist. In MySQL 5.7.5 and later, RESET SLAVE ALL clears\nIGNORE_SERVER_IDS. (Bug #18816897)\n\nIf IGNORE_SERVER_IDS contains the server\'s own ID and the server was\nstarted with the --replicate-same-server-id option enabled, an error\nresults.\n\nThe master info repository and the output of SHOW SLAVE STATUS provide\nthe list of servers that are currently ignored. For more information,\nsee http://dev.mysql.com/doc/refman/5.7/en/slave-logs-status.html, and\n[HELP SHOW SLAVE STATUS].\n\nInvoking CHANGE MASTER TO causes the previous values for MASTER_HOST,\nMASTER_PORT, MASTER_LOG_FILE, and MASTER_LOG_POS to be written to the\nerror log, along with other information about the slave\'s state prior\nto execution.\n\nCHANGE MASTER TO causes an implicit commit of an ongoing transaction.\nSee http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nIn MySQL 5.7.4 and later, the strict requirement to execute STOP SLAVE\nprior to issuing any CHANGE MASTER TO statement (and START SLAVE\nafterward) is removed. Instead of depending on whether the slave is\nstopped, the behavior of CHANGE MASTER TO depends (in MySQL 5.7.4 and\nlater) on the states of the slave SQL thread and slave I/O threads;\nwhich of these threads is stopped or running now determines the options\nthat can or cannot be used with a CHANGE MASTER TO statement at a given\npoint in time. The rules for making this determination are listed here:\n\no If the SQL thread is stopped, you can execute CHANGE MASTER TO using\n any combination that is otherwise allowed of RELAY_LOG_FILE,\n RELAY_LOG_POS, and MASTER_DELAY options, even if the slave I/O thread\n is running. No other options may be used with this statement when the\n I/O thread is running.\n\no If the I/O thread is stopped, you can execute CHANGE MASTER TO using\n any of the options for this statement (in any allowed combination)\n except RELAY_LOG_FILE, RELAY_LOG_POS, or MASTER_DELAY, even when the\n SQL thread is running. These three options may not be used when the\n I/O thread is running.\n\no Both the SQL thread and the I/O thread must be stopped before issuing\n a CHANGE MASTER TO statement that employs MASTER_AUTO_POSITION = 1.\n\nYou can check the current state of the slave SQL and I/O threads using\nSHOW SLAVE STATUS.\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-solutions-switch.htm\nl.\n\nIf you are using statement-based replication and temporary tables, it\nis possible for a CHANGE MASTER TO statement following a STOP SLAVE\nstatement to leave behind temporary tables on the slave. From MySQL\n5.7, a warning (ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO) is issued\nwhenever this occurs. You can avoid this in such cases by making sure\nthat the value of the Slave_open_temp_tables system status variable is\nequal to 0 prior to executing such a CHANGE MASTER TO statement.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it with the master, you can\nrun CHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos\non the slave to specify the coordinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.example.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'password\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/change-master-to.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (438,32,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (439,40,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*:\n\nWhen a database is dropped, privileges granted specifically for the\ndatabase are not automatically dropped. They must be dropped manually.\nSee [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-database.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (440,27,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement displays the privileges that are assigned to a MySQL\nuser account, in the form of GRANT statements that must be executed to\nduplicate the privilege assignments.\n\n*Note*:\n\nTo display nonprivilege information for MySQL accounts, use the SHOW\nCREATE USER statement. See [HELP SHOW CREATE USER].\n\nSHOW GRANTS requires the SELECT privilege for the mysql system\ndatabase, except to display privileges for the current user.\n\nTo name the account for SHOW GRANTS, use the same format as for the\nGRANT statement; for example, \'jeffrey\'@\'localhost\':\n\nmysql> SHOW GRANTS FOR \'jeffrey\'@\'localhost\';\n+------------------------------------------------------------------+\n| Grants for jeffrey@localhost |\n+------------------------------------------------------------------+\n| GRANT USAGE ON *.* TO `jeffrey`@`localhost` |\n| GRANT SELECT, INSERT, UPDATE ON `db1`.* TO `jeffrey`@`localhost` |\n+------------------------------------------------------------------+\n\nThe host part, if omitted, defaults to \'%\'. For additional information\nabout specifying account names, see\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html.\n\nTo display the privileges granted to the current user (the account you\nare using to connect to the server), you can use any of the following\nstatements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is\nused in definer context, such as within a stored procedure that\nexecutes with definer rather than invoker privileges, the grants\ndisplayed are those of the definer and not the invoker.\n\nSHOW GRANTS does not display privileges that are available to the named\naccount but are granted to a different account. For example, if an\nanonymous account exists, the named account might be able to use its\nprivileges, but SHOW GRANTS does not display them.\n\nSHOW GRANTS output does not include IDENTIFIED BY PASSWORD clauses. Use\nthe SHOW CREATE USER statement instead. See [HELP SHOW CREATE USER].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-grants.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (441,7,'JSON_CONTAINS_PATH','Syntax:\nJSON_CONTAINS_PATH(json_doc, one_or_all, path[, path] ...)\n\nReturns 0 or 1 to indicate whether a JSON document contains data at a\ngiven path or paths. Returns NULL if any argument is NULL. An error\noccurs if the json_doc argument is not a valid JSON document, any path\nargument is not a valid path expression, or one_or_all is not \'one\' or\n\'all\'.\n\nTo check for a specific value at a path, use JSON_CONTAINS() instead.\n\nThe return value is 0 if no specified path exists within the document.\nOtherwise, the return value depends on the one_or_all argument:\n\no \'one\': 1 if at least one path exists within the document, 0\n otherwise.\n\no \'all\': 1 if all paths exist within the document, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SET @j = \'{"a": 1, "b": 2, "c": {"d": 4}}\';\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'one\', \'$.a\', \'$.e\');\n+---------------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'one\', \'$.a\', \'$.e\') |\n+---------------------------------------------+\n| 1 |\n+---------------------------------------------+\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'all\', \'$.a\', \'$.e\');\n+---------------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'all\', \'$.a\', \'$.e\') |\n+---------------------------------------------+\n| 0 |\n+---------------------------------------------+\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'one\', \'$.c.d\');\n+----------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'one\', \'$.c.d\') |\n+----------------------------------------+\n| 1 |\n+----------------------------------------+\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'one\', \'$.a.d\');\n+----------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'one\', \'$.a.d\') |\n+----------------------------------------+\n| 0 |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (442,33,'ST_MPOINTFROMWKB','ST_MPointFromWKB(wkb[, srid]), ST_MultiPointFromWKB(wkb[, srid])\n\nConstructs a MultiPoint value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (443,3,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n -> 2501908538\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (444,13,'STARTPOINT','StartPoint(ls)\n\nST_StartPoint() and StartPoint() are synonyms. For more information,\nsee the description of ST_StartPoint().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (445,24,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement declares local variables within stored programs. To\nprovide a default value for a variable, include a DEFAULT clause. The\nvalue can be specified as an expression; it need not be a constant. If\nthe DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nVariable declarations must appear before cursor or handler\ndeclarations.\n\nLocal variable names are not case-sensitive. Permissible characters and\nquoting rules are the same as for other identifiers, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/identifiers.html.\n\nThe scope of a local variable is the BEGIN ... END block within which\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nFor examples of variable declarations, see\nhttp://dev.mysql.com/doc/refman/5.7/en/local-variable-scope.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (446,4,'MPOLYFROMTEXT','MPolyFromText(wkt[, srid]), MultiPolygonFromText(wkt[, srid])\n\nST_MPolyFromText(), ST_MultiPolygonFromText(), MPolyFromText(), and\nMultiPolygonFromText() are synonyms. For more information, see the\ndescription of ST_MPolyFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (447,20,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (448,32,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The year in the result may be\ndifferent from the year in the date argument for the first and the last\nweek of the year.\n\nThe mode argument works exactly like the mode argument to WEEK(). For\nthe single-argument syntax, a mode value of 0 is used. Unlike WEEK(),\nthe value of default_week_format does not influence YEARWEEK().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n -> 198652\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (449,16,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_OR() returns a neutral value (all\nbits set to 0).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (450,3,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X. If X is less than or equal to\n0.0E0, the function returns NULL and (as of MySQL 5.7.4) a warning\n"Invalid argument for logarithm" is reported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n -> 0.30102999566398\nmysql> SELECT LOG10(100);\n -> 2\nmysql> SELECT LOG10(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (451,23,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the - sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (452,40,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-function.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (453,20,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (454,12,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a string of 32 hexadecimal digits, or NULL if the argument\nwas NULL. The return value can, for example, be used as a hash key. See\nthe notes at the beginning of this section about storing hash values\nefficiently.\n\nThe return value is a string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (455,32,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (456,32,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC). The return value is an integer if no\nargument is given or the argument does not include a fractional seconds\npart, or DECIMAL if an argument is given that includes a fractional\nseconds part.\n\nIf UNIX_TIMESTAMP() is called with a date argument, it returns the\nvalue of the argument as seconds since \'1970-01-01 00:00:00\' UTC. The\ndate argument may be a DATE, DATETIME, or TIMESTAMP string, or a number\nin YYMMDD, YYMMDDHHMMSS, YYYYMMDD, or YYYYMMDDHHMMSS format. If the\nargument includes a time part, it may optionally include a fractional\nseconds part. The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n -> 1447431666\nmysql> SELECT UNIX_TIMESTAMP(\'2015-11-13 10:20:19\');\n -> 1447431619\nmysql> SELECT UNIX_TIMESTAMP(\'2015-11-13 10:20:19.012\');\n -> 1447431619.012\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (457,26,'ST_INTERSECTION','ST_Intersection(g1, g2)\n\nReturns a geometry that represents the point set intersection of the\ngeometry values g1 and g2. If any argument is NULL, the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = ST_GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT ST_AsText(ST_Intersection(@g1, @g2));\n+--------------------------------------+\n| ST_AsText(ST_Intersection(@g1, @g2)) |\n+--------------------------------------+\n| POINT(2 2) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (458,10,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. An error\noccurs for old accounts that do not exist or new accounts that already\nexist.\n\nTo use RENAME USER, you must have the global CREATE USER privilege, or\nthe UPDATE privilege for the mysql system database. When the read_only\nsystem variable is enabled, RENAME USER additionally requires the SUPER\nprivilege.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nRENAME USER \'jeffrey\'@\'localhost\' TO \'jeff\'@\'127.0.0.1\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nRENAME USER causes the privileges held by the old user to be those held\nby the new user. However, RENAME USER does not automatically drop or\ninvalidate databases or objects within them that the old user created.\nThis includes stored programs or views for which the DEFINER attribute\nnames the old user. Attempts to access such objects may produce an\nerror if they execute in definer security context. (For information\nabout security context, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-security.html.)\n\nThe privilege changes take effect as indicated in\nhttp://dev.mysql.com/doc/refman/5.7/en/privilege-changes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/rename-user.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (459,13,'NUMPOINTS','NumPoints(ls)\n\nST_NumPoints() and NumPoints() are synonyms. For more information, see\nthe description of ST_NumPoints().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (460,40,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an undo log file with the same name, or an undo log file\nand a data file with the same name.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size defaults to 134217728 (128\nMB). You may optionally follow size with a one-letter abbreviation for\nan order of magnitude, similar to those used in my.cnf. Generally, this\nis one of the letters M (megabytes) or G (gigabytes). (Bug #13116514,\nBug #16104705, Bug #62858)\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB). (Bug\n#29574)\n\n*Note*:\n\nWAIT is parsed but otherwise ignored. This keyword currently has no\neffect, and is intended for future expansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. Currently, the only accepted values for engine_name are\n"NDBCLUSTER" and "NDB". The two values are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-logfile-group.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (461,32,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP([fsp])\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (462,32,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee the discussion for DATE_ADD().\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (463,7,'CREATE_DIGEST','Syntax:\nCREATE_DIGEST(digest_type, str)\n\nCreates a digest from the given string using the given digest type, and\nreturns the digest as a binary string. If digest generation fails, the\nresult is NULL.\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','SET @dig = CREATE_DIGEST(\'SHA512\', The quick brown fox\');\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (464,7,'->','Syntax:\ncolumn->path\n\nIn MySQL 5.7.9 and later, the -> operator serves as an alias for the\nJSON_EXTRACT() function when used with two arguments, a column\nidentifier on the left and a JSON path on the right that is evaluated\nagainst the JSON document (the column value). You can use such\nexpressions in place of column identifiers wherever they occur in SQL\nstatements.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT c, JSON_EXTRACT(c, "$.id"), g\n > FROM jemp\n > WHERE JSON_EXTRACT(c, "$.id") > 1\n > ORDER BY JSON_EXTRACT(c, "$.name");\n+-------------------------------+-----------+------+\n| c | c->"$.id" | g |\n+-------------------------------+-----------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 |\n| {"id": "4", "name": "Betty"} | "4" | 4 |\n| {"id": "2", "name": "Wilma"} | "2" | 2 |\n+-------------------------------+-----------+------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT c, c->"$.id", g\n > FROM jemp\n > WHERE c->"$.id" > 1\n > ORDER BY c->"$.name";\n+-------------------------------+-----------+------+\n| c | c->"$.id" | g |\n+-------------------------------+-----------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 |\n| {"id": "4", "name": "Betty"} | "4" | 4 |\n| {"id": "2", "name": "Wilma"} | "2" | 2 |\n+-------------------------------+-----------+------+\n3 rows in set (0.00 sec)\n\nmysql> ALTER TABLE jemp ADD COLUMN n INT;\nQuery OK, 0 rows affected (0.68 sec)\nRecords: 0 Duplicates: 0 Warnings: 0\n\nmysql> UPDATE jemp SET n=1 WHERE c->"$.id" = "4";\nQuery OK, 1 row affected (0.04 sec)\nRows matched: 1 Changed: 1 Warnings: 0\n\nmysql> SELECT c, c->"$.id", g, n\n > FROM jemp\n > WHERE JSON_EXTRACT(c, "$.id") > 1\n > ORDER BY c->"$.name";\n+-------------------------------+-----------+------+------+\n| c | c->"$.id" | g | n |\n+-------------------------------+-----------+------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 | NULL |\n| {"id": "4", "name": "Betty"} | "4" | 4 | 1 |\n| {"id": "2", "name": "Wilma"} | "2" | 2 | NULL |\n+-------------------------------+-----------+------+------+\n3 rows in set (0.00 sec)\n\nmysql> DELETE FROM jemp WHERE c->"$.id" = "4";\nQuery OK, 1 row affected (0.04 sec)\n\nmysql> SELECT c, c->"$.id", g, n\n > FROM jemp\n > WHERE JSON_EXTRACT(c, "$.id") > 1\n > ORDER BY c->"$.name";\n+-------------------------------+-----------+------+------+\n| c | c->"$.id" | g | n |\n+-------------------------------+-----------+------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 | NULL |\n| {"id": "2", "name": "Wilma"} | "2" | 2 | NULL |\n+-------------------------------+-----------+------+------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (465,40,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-function.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (466,8,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error. If too many prepared statements are created and\nnot deallocated by either the DEALLOCATE PREPARE statement or the end\nof the session, you might encounter the upper limit enforced by the\nmax_prepared_stmt_count system variable.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (467,14,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (468,26,'CONVEXHULL','ConvexHull(g)\n\nST_ConvexHull() and ConvexHull() are synonyms. For more information,\nsee the description of ST_ConvexHull().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (469,31,'TOUCHES','Touches(g1, g2)\n\nST_Touches() and Touches() are synonyms. For more information, see the\ndescription of ST_Touches().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (470,23,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n);\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (471,12,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (472,4,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[, srid]), GeometryCollectionFromText(wkt[, srid])\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(),\nST_GeomCollFromTxt(), GeomCollFromText(), and\nGeometryCollectionFromText() are synonyms. For more information, see\nthe description of ST_GeomCollFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (473,2,'ST_INTERIORRINGN','ST_InteriorRingN(poly, N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1. If the argument is\nNULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1));\n+-------------------------------------------------------+\n| ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1)) |\n+-------------------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+-------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (474,17,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nWith no argument, LAST_INSERT_ID() returns a BIGINT UNSIGNED (64-bit)\nvalue representing the first automatically generated value successfully\ninserted for an AUTO_INCREMENT column as a result of the most recently\nexecuted INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nWith an argument, LAST_INSERT_ID() returns an unsigned integer.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n -> 195\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nPrior to MySQL 5.7.3, this function was not replicated correctly if\nreplication filtering rules were in use. (Bug #17234370, Bug #69861)\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n LAST_INSERT_ID(), the changed value is seen by statements that follow\n the procedure call.\n\no For stored functions and triggers that change the value, the value is\n restored when the function or trigger ends, so following statements\n will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (475,3,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23), FLOOR(-1.23);\n -> 1, -2\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (476,3,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n -> -1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (477,16,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. STD() is a synonym\nfor the standard SQL function STDDEV_POP(), provided as a MySQL\nextension.\n\nIf there are no matching rows, STD() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (478,32,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (479,3,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (480,32,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n -> 8\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (481,26,'ST_CONVEXHULL','ST_ConvexHull(g)\n\nReturns a geometry that represents the convex hull of the geometry\nvalue g. If the argument is NULL, the return value is NULL.\n\nThis function computes a geometry\'s convex hull by first checking\nwhether its vertex points are colinear. The function returns a linear\nhull if so, a polygon hull otherwise. This function processes geometry\ncollections by extracting all vertex points of all components of the\ncollection, creating a MultiPoint value from them, and computing its\nconvex hull. If the argument is an empty geometry collection, the\nreturn value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g = \'MULTIPOINT(5 0,25 0,15 10,15 25)\';\nmysql> SELECT ST_AsText(ST_ConvexHull(ST_GeomFromText(@g)));\n+-----------------------------------------------+\n| ST_AsText(ST_ConvexHull(ST_GeomFromText(@g))) |\n+-----------------------------------------------+\n| POLYGON((5 0,25 0,15 25,5 0)) |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (482,32,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 − expr2 expressed as a value in the same\nformat as expr1. expr1 is a time or datetime expression, and expr2 is a\ntime expression.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (483,3,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X. If X is less than or equal to 0.0E0,\nthe function returns NULL and (as of MySQL 5.7.4) a warning "Invalid\nargument for logarithm" is reported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n -> 16\nmysql> SELECT LOG2(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (484,12,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n -> 30\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (485,40,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n tbl_name [, tbl_name] ...\n [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table.\n\nBe careful with this statement! It removes the table definition and all\ntable data. For a partitioned table, it permanently removes the table\ndefinition, all its partitions, and all data stored in those\npartitions. It also removes partition definitions associated with the\ndropped table.\n\nDROP TABLE causes an implicit commit, except when used with the\nTEMPORARY keyword. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\n*Important*:\n\nWhen a table is dropped, privileges granted specifically for the table\nare not automatically dropped. They must be dropped manually. See [HELP\nGRANT].\n\nIf any tables named in the argument list do not exist, the statement\nreturns an error indicating by name which nonexisting tables it was\nunable to drop, but also drops all tables in the list that do exist.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. Instead of an error, a NOTE is generated for each nonexistent\ntable; these notes can be displayed with SHOW WARNINGS. See [HELP SHOW\nWARNINGS].\n\nIF EXISTS can also be useful for dropping tables in unusual\ncircumstances under which there is an .frm file but no table managed by\nthe storage engine. (For example, if an abnormal server exit occurs\nafter removal of the table from the storage engine but before .frm file\nremoval.)\n\nThe TEMPORARY keyword has the following effects:\n\no The statement drops only TEMPORARY tables.\n\no The statement does not cause an implicit commit.\n\no No access rights are checked. A TEMPORARY table is visible only with\n the session that created it, so no check is necessary.\n\nUsing TEMPORARY is a good way to ensure that you do not accidentally\ndrop a non-TEMPORARY table.\n\nThe RESTRICT and CASCADE keywords do nothing. They are permitted to\nmake porting easier from other database systems.\n\nDROP TABLE is not supported with all innodb_force_recovery settings.\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (486,3,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n -> 4\nmysql> SELECT POW(2,-2);\n -> 0.25\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (487,32,'NOW','Syntax:\nNOW([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context. The value is expressed in the current time\nzone.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (488,27,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is.\n\nFor information about MySQL storage engines, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/storage-engines.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-engines.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (489,4,'ST_POINTFROMTEXT','ST_PointFromText(wkt[, srid])\n\nConstructs a Point value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (490,13,'ST_ENDPOINT','ST_EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_EndPoint(ST_GeomFromText(@ls)));\n+----------------------------------------------+\n| ST_AsText(ST_EndPoint(ST_GeomFromText(@ls))) |\n+----------------------------------------------+\n| POINT(3 3) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (491,14,'IS_IPV6','Syntax:\nIS_IPV6(expr)\n\nReturns 1 if the argument is a valid IPv6 address specified as a\nstring, 0 otherwise. This function does not consider IPv4 addresses to\nbe valid IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV6(\'10.0.5.9\'), IS_IPV6(\'::1\');\n -> 0, 1\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (492,23,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 − 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a 4-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (493,31,'ST_OVERLAPS','ST_Overlaps(g1, g2)\n\nTwo geometries spatially overlap if they intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nThis function returns 1 or 0 to indicate whether g1 spatially overlaps\ng2.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if called with\ngeometries of different dimensions or any argument is a Point.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (494,23,'YEAR DATA TYPE','YEAR[(4)]\n\nA year in four-digit format. MySQL displays YEAR values in YYYY format,\nbut permits assignment of values to YEAR columns using either strings\nor numbers. Values display as 1901 to 2155, and 0000.\n\n*Note*:\n\nThe YEAR(2) data type is deprecated and support for it is removed in\nMySQL 5.7.5. To convert YEAR(2) columns to YEAR(4), see\nhttp://dev.mysql.com/doc/refman/5.7/en/migrating-to-year4.html.\n\nFor additional information about YEAR display format and interpretation\nof input values, see http://dev.mysql.com/doc/refman/5.7/en/year.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (495,16,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used to sum only the distinct values\nof expr.\n\nIf there are no matching rows, SUM() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (496,7,'JSON_SET','Syntax:\nJSON_SET(json_doc, path, val[, path, val] ...)\n\nInserts or updates data in a JSON document and returns the result.\nReturns NULL if any argument is NULL or path, if given, does not locate\nan object. An error occurs if the json_doc argument is not a valid JSON\ndocument or any path argument is not a valid path expression or\ncontains a * or ** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nA path-value pair for an existing path in the document overwrites the\nexisting document value with the new value. A path-value pair for a\nnonexisting path in the document adds the value to the document if the\npath identifies one of these types of values:\n\no A member not present in an existing object. The member is added to\n the object and associated with the new value.\n\no A position past the end of an existing array. The array is extended\n with the new value. If the existing value is not an array, it is\n autowrapped as an array, then extended with the new value.\n\nOtherwise, a path-value pair for a nonexisting path in the document is\nignored and has no effect.\n\nThe JSON_SET(), JSON_INSERT(), and JSON_REPLACE() functions are\nrelated:\n\no JSON_SET() replaces existing values and adds nonexisting values.\n\no JSON_INSERT() inserts values without replacing existing values.\n\no JSON_REPLACE() replaces only existing values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'{ "a": 1, "b": [2, 3]}\';\nmysql> SELECT JSON_SET(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+-------------------------------------------------+\n| JSON_SET(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+-------------------------------------------------+\n| {"a": 10, "b": [2, 3], "c": "[true, false]"} |\n+-------------------------------------------------+\nmysql> SELECT JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+----------------------------------------------------+\n| JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+----------------------------------------------------+\n| {"a": 1, "b": [2, 3], "c": "[true, false]"} |\n+----------------------------------------------------+\nmysql> SELECT JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+-----------------------------------------------------+\n| JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+-----------------------------------------------------+\n| {"a": 10, "b": [2, 3]} |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (497,38,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (498,38,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*:\n\nWhen using SOUNDEX(), you should be aware of the following limitations:\n\no This function, as currently implemented, is intended to work well\n with strings that are in the English language only. Strings in other\n languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n strings that use multibyte character sets, including utf-8. See Bug\n #22638 for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (499,7,'MBRTOUCHES','MBRTouches(g1, g2)\n\nTwo geometries spatially touch if their interiors do not intersect, but\nthe boundary of one of the geometries intersects either the boundary or\nthe interior of the other.\n\nThis function returns 1 or 0 to indicate whether the minimum bounding\nrectangles of the two geometries g1 and g2 touch.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (500,40,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nThis statement requires the EVENT privilege for the schema to which the\nevent to be dropped belongs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-event.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (501,23,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (502,27,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [PARTITION (partition_list | ALL)]\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise.\n\nLOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.7, it\nis also supported for partitioned MyISAM tables; in addition, indexes\non partitioned tables can be preloaded for one, several, or all\npartitions.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nIGNORE LEAVES is also supported for partitioned MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/load-index.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (503,28,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/union.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (504,32,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n -> 733321\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (505,27,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [WHERE expr]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC. This statement requires some\nprivilege for any column in the table.\n\nmysql> SHOW INDEX FROM City\\G\n*************************** 1. row ***************************\n Table: city\n Non_unique: 0\n Key_name: PRIMARY\n Seq_in_index: 1\n Column_name: ID\n Collation: A\n Cardinality: 4188\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment:\n*************************** 2. row ***************************\n Table: city\n Non_unique: 1\n Key_name: CountryCode\n Seq_in_index: 1\n Column_name: CountryCode\n Collation: A\n Cardinality: 232\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment:\n\nAn alternative to tbl_name FROM db_name syntax is db_name.tbl_name.\nThese two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nThe WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nSHOW INDEX returns the following fields:\n\no Table\n\n The name of the table.\n\no Non_unique\n\n 0 if the index cannot contain duplicates, 1 if it can.\n\no Key_name\n\n The name of the index. If the index is the primary key, the name is\n always PRIMARY.\n\no Seq_in_index\n\n The column sequence number in the index, starting with 1.\n\no Column_name\n\n The name of the column.\n\no Collation\n\n How the column is sorted in the index. This can have values A\n (ascending) or NULL (not sorted).\n\no Cardinality\n\n An estimate of the number of unique values in the index. To update\n this number, run ANALYZE TABLE or (for MyISAM tables) myisamchk -a.\n\n Cardinality is counted based on statistics stored as integers, so the\n value is not necessarily exact even for small tables. The higher the\n cardinality, the greater the chance that MySQL uses the index when\n doing joins.\n\no Sub_part\n\n The index prefix. That is, the number of indexed characters if the\n column is only partly indexed, NULL if the entire column is indexed.\n\n *Note*:\n\n Prefix limits are measured in bytes. However, prefix lengths for\n index specifications in CREATE TABLE, ALTER TABLE, and CREATE INDEX\n statements are interpreted as number of characters for nonbinary\n string types (CHAR, VARCHAR, TEXT) and number of bytes for binary\n string types (BINARY, VARBINARY, BLOB). Take this into account when\n specifying a prefix length for a nonbinary string column that uses a\n multibyte character set.\n\n For additional information about index prefixes, see\n http://dev.mysql.com/doc/refman/5.7/en/column-indexes.html, and [HELP\n CREATE INDEX].\n\no Packed\n\n Indicates how the key is packed. NULL if it is not.\n\no Null\n\n Contains YES if the column may contain NULL values and \'\' if not.\n\no Index_type\n\n The index method used (BTREE, FULLTEXT, HASH, RTREE).\n\no Comment\n\n Information about the index not described in its own column, such as\n disabled if the index is disabled.\n\no Index_comment\n\n Any comment provided for the index with a COMMENT attribute when the\n index was created.\n\nInformation about table indexes is also available from the\nINFORMATION_SCHEMA STATISTICS table. See\nhttp://dev.mysql.com/doc/refman/5.7/en/statistics-table.html.\n\nYou can list a table\'s indexes with the mysqlshow -k db_name tbl_name\ncommand.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-index.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (506,27,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n\nShows the CREATE DATABASE statement that creates the named database. If\nthe SHOW statement includes an IF NOT EXISTS clause, the output too\nincludes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE\nDATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.7/en/show-create-database.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (507,15,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n -> 0\nmysql> SELECT NOT 0;\n -> 1\nmysql> SELECT NOT NULL;\n -> NULL\nmysql> SELECT ! (1+1);\n -> 0\nmysql> SELECT ! 1+1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (508,24,'DECLARE HANDLER','Syntax:\nDECLARE handler_action HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_action:\n CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n\nThe DECLARE ... HANDLER statement specifies a handler that deals with\none or more conditions. If one of these conditions occurs, the\nspecified statement executes. statement can be a simple statement such\nas SET var_name = value, or a compound statement written using BEGIN\nand END (see [HELP BEGIN END]).\n\nHandler declarations must appear after variable or condition\ndeclarations.\n\nThe handler_action value indicates what action the handler takes after\nexecution of the handler statement:\n\no CONTINUE: Execution of the current program continues.\n\no EXIT: Execution terminates for the BEGIN ... END compound statement\n in which the handler is declared. This is true even if the condition\n occurs in an inner block.\n\no UNDO: Not supported.\n\nThe condition_value for DECLARE ... HANDLER indicates the specific\ncondition or class of conditions that activates the handler. It can\ntake the following forms:\n\no mysql_error_code: An integer literal indicating a MySQL error code,\n such as 1051 to specify "unknown table":\n\nDECLARE CONTINUE HANDLER FOR 1051\n BEGIN\n -- body of handler\n END;\n\n Do not use MySQL error code 0 because that indicates success rather\n than an error condition. For a list of MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html.\n\no SQLSTATE [VALUE] sqlstate_value: A 5-character string literal\n indicating an SQLSTATE value, such as \'42S01\' to specify "unknown\n table":\n\nDECLARE CONTINUE HANDLER FOR SQLSTATE \'42S02\'\n BEGIN\n -- body of handler\n END;\n\n Do not use SQLSTATE values that begin with \'00\' because those\n indicate success rather than an error condition. For a list of\n SQLSTATE values, see\n http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html.\n\no condition_name: A condition name previously specified with DECLARE\n ... CONDITION. A condition name can be associated with a MySQL error\n code or SQLSTATE value. See [HELP DECLARE CONDITION].\n\no SQLWARNING: Shorthand for the class of SQLSTATE values that begin\n with \'01\'.\n\nDECLARE CONTINUE HANDLER FOR SQLWARNING\n BEGIN\n -- body of handler\n END;\n\no NOT FOUND: Shorthand for the class of SQLSTATE values that begin with\n \'02\'. This is relevant within the context of cursors and is used to\n control what happens when a cursor reaches the end of a data set. If\n no more rows are available, a No Data condition occurs with SQLSTATE\n value \'02000\'. To detect this condition, you can set up a handler for\n it or for a NOT FOUND condition.\n\nDECLARE CONTINUE HANDLER FOR NOT FOUND\n BEGIN\n -- body of handler\n END;\n\n For another example, see\n http://dev.mysql.com/doc/refman/5.7/en/cursors.html. The NOT FOUND\n condition also occurs for SELECT ... INTO var_list statements that\n retrieve no rows.\n\no SQLEXCEPTION: Shorthand for the class of SQLSTATE values that do not\n begin with \'00\', \'01\', or \'02\'.\n\nDECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n -- body of handler\n END;\n\nFor information about how the server chooses handlers when a condition\noccurs, see http://dev.mysql.com/doc/refman/5.7/en/handler-scope.html.\n\nIf a condition occurs for which no handler has been declared, the\naction taken depends on the condition class:\n\no For SQLEXCEPTION conditions, the stored program terminates at the\n statement that raised the condition, as if there were an EXIT\n handler. If the program was called by another stored program, the\n calling program handles the condition using the handler selection\n rules applied to its own handlers.\n\no For SQLWARNING conditions, the program continues executing, as if\n there were a CONTINUE handler.\n\no For NOT FOUND conditions, if the condition was raised normally, the\n action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the\n action is EXIT.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n -> BEGIN\n -> DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n -> SET @x = 1;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 2;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 3;\n -> END;\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n +------+\n | @x |\n +------+\n | 3 |\n +------+\n 1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/declare-handler.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (509,23,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Permissible\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (510,23,'TIME','TIME[(fsp)]\n\nA time. The range is \'-838:59:59.000000\' to \'838:59:59.000000\'. MySQL\ndisplays TIME values in \'HH:MM:SS[.fraction]\' format, but permits\nassignment of values to TIME columns using either strings or numbers.\n\nAn optional fsp value in the range from 0 to 6 may be given to specify\nfractional seconds precision. A value of 0 signifies that there is no\nfractional part. If omitted, the default precision is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (511,17,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (512,40,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n back. See\n http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table or NDB table if there are\n any FOREIGN KEY constraints from other tables that reference the\n table. Foreign key constraints between columns of the same table are\n permitted.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n even for MyISAM and InnoDB, which normally do not reuse sequence\n values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/truncate-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (513,32,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (514,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options] [channel_option]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type:\n IO_THREAD | SQL_THREAD\n\nuntil_option:\n UNTIL { {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n | MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n | RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n | SQL_AFTER_MTS_GAPS }\n\nconnection_options:\n [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\nchannel_option:\n FOR CHANNEL channel\n\ngtid_set:\n uuid_set [, uuid_set] ...\n | \'\'\n\nuuid_set:\n uuid:interval[:interval]...\n\nuuid:\n hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n [0-9,A-F]\n\ninterval:\n n[-n]\n\n (n >= 1)\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.7, START SLAVE causes an implicit commit of an ongoing\ntransaction. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\ngtid_next must be set to AUTOMATIC before issuing this statement.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the START SLAVE statement to a specific\nreplication channel. If no clause is named and no extra channels exist,\nthe statement applies to the default channel. If a START SLAVE\nstatement does not have a channel defined when using multiple channels,\nthis statement starts the specified threads for all channels. This\nstatement is disallowed for the group_replication_recovery channel. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nMySQL supports pluggable user-password authentication with START SLAVE\nwith the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR options, as\ndescribed in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nYou cannot use the SQL_THREAD option when specifying any of USER,\nPASSWORD, DEFAULT_AUTH, or PLUGIN_DIR, unless the IO_THREAD option is\nalso provided.\n\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nSTART SLAVE ... UNTIL supports two additional options for use with\nglobal transaction identifiers (GTIDs) (see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids.html). Each of\nthese takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses the slave SQL thread to process transactions until it has\nreached the first transaction whose GTID is listed in the gtid_set.\nSTART SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to process\nall transactions until the last transaction in the gtid_set has been\nprocessed by both threads. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS causes the slave SQL thread to process all\ntransactions occurring before the first GTID in the gtid_set is\nreached, and START SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads\nto handle all transactions, including those whose GTIDs are found in\ngtid_set, until each has encountered a transaction whose GTID is not\npart of the set. SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the\nSQL_THREAD and IO_THREAD options, although using IO_THREAD with them\ncurrently has no effect.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE SQL_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave SQL thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave SQL\nthread.\n\nPrior to MySQL 5.7.3, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction was completed, but waited until another GTID\nevent was received (Bug #14767986).\n\nWhen using a multithreaded slave, there is a chance of gaps in the\nsequence of transactions that have been executed from the relay log in\nthe following cases:\n\no killing the coordinator thread\n\no after an error occurs in the worker threads\n\no mysqld shuts down unexpectedly\n\nUse the START SLAVE UNTIL SQL_AFTER_MTS_GAPS statement to cause a\nmultithreaded slave\'s worker threads to only run until no more gaps are\nfound in the relay log, and then to stop. This statement can take an\nSQL_THREAD option, but the effects of the statement remain unchanged.\nIt has no effect on the slave I/O thread (and cannot be used with the\nIO_THREAD option).\n\nIssuing START SLAVE on a multithreaded slave with gaps in the sequence\nof transactions executed from the relay log generates a warning. In\nsuch a situation, the solution is to use START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS, then issue RESET SLAVE to remove any remaining\nrelay logs. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-features-transaction\n-inconsistencies.html for more information.\n\nTo change a failed multithreaded slave to single-threaded mode, you can\nissue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\n*Note*:\n\nIt is possible to view the entire text of a running START SLAVE ...\nstatement, including any USER or PASSWORD values used, in the output of\nSHOW PROCESSLIST. This is also true for the text of a running CHANGE\nMASTER TO statement, including any values it employs for MASTER_USER or\nMASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/start-slave.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (515,2,'AREA','Area({poly|mpoly})\n\nST_Area() and Area() are synonyms. For more information, see the\ndescription of ST_Area().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (516,27,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS is a diagnostic statement that displays information about\nthe conditions (errors, warnings, and notes) resulting from executing a\nstatement in the current session. Warnings are generated for DML\nstatements such as INSERT, UPDATE, and LOAD DATA INFILE as well as DDL\nstatements such as CREATE TABLE and ALTER TABLE.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nSHOW WARNINGS is also used following EXPLAIN, to display the extended\ninformation generated by EXPLAIN. See\nhttp://dev.mysql.com/doc/refman/5.7/en/explain-extended.html.\n\nSHOW WARNINGS displays information about the conditions resulting from\nexecution of the most recent nondiagnostic statement in the current\nsession. If the most recent statement resulted in an error during\nparsing, SHOW WARNINGS shows the resulting conditions, regardless of\nstatement type (diagnostic or nondiagnostic).\n\nThe SHOW COUNT(*) WARNINGS diagnostic statement displays the total\nnumber of errors, warnings, and notes. You can also retrieve this\nnumber from the warning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nA difference in these statements is that the first is a diagnostic\nstatement that does not clear the message list. The second, because it\nis a SELECT statement is considered nondiagnostic and does clear the\nmessage list.\n\nA related diagnostic statement, SHOW ERRORS, shows only error\nconditions (it excludes warnings and notes), and SHOW COUNT(*) ERRORS\nstatement displays the total number of errors. See [HELP SHOW ERRORS].\nGET DIAGNOSTICS can be used to examine information for individual\nconditions. See [HELP GET DIAGNOSTICS].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-warnings.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (517,4,'ST_LINEFROMTEXT','ST_LineFromText(wkt[, srid]), ST_LineStringFromText(wkt[, srid])\n\nConstructs a LineString value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (518,10,'DROP USER','Syntax:\nDROP USER [IF EXISTS] user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables.\n\nTo use DROP USER, you must have the global CREATE USER privilege, or\nthe DELETE privilege for the mysql system database. When the read_only\nsystem variable is enabled, DROP USER additionally requires the SUPER\nprivilege.\n\nAn error occurs if you try to drop an account that does not exist. If\nthe IF EXISTS clause is given, the statement produces a warning for\neach named user that does not exist, rather than an error.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-user.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (519,38,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (520,37,'ISEMPTY','IsEmpty(g)\n\nST_IsEmpty() and IsEmpty() are synonyms. For more information, see the\ndescription of ST_IsEmpty().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (521,27,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-function-status.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (522,38,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LTRIM(\' barbar\');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (523,31,'ST_CROSSES','ST_Crosses(g1, g2)\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect.\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries.\n\no Their intersection is not equal to either of the two given\n geometries.\n\nThis function returns 1 or 0 to indicate whether g1 spatially crosses\ng2. If g1 is a Polygon or a MultiPolygon, or if g2 is a Point or a\nMultiPoint, the return value is NULL.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if the first\nargument is a Polygon or MultiPolygon and/or the second argument is a\nPoint or MultiPoint.\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if the first\nargument is a Polygon or MultiPolygon and/or the second argument is a\nPoint or MultiPoint.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (524,4,'ST_MPOLYFROMTEXT','ST_MPolyFromText(wkt[, srid]), ST_MultiPolygonFromText(wkt[, srid])\n\nConstructs a MultiPolygon value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (525,28,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nStored procedures that take no arguments can be invoked without\nparentheses. That is, CALL p() and CALL p are equivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/call.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (526,7,'MBRDISJOINT','MBRDisjoint(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (527,14,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in the ON DUPLICATE KEY UPDATE clause of\nINSERT statements and returns NULL otherwise. See\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (528,12,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nENCODE() encrypts str using pass_str as the password. The result is a\nbinary string of the same length as str. To decrypt the result, use\nDECODE().\n\n*Note*:\n\nThe ENCODE() and DECODE() functions are deprecated in MySQL 5.7, will\nbe removed in a future MySQL release, and should no longer be used.\n\nIf you still need to use ENCODE(), a salt value must be used with it to\nreduce risk. For example:\n\nENCODE(\'cleartext\', CONCAT(\'my_random_salt\',\'my_secret_password\'))\n\nA new random salt value must be used whenever a password is updated.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (529,38,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (530,11,'ST_X','ST_X(p)\n\nReturns the X-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','mysql> SELECT ST_X(Point(56.7, 53.34));\n+--------------------------+\n| ST_X(Point(56.7, 53.34)) |\n+--------------------------+\n| 56.7 |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (531,32,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: MICROSECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (532,3,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n -> 1028\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (533,27,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW {BINARY | MASTER} LOGS\nSHOW BINLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW MASTER STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW RELAYLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW SLAVE HOSTS\nSHOW SLAVE STATUS [FOR CHANNEL channel]\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL % and _ wildcard\ncharacters. The pattern is useful for restricting statement output to\nmatching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (534,27,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\n*Note*:\n\nAs of MySQL 5.7.6, the value of the show_compatibility_56 system\nvariable affects the information available from and privileges required\nfor the statement described here. For details, see the description of\nthat variable in\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nSHOW VARIABLES shows the values of MySQL system variables (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html).\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\n\nSystem variable information is also available from these sources:\n\no Performance Schema tables. See\n http://dev.mysql.com/doc/refman/5.7/en/performance-schema-system-vari\n able-tables.html.\n\no The GLOBAL_VARIABLES and SESSION_VARIABLES tables. See\n http://dev.mysql.com/doc/refman/5.7/en/variables-table.html.\n\no The mysqladmin variables command. See\n http://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html.\n\nFor SHOW VARIABLES, a LIKE clause, if present, indicates which variable\nnames to match. A WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nSHOW VARIABLES accepts an optional GLOBAL or SESSION variable scope\nmodifier:\n\no With a GLOBAL modifier, the statement displays global system variable\n values. These are the values used to initialize the corresponding\n session variables for new connections to MySQL. If a variable has no\n global value, no value is displayed.\n\no With a SESSION modifier, the statement displays the system varaible\n values that are in effect for the current connection. If a variable\n has no session value, the global value is displayed. LOCAL is a\n synonym for SESSION.\n\no If no modifier is present, the default is SESSION.\n\nThe scope for each system variable is listed at\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nSHOW VARIABLES is subject to a version-dependent display-width limit.\nFor variables with very long values that are not completely displayed,\nuse SELECT as a workaround. For example:\n\nSELECT @@GLOBAL.innodb_data_file_path;\n\nMost system variables can be set at server startup (read-only variables\nsuch as version_comment are exceptions). Many can be changed at runtime\nwith the SET statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/using-system-variables.html, and\n[HELP SET].\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the %\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because _ is a wildcard that matches any\nsingle character, you should escape it as \\_ to match it literally. In\npractice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-variables.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (535,27,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.7/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/binlog.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (536,31,'ST_DISJOINT','ST_Disjoint(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (537,3,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (538,15,'AND','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT 1 AND 1;\n -> 1\nmysql> SELECT 1 AND 0;\n -> 0\nmysql> SELECT 1 AND NULL;\n -> NULL\nmysql> SELECT 0 AND NULL;\n -> 0\nmysql> SELECT NULL AND 0;\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (539,32,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n -> 272\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (540,28,'SELECT','Syntax:\nSELECT\n [ALL | DISTINCT | DISTINCTROW ]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [FROM table_references\n [PARTITION partition_list]\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position}\n [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position}\n [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n export_options\n | INTO DUMPFILE \'file_name\'\n | INTO var_name [, var_name]]\n [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.7/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n rows. Its syntax is described in [HELP JOIN].\n\no SELECT supports explicit partition selection using the PARTITION with\n a list of partitions or subpartitions (or both) following the name of\n the table in a table_reference (see [HELP JOIN]). In this case, rows\n are selected only from the partitions listed, and any other\n partitions of the table are ignored. For more information and\n examples, see\n http://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\n SELECT ... PARTITION from tables using storage engines such as MyISAM\n that perform table-level locks (and thus partition locks) lock only\n the partitions or subpartitions named by the PARTITION option.\n\n For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-locki\n ng.html.\n\no The WHERE clause, if given, indicates the condition or conditions\n that rows must satisfy to be selected. where_condition is an\n expression that evaluates to true for each row to be selected. The\n statement selects all rows if there is no WHERE clause.\n\n In the WHERE expression, you can use any of the functions and\n operators that MySQL supports, except for aggregate (summary)\n functions. See\n http://dev.mysql.com/doc/refman/5.7/en/expressions.html, and\n http://dev.mysql.com/doc/refman/5.7/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/select.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (541,7,'JSON_MERGE_PRESERVE()','Syntax:\nJSON_MERGE_PRESERVE(json_doc, json_doc[, json_doc] ...)\n\nMerges two or more JSON documents and returns the merged result.\nReturns NULL if any argument is NULL. An error occurs if any argument\nis not a valid JSON document.\n\nMerging takes place according to the following rules. For additional\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.7/en/json.html#json-normalization.\n\no Adjacent arrays are merged to a single array.\n\no Adjacent objects are merged to a single object.\n\no A scalar value is autowrapped as an array and merged as an array.\n\no An adjacent array and object are merged by autowrapping the object as\n an array and merging the two arrays.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SELECT JSON_MERGE_PRESERVE(\'[1, 2]\', \'[true, false]\');\n+------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'[1, 2]\', \'[true, false]\') |\n+------------------------------------------------+\n| [1, 2, true, false] |\n+------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'{"name": "x"}\', \'{"id": 47}\');\n+----------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'{"name": "x"}\', \'{"id": 47}\') |\n+----------------------------------------------------+\n| {"id": 47, "name": "x"} |\n+----------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'1\', \'true\');\n+----------------------------------+\n| JSON_MERGE_PRESERVE(\'1\', \'true\') |\n+----------------------------------+\n| [1, true] |\n+----------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'[1, 2]\', \'{"id": 47}\');\n+---------------------------------------------+\n| JSON_MERGE_PRESERVE(\'[1, 2]\', \'{"id": 47}\') |\n+---------------------------------------------+\n| [1, 2, {"id": 47}] |\n+---------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\n > \'{ "a": 3, "c": 4 }\');\n+--------------------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\'{ "a": 3, "c":4 }\') |\n+--------------------------------------------------------------+\n| {"a": [1, 3], "b": 2, "c": 4} |\n+--------------------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\'{ "a": 3, "c": 4 }\',\n > \'{ "a": 5, "d": 6 }\');\n+----------------------------------------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\'{ "a": 3, "c": 4 }\',\'{ "a": 5, "d": 6 }\') |\n+----------------------------------------------------------------------------------+\n| {"a": [1, 3, 5], "b": 2, "c": 4, "d": 6} |\n+----------------------------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (542,16,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n GROUP_CONCAT(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (543,17,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,AES_ENCRYPT(\'hello\',\'goodbye\'));\n+---------------------------------------------------+\n| BENCHMARK(1000000,AES_ENCRYPT(\'hello\',\'goodbye\')) |\n+---------------------------------------------------+\n| 0 |\n+---------------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (544,38,'FROM_BASE64','Syntax:\nFROM_BASE64(str)\n\nTakes a string encoded with the base-64 encoded rules used by\nTO_BASE64() and returns the decoded result as a binary string. The\nresult is NULL if the argument is NULL or not a valid base-64 string.\nSee the description of TO_BASE64() for details about the encoding and\ndecoding rules.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (545,27,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine. It\nrequires the PROCESS privilege. The statement has these variants:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex and rw-lock statistics.\n\n*Note*:\n\nInnoDB mutexes and rwlocks can also be monitored using Performance\nSchema tables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/monitor-innodb-mutex-waits-perfo\nrmance-schema.html.\n\nSHOW ENGINE INNODB MUTEX output was removed in MySQL 5.7.2. It was\nrevised and reintroduced in MySQL 5.7.8.\n\nIn MySQL 5.7.8, mutex statistics collection is configured dynamically\nusing the following options:\n\no To enable the collection of mutex statistics, run:\n\nSET GLOBAL innodb_monitor_enable=\'latch\';\n\no To reset mutex statistics, run:\n\nSET GLOBAL innodb_monitor_reset=\'latch\';\n\no To disable the collection of mutex statistics, run:\n\nSET GLOBAL innodb_monitor_disable=\'latch\';\n\nCollection of mutex statistics for SHOW ENGINE INNODB MUTEX can also be\nenabled by setting innodb_monitor_enable=\'all\', or disabled by setting\ninnodb_monitor_disable=\'all\'.\n\nSHOW ENGINE INNODB MUTEX output has these columns:\n\no Type\n\n Always InnoDB.\n\no Name\n\n Prior to MySQL 5.7.8, the Name field reports the source file where\n the mutex is implemented, and the line number in the file where the\n mutex is created. The line number is specific to your version of\n MySQL. As of MySQL 5.7.8, only the mutex name is reported. File name\n and line number are still reported for rwlocks.\n\no Status\n\n The mutex status.\n\n Prior to MySQL 5.7.8, the Status field displays several values if\n WITH_DEBUG was defined at MySQL compilation time. If WITH_DEBUG was\n not defined, the statement displays only the os_waits value. In the\n latter case (without WITH_DEBUG), the information on which the output\n is based is insufficient to distinguish regular mutexes and mutexes\n that protect rwlocks (which permit multiple readers or a single\n writer). Consequently, the output may appear to contain multiple rows\n for the same mutex. Pre-MySQL 5.7.8 Status field values include:\n\n o count indicates how many times the mutex was requested.\n\n o spin_waits indicates how many times the spinlock had to run.\n\n o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n divided by spin_waits provides the average round count.)\n\n o os_waits indicates the number of operating system waits. This\n occurs when the spinlock did not work (the mutex was not locked\n during the spinlock and it was necessary to yield to the operating\n system and wait).\n\n o os_yields indicates the number of times a thread trying to lock a\n mutex gave up its timeslice and yielded to the operating system (on\n the presumption that permitting other threads to run will free the\n mutex so that it can be locked).\n\n o os_wait_times indicates the amount of time (in ms) spent in\n operating system waits. In MySQL 5.7 timing is disabled and this\n value is always 0.\n\n As of MySQL 5.7.8, the Status field reports the number of spins,\n waits, and calls. Statistics for low-level operating system mutexes,\n which are implemented outside of InnoDB, are not reported.\n\n o spins indicates the number of spins.\n\n o waits indicates the number of mutex waits.\n\n o calls indicates how many times the mutex was requested.\n\nSHOW ENGINE INNODB MUTEX skips the mutexes and rw-locks of buffer pool\nblocks, as the amount of output can be overwhelming on systems with a\nlarge buffer pool. (There is one mutex and one rw-lock in each 16K\nbuffer pool block, and there are 65,536 blocks per gigabyte.) SHOW\nENGINE INNODB MUTEX also does not list any mutexes or rw-locks that\nhave never been waited on (os_waits=0). Thus, SHOW ENGINE INNODB MUTEX\nonly displays information about mutexes and rw-locks outside of the\nbuffer pool that have caused at least one OS-level wait.\n\nUse SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal\noperation of the Performance Schema code:\n\nmysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\\G\n...\n*************************** 3. row ***************************\n Type: performance_schema\n Name: events_waits_history.size\nStatus: 76\n*************************** 4. row ***************************\n Type: performance_schema\n Name: events_waits_history.count\nStatus: 10000\n*************************** 5. row ***************************\n Type: performance_schema\n Name: events_waits_history.memory\nStatus: 760000\n...\n*************************** 57. row ***************************\n Type: performance_schema\n Name: performance_schema.memory\nStatus: 26459600\n...\n\nThis statement is intended to help the DBA understand the effects that\ndifferent Performance Schema options have on memory requirements.\n\nName values consist of two parts, which name an internal buffer and a\nbuffer attribute, respectively. Interpret buffer names as follows:\n\no An internal buffer that is not exposed as a table is named within\n parentheses. Examples: (pfs_cond_class).size,\n (pfs_mutex_class).memory.\n\no An internal buffer that is exposed as a table in the\n performance_schema database is named after the table, without\n parentheses. Examples: events_waits_history.size,\n mutex_instances.count.\n\no A value that applies to the Performance Schema as a whole begins with\n performance_schema. Example: performance_schema.memory.\n\nBuffer attributes have these meanings:\n\no size is the size of the internal record used by the implementation,\n such as the size of a row in a table. size values cannot be changed.\n\no count is the number of internal records, such as the number of rows\n in a table. count values can be changed using Performance Schema\n configuration options.\n\no For a table, tbl_name.memory is the product of size and count. For\n the Performance Schema as a whole, performance_schema.memory is the\n sum of all the memory used (the sum of all other memory values).\n\nIn some cases, there is a direct relationship between a Performance\nSchema configuration parameter and a SHOW ENGINE value. For example,\nevents_waits_history_long.count corresponds to\nperformance_schema_events_waits_history_long_size. In other cases, the\nrelationship is more complex. For example, events_waits_history.count\ncorresponds to performance_schema_events_waits_history_size (the number\nof rows per thread) multiplied by\nperformance_schema_max_thread_instances ( the number of threads).\n\nSHOW ENGINE NDB STATUS If the server has the NDB storage engine\nenabled, SHOW ENGINE NDB STATUS displays cluster status information\nsuch as the number of connected data nodes, the cluster connectstring,\nand cluster binary log epochs, as well as counts of various Cluster API\nobjects created by the MySQL Server when connected to the cluster.\nSample output from this statement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type | Name | Status |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection | cluster_node_id=7,\n connected_host=198.51.100.103, connected_port=1186, number_of_data_nodes=4,\n number_of_ready_data_nodes=3, connect_count=0 |\n| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212 |\n| ndbcluster | NdbOperation | created=8, free=8, sizeof=660 |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744 |\n| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664 |\n| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60 |\n| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136 |\n| ndbcluster | NdbLabel | created=0, free=0, sizeof=196 |\n| ndbcluster | NdbBranch | created=0, free=0, sizeof=24 |\n| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68 |\n| ndbcluster | NdbCall | created=0, free=0, sizeof=16 |\n| ndbcluster | NdbBlob | created=1, free=1, sizeof=264 |\n| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68 |\n| ndbcluster | binlog | latest_epoch=155467, latest_trans_epoch=148126,\n latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n latest_applied_binlog_epoch=0 |\n+------------+-----------------------+--------------------------------------------------+\n\nThe Status column in each of these rows provides information about the\nMySQL server\'s connection to the cluster and about the cluster binary\nlog\'s status, respectively. The Status information is in the form of\ncomma-delimited set of name/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-engine.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (546,14,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (547,14,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (548,32,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (549,32,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n -> 2378\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (550,32,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (551,38,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ,). The number of bits examined is given by number_of_bits,\nwhich has a default of 64 if not specified. number_of_bits is silently\nclipped to 64 if larger than 64. It is treated as an unsigned integer,\nso a value of −1 is effectively the same as 64.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (552,38,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes an expression of any type and produces a\nresult value of the specified type, similar to CONVERT(). For more\ninformation, see the description of CONVERT().\n\nCAST() is standard SQL syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (553,38,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (554,32,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n -> 11\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (555,16,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nIf there are no matching rows, AVG() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (556,38,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotation marks and with each instance of backslash (\\),\nsingle quote (\'), ASCII NUL, and Control+Z preceded by a backslash. If\nthe argument is NULL, the return value is the word "NULL" without\nenclosing single quotation marks.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (557,20,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.7/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (558,32,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (559,27,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help \', where is one of the\nfollowing categories:\n Account Management\n Administration\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Storage Engines\n Stored Routines\n Table Maintenance\n Transactions\n Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following topics:\n SHOW\n SHOW BINARY LOGS\n SHOW ENGINE\n SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nThe search string can contain the wildcard characters % and _. These\nhave the same meaning as for pattern-matching operations performed with\nthe LIKE operator. For example, HELP rep% returns a list of topics that\nbegin with rep:\n\nmysql> HELP rep%\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following\ntopics:\n REPAIR TABLE\n REPEAT FUNCTION\n REPEAT LOOP\n REPLACE\n REPLACE FUNCTION\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/mysql-server-side-help.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (560,7,'JSON_REPLACE','Syntax:\nJSON_REPLACE(json_doc, path, val[, path, val] ...)\n\nReplaces existing values in a JSON document and returns the result.\nReturns NULL if any argument is NULL. An error occurs if the json_doc\nargument is not a valid JSON document or any path argument is not a\nvalid path expression or contains a * or ** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nA path-value pair for an existing path in the document overwrites the\nexisting document value with the new value. A path-value pair for a\nnonexisting path in the document is ignored and has no effect.\n\nFor a comparison of JSON_INSERT(), JSON_REPLACE(), and JSON_SET(), see\nthe discussion of JSON_SET().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'{ "a": 1, "b": [2, 3]}\';\nmysql> SELECT JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+-----------------------------------------------------+\n| JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+-----------------------------------------------------+\n| {"a": 10, "b": [2, 3]} |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (561,38,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (562,14,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client session that holds\nthe lock. Otherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (563,4,'POLYFROMTEXT','PolyFromText(wkt[, srid]), PolygonFromText(wkt[, srid])\n\nST_PolyFromText(), ST_PolygonFromText(), PolyFromText(), and\nPolygonFromText() are synonyms. For more information, see the\ndescription of ST_PolyFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (564,37,'ST_SRID','ST_SRID(g)\n\nReturns an integer indicating the spatial reference system ID\nassociated with the geometry value g, or NULL if the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_SRID(ST_GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------------+\n| ST_SRID(ST_GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------------+\n| 101 |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (565,10,'ALTER USER','Syntax:\nALTER USER [IF EXISTS]\n user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [password_option | lock_option] ...\n\nALTER USER [IF EXISTS]\n USER() IDENTIFIED BY \'auth_string\'\n\nuser:\n (see )\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\npassword_option: {\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n}\n\nlock_option: {\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nThe ALTER USER statement modifies MySQL accounts. It enables\nauthentication, SSL/TLS, resource-limit, and password-management\nproperties to be modified for existing accounts, and enables account\nlocking and unlocking.\n\nTo use ALTER USER, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql system database. When the read_only\nsystem variable is enabled, ALTER USER additionally requires the SUPER\nprivilege.\n\nBy default, an error occurs if you try to modify a user that does not\nexist. If the IF EXISTS clause is given, the statement produces a\nwarning for each named user that does not exist, rather than an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-user.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (566,12,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.7/en/encrypted-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0 to 9) from the DES key file is used. With a key_str argument, the\ngiven key string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\n*Note*:\n\nThe DES_ENCRYPT() and DES_DECRYPT() functions are deprecated as of\nMySQL 5.7.6, will be removed in a future MySQL release, and should no\nlonger be used. Consider using AES_ENCRYPT() and AES_DECRYPT() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (567,3,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (568,7,'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS','Syntax:\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(gtid_set[, timeout][,channel])\n\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() is similar to\nWAIT_FOR_EXECUTED_GTID_SET() in that it waits until all of the\ntransactions whose global transaction identifiers are contained in\ngtid_set have been applied, or until timeout seconds have elapsed,\nwhichever occurs first. However, WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS()\napplies to a specific replication channel, and stops only after the\ntransactions have been applied on the specified channel, for which the\napplier must be running. In contrast, WAIT_FOR_EXECUTED_GTID_SET()\nstops after the transactions have been applied, regardless of where\nthey were applied (on any replication channel or any user client), and\nwhether or not any replication channels are running.\n\nThe channel option names which replication channel the function applies\nto. If no channel is named and no channels other than the default\nreplication channel exist, the function applies to the default\nreplication channel. If multiple replication channels exist, you must\nspecify a channel as otherwise it is not known which replication\nchannel the function applies to. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information on replication channels.\n\n*Note*:\n\nBecause WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() applies to a specific\nreplication channel, if an expected transaction arrives on a different\nreplication channel or from a user client, for example in a failover or\nmanual recovery situation, the function can hang indefinitely if no\ntimeout is set. Use WAIT_FOR_EXECUTED_GTID_SET() instead to ensure\ncorrect handling of transactions in these situations.\n\nGTID sets used with WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() are represented\nas strings and must be quoted in the same way as for\nWAIT_FOR_EXECUTED_GTID_SET(). For WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(),\nthe return value for the function is an arbitrary positive number. If\nGTID-based replication is not active (that is, if the value of the\ngtid_mode variable is OFF), then this value is undefined and\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() returns NULL. If the slave is not\nrunning then the function also returns NULL.\n\ngtid_mode cannot be changed to OFF while any client is using this\nfunction to wait for GTIDs to be applied.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (569,38,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multibyte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (570,38,'WEIGHT_STRING','Syntax:\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n\nlevels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nThis function returns the weight string for the input string. The\nreturn value is a binary string that represents the comparison and\nsorting value of the string. It has these properties:\n\no If WEIGHT_STRING(str1) = WEIGHT_STRING(str2), then str1 = str2 (str1\n and str2 are considered equal)\n\no If WEIGHT_STRING(str1) < WEIGHT_STRING(str2), then str1 < str2 (str1\n sorts before str2)\n\nWEIGHT_STRING() is a debugging function intended for internal use. Its\nbehavior can change without notice between MySQL versions. It can be\nused for testing and debugging of collations, especially if you are\nadding a new collation. See\nhttp://dev.mysql.com/doc/refman/5.7/en/adding-collation.html.\n\nThis list briefly summarizes the arguments. More details are given in\nthe discussion following the list.\n\no str: The input string expression.\n\no AS clause: Optional; cast the input string to a given type and\n length.\n\no LEVEL clause: Optional; specify weight levels for the return value.\n\no flags: Optional; unused.\n\nThe input string, str, is a string expression. If the input is a\nnonbinary (character) string such as a CHAR, VARCHAR, or TEXT value,\nthe return value contains the collation weights for the string. If the\ninput is a binary (byte) string such as a BINARY, VARBINARY, or BLOB\nvalue, the return value is the same as the input (the weight for each\nbyte in a binary string is the byte value). If the input is NULL,\nWEIGHT_STRING() returns NULL.\n\nExamples:\n\nmysql> SET @s = _latin1 \'AB\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = _latin1 \'ab\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'AB\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'ab\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 6162 |\n+------+---------+------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (571,31,'ST_EQUALS','ST_Equals(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_Equals(@g1, @g1), ST_Equals(@g1, @g2);\n+---------------------+---------------------+\n| ST_Equals(@g1, @g1) | ST_Equals(@g1, @g2) |\n+---------------------+---------------------+\n| 1 | 0 |\n+---------------------+---------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (572,40,'ALTER EVENT','Syntax:\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'string\']\n [DO event_body]\n\nThe ALTER EVENT statement changes one or more of the characteristics of\nan existing event without the need to drop and recreate it. The syntax\nfor each of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE /\nDISABLE, and DO clauses is exactly the same as when used with CREATE\nEVENT. (See [HELP CREATE EVENT].)\n\nAny user can alter an event defined on a database for which that user\nhas the EVENT privilege. When a user executes a successful ALTER EVENT\nstatement, that user becomes the definer for the affected event.\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n > ON SCHEDULE \n > EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-event.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (573,32,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (574,19,'|','Syntax:\n|\n\nBitwise OR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (575,7,'ASYMMETRIC_SIGN','Syntax:\nASYMMETRIC_SIGN(algorithm, digest_str, priv_key_str, digest_type)\n\nSigns a digest string using a private key string, and returns the\nsignature as a binary string. If signing fails, the result is NULL.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\npriv_key_str is the private key string to use for signing the digest\nstring. It must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nFor a usage example, see the description of ASYMMETRIC_VERIFY().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (576,4,'GEOMFROMTEXT','GeomFromText(wkt[, srid]), GeometryFromText(wkt[, srid])\n\nST_GeomFromText(), ST_GeometryFromText(), GeomFromText(), and\nGeometryFromText() are synonyms. For more information, see the\ndescription of ST_GeomFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (577,14,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer.\nValues returned by UUID_SHORT() differ from the string-format 128-bit\nidentifiers returned by the UUID() function and have different\nuniqueness properties. The value of UUID_SHORT() is guaranteed to be\nunique if the following conditions hold:\n\no The server_id value of the current server is between 0 and 255 and is\n unique among your set of master and slave servers\n\no You do not set back the system time for your server host between\n mysqld restarts\n\no You invoke UUID_SHORT() on average fewer than 16 million times per\n second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (578,32,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 − expr2 expressed as a value in days from\none date to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n -> -31\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (579,40,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-procedure.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (580,7,'ST_LATFROMGEOHASH','ST_LatFromGeoHash(geohash_str)\n\nReturns the latitude from a geohash string value, as a DOUBLE value in\nthe range [−90, 90].\n\nIf the argument is NULL, the return value is NULL. If the argument is\ninvalid, an error occurs.\n\nThe ST_LatFromGeoHash() decoding function reads no more than 433\ncharacters from the geohash_str argument. That represents the upper\nlimit on information in the internal representation of coordinate\nvalues. Characters past the 433rd are ignored, even if they are\notherwise illegal and produce an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SELECT ST_LatFromGeoHash(ST_GeoHash(45,-20,10));\n+------------------------------------------+\n| ST_LatFromGeoHash(ST_GeoHash(45,-20,10)) |\n+------------------------------------------+\n| -20 |\n+------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (581,7,'ST_GEOMFROMGEOJSON','ST_GeomFromGeoJSON(str [, options [, srid]])\n\nParses a string str representing a GeoJSON object and returns a\ngeometry.\n\nIf any argument is NULL, the return value is NULL. If any non-NULL\nargument is invalid, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html\n\n','mysql> SET @json = \'{ "type": "Point", "coordinates": [102.0, 0.0]}\';\nmysql> SELECT ST_AsText(ST_GeomFromGeoJSON(@json));\n+--------------------------------------+\n| ST_AsText(ST_GeomFromGeoJSON(@json)) |\n+--------------------------------------+\n| POINT(102 0) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (582,5,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin system table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.7/en/plugin-data-structures.html).\nPlugin names are not case-sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a chance to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\nsystem table. At server startup, the server loads and initializes any\nplugin that is listed in mysql.plugin. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/install-plugin.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (583,24,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor and associates it with a SELECT\nstatement that retrieves the rows to be traversed by the cursor. To\nfetch the rows later, use a FETCH statement. The number of columns\nretrieved by the SELECT statement must match the number of output\nvariables specified in the FETCH statement.\n\nThe SELECT statement cannot have an INTO clause.\n\nCursor declarations must appear before handler declarations and after\nvariable and condition declarations.\n\nA stored program may contain multiple cursor declarations, but each\ncursor declared in a given block must have a unique name. For an\nexample, see http://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/declare-cursor.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (584,28,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number {LINES | ROWS}]\n [(col_name_or_user_var\n [, col_name_or_user_var] ...)]\n [SET col_name={expr | DEFAULT},\n [, col_name={expr | DEFAULT}] ...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. LOAD DATA INFILE is the complement of SELECT ...\nINTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.7/en/select-into.html.) To write data\nfrom a table to a file, use SELECT ... INTO OUTFILE. To read the file\nback into a table, use LOAD DATA INFILE. The syntax of the FIELDS and\nLINES clauses is the same for both statements. Both clauses are\noptional, but FIELDS must precede LINES if both are specified.\n\nYou can also load data files by using the mysqlimport utility; it\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol. See http://dev.mysql.com/doc/refman/5.7/en/mysqlimport.html.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-optimization.html.\n\nThe file name must be given as a literal string. On Windows, specify\nbackslashes in path names as forward slashes or doubled backslashes.\nThe character_set_filesystem system variable controls the\ninterpretation of the file name.\n\nLOAD DATA supports explicit partition selection using the PARTITION\noption with a list of one or more comma-separated names of partitions,\nsubpartitions, or both. When this option is used, if any rows from the\nfile cannot be inserted into any of the partitions or subpartitions\nnamed in the list, the statement fails with the error Found a row not\nmatching the given partition set. For more information and examples,\nsee http://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nFor partitioned tables using storage engines that employ table locks,\nsuch as MyISAM, LOAD DATA cannot prune any partition locks. This does\nnot apply to tables using storage engines which employ row-level\nlocking, such as InnoDB. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-locking\n.html.\n\nThe server uses the character set indicated by the\ncharacter_set_database system variable to interpret the information in\nthe file. SET NAMES and the setting of character_set_client do not\naffect interpretation of input. If the contents of the input file use a\ncharacter set that differs from the default, it is usually preferable\nto specify the character set of the file by using the CHARACTER SET\nclause. A character set of binary specifies "no conversion."\n\nLOAD DATA INFILE interprets all fields in the file as having the same\ncharacter set, regardless of the data types of the columns into which\nfield values are loaded. For proper interpretation of file contents,\nyou must ensure that it was written with the correct character set. For\nexample, if you write a data file with mysqldump -T or by issuing a\nSELECT ... INTO OUTFILE statement in mysql, be sure to use a\n--default-character-set option so that output is written in the\ncharacter set to be used when the file is loaded with LOAD DATA INFILE.\n\n*Note*:\n\nIt is not possible to load data files that use the ucs2, utf16,\nutf16le, or utf32 character set.\n\nIf you use LOW_PRIORITY, execution of the LOAD DATA statement is\ndelayed until no other clients are reading from the table. This affects\nonly storage engines that use only table-level locking (such as MyISAM,\nMEMORY, and MERGE).\n\nIf you specify CONCURRENT with a MyISAM table that satisfies the\ncondition for concurrent inserts (that is, it contains no free blocks\nin the middle), other threads can retrieve data from the table while\nLOAD DATA is executing. This option affects the performance of LOAD\nDATA a bit, even if no other thread is using the table at the same\ntime.\n\nWith row-based replication, CONCURRENT is replicated regardless of\nMySQL version. With statement-based replication CONCURRENT is not\nreplicated prior to MySQL 5.5.1 (see Bug #34628). For more information,\nsee\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-features-load-data.h\ntml.\n\nThe LOCAL keyword affects expected location of the file and error\nhandling, as described later. LOCAL works only if your server and your\nclient both have been configured to permit it. For example, if mysqld\nwas started with the local_infile system variable disabled, LOCAL does\nnot work. See\nhttp://dev.mysql.com/doc/refman/5.7/en/load-data-local.html.\n\nThe LOCAL keyword affects where the file is expected to be found:\n\no If LOCAL is specified, the file is read by the client program on the\n client host and sent to the server. The file can be given as a full\n path name to specify its exact location. If given as a relative path\n name, the name is interpreted relative to the directory in which the\n client program was started.\n\n When using LOCAL with LOAD DATA, a copy of the file is created in the\n directory where the MySQL server stores temporary files. See\n http://dev.mysql.com/doc/refman/5.7/en/temporary-files.html. Lack of\n sufficient space for the copy in this directory can cause the LOAD\n DATA LOCAL statement to fail.\n\no If LOCAL is not specified, the file must be located on the server\n host and is read directly by the server. The server uses the\n following rules to locate the file:\n\n o If the file name is an absolute path name, the server uses it as\n given.\n\n o If the file name is a relative path name with one or more leading\n components, the server searches for the file relative to the\n server\'s data directory.\n\n o If a file name with no leading components is given, the server\n looks for the file in the database directory of the default\n database.\n\nIn the non-LOCAL case, these rules mean that a file named as\n./myfile.txt is read from the server\'s data directory, whereas the file\nnamed as myfile.txt is read from the database directory of the default\ndatabase. For example, if db1 is the default database, the following\nLOAD DATA statement reads the file data.txt from the database directory\nfor db1, even though the statement explicitly loads the file into a\ntable in the db2 database:\n\nLOAD DATA INFILE \'data.txt\' INTO TABLE db2.my_table;\n\nNon-LOCAL load operations read text files located on the server. For\nsecurity reasons, such operations require that you have the FILE\nprivilege. See\nhttp://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html. Also,\nnon-LOCAL load operations are subject to the secure_file_priv system\nvariable setting. If the variable value is a nonempty directory name,\nthe file to be loaded must be located in that directory. If the\nvariable value is empty (which is insecure), the file need only be\nreadable by the server.\n\nUsing LOCAL is a bit slower than letting the server access the files\ndirectly, because the contents of the file must be sent over the\nconnection by the client to the server. On the other hand, you do not\nneed the FILE privilege to load local files.\n\nLOCAL also affects error handling:\n\no With LOAD DATA INFILE, data-interpretation and duplicate-key errors\n terminate the operation.\n\no With LOAD DATA LOCAL INFILE, data-interpretation and duplicate-key\n errors become warnings and the operation continues because the server\n has no way to stop transmission of the file in the middle of the\n operation. For duplicate-key errors, this is the same as if IGNORE is\n specified. IGNORE is explained further later in this section.\n\nThe REPLACE and IGNORE keywords control handling of input rows that\nduplicate existing rows on unique key values:\n\no If you specify REPLACE, input rows replace existing rows. In other\n words, rows that have the same value for a primary key or unique\n index as an existing row. See [HELP REPLACE].\n\no If you specify IGNORE, rows that duplicate an existing row on a\n unique key value are discarded. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#ignore-strict-co\n mparison.\n\no If you do not specify either option, the behavior depends on whether\n the LOCAL keyword is specified. Without LOCAL, an error occurs when a\n duplicate key value is found, and the rest of the text file is\n ignored. With LOCAL, the default behavior is the same as if IGNORE is\n specified; this is because the server has no way to stop transmission\n of the file in the middle of the operation.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/load-data.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (585,32,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME([fsp])\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (586,33,'ST_GEOMFROMWKB','ST_GeomFromWKB(wkb[, srid]), ST_GeometryFromWKB(wkb[, srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (587,12,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a string of\n40 hexadecimal digits, or NULL if the argument was NULL. One of the\npossible uses for this function is as a hash key. See the notes at the\nbeginning of this section about storing hash values efficiently. SHA()\nis synonymous with SHA1().\n\nThe return value is a string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (588,23,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 − 1) bytes. Each\nBLOB value is stored using a 2-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (589,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\n*Note*:\n\nThis function is deprecated as of MySQL 5.7.6 and will be removed in a\nfuture MySQL release.\n\nReturns a hashed password string calculated from the cleartext password\nstr. The return value is a string in the connection character set, or\nNULL if the argument is NULL. This function is the SQL interface to the\nalgorithm used by the server to encrypt MySQL passwords for storage in\nthe mysql.user grant table.\n\nThe old_passwords system variable controls the password hashing method\nused by the PASSWORD() function. It also influences password hashing\nperformed by CREATE USER and GRANT statements that specify a password\nusing an IDENTIFIED BY clause.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (590,32,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (591,37,'DIMENSION','Dimension(g)\n\nST_Dimension() and Dimension() are synonyms. For more information, see\nthe description of ST_Dimension().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (592,23,'BIT','BIT[(M)]\n\nA bit-value type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (593,8,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER [CONVERT XID]\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (X\'6162\', 0x6162), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nXA START xid starts an XA transaction with the given xid value. Each XA\ntransaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.7/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------+\n| 7 | 3 | 3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nXID values may contain nonprintable characters. As of MySQL 5.7.5, XA\nRECOVER permits an optional CONVERT XID clause so that clients can\nrequest XID values in hexadecimal.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/xa-statements.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (594,7,'EQUALS','Equals(g1, g2)\n\nMBREquals() and Equals() are synonyms. For more information, see the\ndescription of MBREquals().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (595,2,'CENTROID','Centroid({poly|mpoly})\n\nST_Centroid() and Centroid() are synonyms. For more information, see\nthe description of ST_Centroid().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (596,38,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (597,32,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP([fsp])\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether the function\nis used in a string or numeric context.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (598,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str[,init_vector])\n\nAES_ENCRYPT() and AES_DECRYPT() implement encryption and decryption of\ndata using the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." The AES standard permits various key\nlengths. By default these functions implement AES with a 128-bit key\nlength. As of MySQL 5.7.4, key lengths of 196 or 256 bits can be used,\nas described later. The key length is a trade off between performance\nand security.\n\nAES_ENCRYPT() encrypts the string str using the key string key_str and\nreturns a binary string containing the encrypted output. AES_DECRYPT()\ndecrypts the encrypted string crypt_str using the key string key_str\nand returns the original cleartext string. If either function argument\nis NULL, the function returns NULL.\n\nThe str and crypt_str arguments can be any length, and padding is\nautomatically added to str so it is a multiple of a block as required\nby block-based algorithms such as AES. This padding is automatically\nremoved by the AES_DECRYPT() function. The length of crypt_str can be\ncalculated using this formula:\n\n16 * (trunc(string_length / 16) + 1)\n\nFor a key length of 128 bits, the most secure way to pass a key to the\nkey_str argument is to create a truly random 128-bit value and pass it\nas a binary value. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\',UNHEX(\'F3229A0B371ED2D9441B830D21A390C3\')));\n\nA passphrase can be used to generate an AES key by hashing the\npassphrase. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\', UNHEX(SHA2(\'My secret passphrase\',512))));\n\nDo not pass a password or passphrase directly to crypt_str, hash it\nfirst. Previous versions of this documentation suggested the former\napproach, but it is no longer recommended as the examples shown here\nare more secure.\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nAs of MySQL 5.7.4, AES_ENCRYPT() and AES_DECRYPT() permit control of\nthe block encryption mode and take an optional init_vector\ninitialization vector argument:\n\no The block_encryption_mode system variable controls the mode for\n block-based encryption algorithms. Its default value is aes-128-ecb,\n which signifies encryption using a key length of 128 bits and ECB\n mode. For a description of the permitted values of this variable, see\n http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\no The optional init_vector argument provides an initialization vector\n for block encryption modes that require it.\n\nFor modes that require the optional init_vector argument, it must be 16\nbytes or longer (bytes in excess of 16 are ignored). An error occurs if\ninit_vector is missing.\n\nFor modes that do not require init_vector, it is ignored and a warning\nis generated if it is specified.\n\nA random string of bytes to use for the initialization vector can be\nproduced by calling RANDOM_BYTES(16). For encryption modes that require\nan initialization vector, the same vector must be used for encryption\nand decryption.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SET block_encryption_mode = \'aes-256-cbc\';\nmysql> SET @key_str = SHA2(\'My secret passphrase\',512);\nmysql> SET @init_vector = RANDOM_BYTES(16);\nmysql> SET @crypt_str = AES_ENCRYPT(\'text\',@key_str,@init_vector);\nmysql> SELECT AES_DECRYPT(@crypt_str,@key_str,@init_vector);\n+-----------------------------------------------+\n| AES_DECRYPT(@crypt_str,@key_str,@init_vector) |\n+-----------------------------------------------+\n| text |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (599,3,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (600,7,'GTID_SUBTRACT','Syntax:\nGTID_SUBTRACT(set1,set2)\n\nGiven two sets of global transaction IDs set1 and set2, returns only\nthose GTIDs from set1 that are not in set2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:22-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:26-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:21-22:25-57\n1 row in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (601,14,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric IPv4 network address in network byte order, returns the\ndotted-quad string representation of the address as a string in the\nconnection character set. INET_NTOA() returns NULL if it does not\nunderstand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(167773449);\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (602,32,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n -> 7\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (603,3,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n -> 2\nmysql> SELECT CEILING(-1.23);\n -> -1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (604,27,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows which threads are running. If you have the\nPROCESS privilege, you can see all threads. Otherwise, you can see only\nyour own threads (that is, threads associated with the MySQL account\nthat you are using). If you do not use the FULL keyword, only the first\n100 characters of each statement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-processlist.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (605,33,'LINEFROMWKB','LineFromWKB(wkb[, srid]), LineStringFromWKB(wkb[, srid])\n\nST_LineFromWKB(), ST_LineStringFromWKB(), LineFromWKB(), and\nLineStringFromWKB() are synonyms. For more information, see the\ndescription of ST_LineFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (606,37,'GEOMETRYTYPE','GeometryType(g)\n\nST_GeometryType() and GeometryType() are synonyms. For more\ninformation, see the description of ST_GeometryType().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (607,40,'CREATE VIEW','Syntax:\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\nview if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW replaces it.\n\nFor information about restrictions on view use, see\nhttp://dev.mysql.com/doc/refman/5.7/en/view-restrictions.html.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (Selecting from the view selects, in effect, using the\nSELECT statement.) The select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time and is not affected by\nsubsequent changes to the definitions of the underlying tables. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view, and columns dropped\nfrom the table will result in an error when selecting from the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement, you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view. CREATE VIEW might also\nrequire the SUPER privilege, depending on the DEFINER value, as\ndescribed later in this section.\n\nWhen a view is referenced, privilege checking occurs as described later\nin this section.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nuse db_name.view_name syntax to qualify the view name with the database\nname:\n\nCREATE VIEW test.v AS SELECT * FROM t;\n\nUnqualified table or view names in the SELECT statement are also\ninterpreted with respect to the default database. A view can refer to\ntables or views in other databases by qualifying the table or view name\nwith the appropriate database name.\n\nWithin a database, base tables and views share the same namespace, so a\nbase table and a view cannot have the same name.\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns, or expressions that use functions, constant values,\noperators, and so forth.\n\nA view must have unique column names with no duplicates, just like a\nbase table. By default, the names of the columns retrieved by the\nSELECT statement are used for the view column names. To define explicit\nnames for the view columns, specify the optional column_list clause as\na list of comma-separated identifiers. The number of names in\ncolumn_list must be the same as the number of columns retrieved by the\nSELECT statement.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables:\n\nCREATE VIEW v_today (today) AS SELECT CURRENT_DATE;\n\nThe following example defines a view that selects two columns from\nanother table as well as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot refer to system variables or user-defined\n variables.\n\no Within a stored program, the SELECT statement cannot refer to program\n parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. If, after\n the view has been created, a table or view that the definition refers\n to is dropped, use of the view results in an error. To check a view\n definition for problems of this kind, use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n create a TEMPORARY view.\n\no You cannot associate a trigger with a view.\n\no Aliases for column names in the SELECT statement are checked against\n the maximum column length of 64 characters (not the maximum alias\n length of 256 characters).\n\nORDER BY is permitted in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nThe results obtained from a view may be affected if you change the\nquery processing environment by changing system variables:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. The valid SQL SECURITY\ncharacteristic values are DEFINER (the default) and INVOKER. These\nindicate that the required privileges must be held by the user who\ndefined or invoked the view, respectively.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount specified as \'user_name\'@\'host_name\', CURRENT_USER, or\nCURRENT_USER(). The default DEFINER value is the user who executes the\nCREATE VIEW statement. This is the same as specifying DEFINER =\nCURRENT_USER explicitly.\n\nIf the DEFINER clause is present, these rules determine the valid\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only valid user value is\n your own account, either specified literally or by using\n CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n valid account name. If the account does not exist, a warning is\n generated.\n\no Although it is possible to create a view with a nonexistent DEFINER\n account, an error occurs when the view is referenced if the SQL\n SECURITY value is DEFINER but the definer account does not exist.\n\nFor more information about view security, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-security.html.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default. For views defined with the SQL SECURITY INVOKER\ncharacteristic, CURRENT_USER returns the account for the view\'s\ninvoker. For information about user auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.7/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a routine, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nMySQL checks view privileges like this:\n\no At view definition time, the view creator must have the privileges\n needed to use the top-level objects accessed by the view. For\n example, if the view definition refers to table columns, the creator\n must have some privilege for each column in the select list of the\n definition, and the SELECT privilege for each column used elsewhere\n in the definition. If the definition refers to a stored function,\n only the privileges needed to invoke the function can be checked. The\n privileges required at function invocation time can be checked only\n as it executes: For different invocations, different execution paths\n within the function might be taken.\n\no The user who references a view must have appropriate privileges to\n access it (SELECT to select from it, INSERT to insert into it, and so\n forth.)\n\no When a view has been referenced, privileges for objects accessed by\n the view are checked against the privileges held by the view DEFINER\n account or invoker, depending on whether the SQL SECURITY\n characteristic is DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n privilege checking for statements executed within the function depend\n on whether the function SQL SECURITY characteristic is DEFINER or\n INVOKER. If the security characteristic is DEFINER, the function runs\n with the privileges of the DEFINER account. If the characteristic is\n INVOKER, the function runs with the privileges determined by the\n view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY DEFINER. The standard says that the definer of the view,\nwhich is the same as the owner of the view\'s schema, gets applicable\nprivileges on the view (for example, SELECT) and may grant them. MySQL\nhas no concept of a schema "owner", so MySQL adds a clause to identify\nthe definer. The DEFINER clause is an extension where the intent is to\nhave what the standard has; that is, a permanent record of who defined\nthe view. This is why the default DEFINER value is the account of the\nview creator.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/view-algorithms.html, as well as\nhttp://dev.mysql.com/doc/refman/5.7/en/derived-table-optimization.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nA generated column in a view is considered updatable because it is\npossible to assign to it. However, if such a column is updated\nexplicitly, the only permitted value is DEFAULT. For information about\ngenerated columns, see\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.h\ntml.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.7/en/view-updatability.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/view-check-option.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-view.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (608,38,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT TRIM(\' bar \');\n -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (609,14,'INET6_NTOA','Syntax:\nINET6_NTOA(expr)\n\nGiven an IPv6 or IPv4 network address represented in numeric form as a\nbinary string, returns the string representation of the address as a\nstring in the connection character set. If the argument is not a valid\naddress, INET6_NTOA() returns NULL.\n\nINET6_NTOA() has these properties:\n\no It does not use operating system functions to perform conversions,\n thus the output string is platform independent.\n\no The return string has a maximum length of 39 (4 x 8 + 7). Given this\n statement:\n\nCREATE TABLE t AS SELECT INET6_NTOA(expr) AS c1;\n\n The resulting table would have this definition:\n\nCREATE TABLE t (c1 VARCHAR(39) CHARACTER SET utf8 DEFAULT NULL);\n\no The return string uses lowercase letters for IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT INET6_NTOA(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(INET6_ATON(\'10.0.5.9\'));\n -> \'10.0.5.9\'\n\nmysql> SELECT INET6_NTOA(UNHEX(\'FDFE0000000000005A55CAFFFEFA9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(UNHEX(\'0A000509\'));\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (610,24,'SIGNAL','Syntax:\nSIGNAL condition_value\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nSIGNAL is the way to "return" an error. SIGNAL provides error\ninformation to a handler, to an outer portion of the application, or to\nthe client. Also, it provides control over the error\'s characteristics\n(error number, SQLSTATE value, message). Without SIGNAL, it is\nnecessary to resort to workarounds such as deliberately referring to a\nnonexistent table to cause a routine to return an error.\n\nNo special privileges are required to execute the SIGNAL statement.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html.\n\nThe condition_value in a SIGNAL statement indicates the error value to\nbe returned. It can be an SQLSTATE value (a 5-character string literal)\nor a condition_name that refers to a named condition previously defined\nwith DECLARE ... CONDITION (see [HELP DECLARE CONDITION]).\n\nAn SQLSTATE value can indicate errors, warnings, or "not found." The\nfirst two characters of the value indicate its error class, as\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/signal.html#signal-condition-inf\normation-items. Some signal values cause statement termination; see\nhttp://dev.mysql.com/doc/refman/5.7/en/signal.html#signal-effects.\n\nThe SQLSTATE value for a SIGNAL statement should not start with \'00\'\nbecause such values indicate success and are not valid for signaling an\nerror. This is true whether the SQLSTATE value is specified directly in\nthe SIGNAL statement or in a named condition referred to in the\nstatement. If the value is invalid, a Bad SQLSTATE error occurs.\n\nTo signal a generic SQLSTATE value, use \'45000\', which means "unhandled\nuser-defined exception."\n\nThe SIGNAL statement optionally includes a SET clause that contains\nmultiple signal items, in a comma-separated list of\ncondition_information_item_name = simple_value_specification\nassignments.\n\nEach condition_information_item_name may be specified only once in the\nSET clause. Otherwise, a Duplicate condition information item error\noccurs.\n\nValid simple_value_specification designators can be specified using\nstored procedure or function parameters, stored program local variables\ndeclared with DECLARE, user-defined variables, system variables, or\nliterals. A character literal may include a _charset introducer.\n\nFor information about permissible condition_information_item_name\nvalues, see\nhttp://dev.mysql.com/doc/refman/5.7/en/signal.html#signal-condition-inf\normation-items.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/signal.html\n\n','CREATE PROCEDURE p (pval INT)\nBEGIN\n DECLARE specialty CONDITION FOR SQLSTATE \'45000\';\n IF pval = 0 THEN\n SIGNAL SQLSTATE \'01000\';\n ELSEIF pval = 1 THEN\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSEIF pval = 2 THEN\n SIGNAL specialty\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSE\n SIGNAL SQLSTATE \'01000\'\n SET MESSAGE_TEXT = \'A warning occurred\', MYSQL_ERRNO = 1000;\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\', MYSQL_ERRNO = 1001;\n END IF;\nEND;\n','http://dev.mysql.com/doc/refman/5.7/en/signal.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (611,8,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/savepoint.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (612,26,'ST_NUMGEOMETRIES','ST_NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT ST_NumGeometries(ST_GeomFromText(@gc));\n+----------------------------------------+\n| ST_NumGeometries(ST_GeomFromText(@gc)) |\n+----------------------------------------+\n| 2 |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (613,7,'JSON_DEPTH','Syntax:\nJSON_DEPTH(json_doc)\n\nReturns the maximum depth of a JSON document. Returns NULL if the\nargument is NULL. An error occurs if the argument is not a valid JSON\ndocument.\n\nAn empty array, empty object, or scalar value has depth 1. A nonempty\narray containing only elements of depth 1 or nonempty object containing\nonly member values of depth 1 has depth 2. Otherwise, a JSON document\nhas depth greater than 2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','mysql> SELECT JSON_DEPTH(\'{}\'), JSON_DEPTH(\'[]\'), JSON_DEPTH(\'true\');\n+------------------+------------------+--------------------+\n| JSON_DEPTH(\'{}\') | JSON_DEPTH(\'[]\') | JSON_DEPTH(\'true\') |\n+------------------+------------------+--------------------+\n| 1 | 1 | 1 |\n+------------------+------------------+--------------------+\nmysql> SELECT JSON_DEPTH(\'[10, 20]\'), JSON_DEPTH(\'[[], {}]\');\n+------------------------+------------------------+\n| JSON_DEPTH(\'[10, 20]\') | JSON_DEPTH(\'[[], {}]\') |\n+------------------------+------------------------+\n| 2 | 2 |\n+------------------------+------------------------+\nmysql> SELECT JSON_DEPTH(\'[10, {"a": 20}]\');\n+-------------------------------+\n| JSON_DEPTH(\'[10, {"a": 20}]\') |\n+-------------------------------+\n| 3 |\n+-------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (614,24,'LABELS','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nLabels are permitted for BEGIN ... END blocks and for the LOOP, REPEAT,\nand WHILE statements. Label use for those statements follows these\nrules:\n\no begin_label must be followed by a colon.\n\no begin_label can be given without end_label. If end_label is present,\n it must be the same as begin_label.\n\no end_label cannot be given without begin_label.\n\no Labels at the same nesting level must be distinct.\n\no Labels can be up to 16 characters long.\n\nTo refer to a label within the labeled construct, use an ITERATE or\nLEAVE statement. The following example uses those statements to\ncontinue iterating or terminate the loop:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\nEND;\n\nThe scope of a block label does not include the code for handlers\ndeclared within the block. For details, see [HELP DECLARE HANDLER].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/statement-labels.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/statement-labels.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (615,33,'MPOINTFROMWKB','MPointFromWKB(wkb[, srid]), MultiPointFromWKB(wkb[, srid])\n\nST_MPointFromWKB(), ST_MultiPointFromWKB(), MPointFromWKB(), and\nMultiPointFromWKB() are synonyms. For more information, see the\ndescription of ST_MPointFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (616,40,'ALTER TABLE','Syntax:\nALTER TABLE tbl_name\n [alter_specification [, alter_specification] ...]\n [partition_options]\n\nalter_specification:\n table_options\n | ADD [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | ADD [COLUMN] (col_name column_definition,...)\n | ADD {INDEX|KEY} [index_name]\n [index_type] (key_part,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (key_part,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (key_part,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (key_part,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (key_part,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [index_name] (col_name,...)\n reference_definition\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n | CHANGE [COLUMN] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | {DISABLE|ENABLE} KEYS\n | {DISCARD|IMPORT} TABLESPACE\n | DROP [COLUMN] col_name\n | DROP {INDEX|KEY} index_name\n | DROP PRIMARY KEY\n | DROP FOREIGN KEY fk_symbol\n | FORCE\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | MODIFY [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | ORDER BY col_name [, col_name] ...\n | RENAME {INDEX|KEY} old_index_name TO new_index_name\n | RENAME [TO|AS] new_tbl_name\n | {WITHOUT|WITH} VALIDATION\n | ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | DISCARD PARTITION {partition_names | ALL} TABLESPACE\n | IMPORT PARTITION {partition_names | ALL} TABLESPACE\n | TRUNCATE PARTITION {partition_names | ALL}\n | COALESCE PARTITION number\n | REORGANIZE PARTITION partition_names INTO (partition_definitions)\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name [{WITH|WITHOUT} VALIDATION]\n | ANALYZE PARTITION {partition_names | ALL}\n | CHECK PARTITION {partition_names | ALL}\n | OPTIMIZE PARTITION {partition_names | ALL}\n | REBUILD PARTITION {partition_names | ALL}\n | REPAIR PARTITION {partition_names | ALL}\n | REMOVE PARTITIONING\n | UPGRADE PARTITIONING\n\nkey_part:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | COMPRESSION [=] {\'ZLIB\'|\'LZ4\'|\'NONE\'}\n | CONNECTION [=] \'connect_string\'\n | {DATA|INDEX} DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTION [=] {\'Y\' | \'N\'}\n | ENGINE [=] engine_name\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] value\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n (see CREATE TABLE options)\n\nALTER TABLE changes the structure of a table. For example, you can add\nor delete columns, create or destroy indexes, change the type of\nexisting columns, or rename columns or the table itself. You can also\nchange characteristics such as the storage engine used for the table or\nthe table comment.\n\no To use ALTER TABLE, you need ALTER, CREATE, and INSERT privileges for\n the table. Renaming a table requires ALTER and DROP on the old table,\n ALTER, CREATE, and INSERT on the new table.\n\no Following the table name, specify the alterations to be made. If none\n are given, ALTER TABLE does nothing.\n\no The syntax for many of the permissible alterations is similar to\n clauses of the CREATE TABLE statement. column_definition clauses use\n the same syntax for ADD and CHANGE as for CREATE TABLE. For more\n information, see [HELP CREATE TABLE].\n\no The word COLUMN is optional and can be omitted.\n\no Multiple ADD, ALTER, DROP, and CHANGE clauses are permitted in a\n single ALTER TABLE statement, separated by commas. This is a MySQL\n extension to standard SQL, which permits only one of each clause per\n ALTER TABLE statement. For example, to drop multiple columns in a\n single statement, do this:\n\nALTER TABLE t2 DROP COLUMN c, DROP COLUMN d;\n\no If a storage engine does not support an attempted ALTER TABLE\n operation, a warning may result. Such warnings can be displayed with\n SHOW WARNINGS. See [HELP SHOW WARNINGS]. For information on\n troubleshooting ALTER TABLE, see\n http://dev.mysql.com/doc/refman/5.7/en/alter-table-problems.html.\n\no For information about generated columns, see\n http://dev.mysql.com/doc/refman/5.7/en/alter-table-generated-columns.\n html.\n\no For usage examples, see\n http://dev.mysql.com/doc/refman/5.7/en/alter-table-examples.html.\n\no With the mysql_info() C API function, you can find out how many rows\n were copied by ALTER TABLE. See\n http://dev.mysql.com/doc/refman/5.7/en/mysql-info.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (617,23,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (618,4,'ST_MLINEFROMTEXT','ST_MLineFromText(wkt[, srid]), ST_MultiLineStringFromText(wkt[, srid])\n\nConstructs a MultiLineString value using its WKT representation and\nSRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (619,20,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (620,21,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n\nANALYZE TABLE performs a key distribution analysis and stores the\ndistribution for the named table or tables. For MyISAM tables, this\nstatement is equivalent to using myisamchk --analyze.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE works with InnoDB, NDB, and MyISAM tables. It does not\nwork with views.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-maintenance.html.\n\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM.\n\nBy default, the server writes ANALYZE TABLE statements to the binary\nlog so that they replicate to replication slaves. To suppress logging,\nspecify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/analyze-table.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (621,2,'ST_EXTERIORRING','ST_ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly)));\n+----------------------------------------------------+\n| ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly))) |\n+----------------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (622,38,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT FIELD(\'Bb\', \'Aa\', \'Bb\', \'Cc\', \'Dd\', \'Ff\');\n -> 2\nmysql> SELECT FIELD(\'Gg\', \'Aa\', \'Bb\', \'Cc\', \'Dd\', \'Ff\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (623,40,'CONSTRAINT','MySQL supports foreign keys, which let you cross-reference related data\nacross tables, and foreign key constraints, which help keep this\nspread-out data consistent. The essential syntax for a foreign key\nconstraint definition in a CREATE TABLE or ALTER TABLE statement looks\nlike this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (col_name, ...)\n REFERENCES tbl_name (col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html\n\n','CREATE TABLE product (\n category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)\n) ENGINE=INNODB;\n\nCREATE TABLE customer (\n id INT NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=INNODB;\n\nCREATE TABLE product_order (\n 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\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n INDEX (customer_id),\n\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)\n) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (624,7,'CREATE_ASYMMETRIC_PRIV_KEY','Syntax:\nCREATE_ASYMMETRIC_PRIV_KEY(algorithm, {key_len|dh_secret})\n\nCreates a private key using the given algorithm and key length or DH\nsecret, and returns the key as a binary string in PEM format. If key\ngeneration fails, the result is NULL.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nSupported key_len values: The minimum key length in bits is 1,024. The\nmaximum key length depends on the algorithm: 16,384 for RSA and 10,000\nfor DSA. These key-length limits are constraints imposed by OpenSSL.\nServer administrators can impose additional limits on maximum key\nlength by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-usage.html\n.\n\nFor DH keys, pass a shared DH secret instead of a key length. To create\nthe secret, pass the key length to CREATE_DH_PARAMETERS().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','SET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'DSA\', 2048);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'DSA\', @priv);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (625,40,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 134217728 (128 MB). You may optionally follow size with a\none-letter abbreviation for an order of magnitude, similar to those\nused in my.cnf. Generally, this is one of the letters M (megabytes) or\nG (gigabytes).\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an data file with the same name, or an undo log file and\na tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.7. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.7/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for NDB Cluster.\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-tablespace.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (626,23,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. ENUM values are represented internally as integers.\n\nAn ENUM column can have a maximum of 65,535 distinct elements. (The\npractical limit is less than 3000.) A table can have no more than 255\nunique element list definitions among its ENUM and SET columns\nconsidered as a group. For more information on these limits, see\nhttp://dev.mysql.com/doc/refman/5.7/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (627,13,'ST_LENGTH','ST_Length(ls)\n\nReturns a double-precision number indicating the length of the\nLineString or MultiLineString value ls in its associated spatial\nreference. The length of a MultiLineString value is equal to the sum of\nthe lengths of its elements. If the argument is NULL or an empty\ngeometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_Length(ST_GeomFromText(@ls));\n+---------------------------------+\n| ST_Length(ST_GeomFromText(@ls)) |\n+---------------------------------+\n| 2.8284271247461903 |\n+---------------------------------+\n\nmysql> SET @mls = \'MultiLineString((1 1,2 2,3 3),(4 4,5 5))\';\nmysql> SELECT ST_Length(ST_GeomFromText(@mls));\n+----------------------------------+\n| ST_Length(ST_GeomFromText(@mls)) |\n+----------------------------------+\n| 4.242640687119286 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (628,38,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (629,28,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL. In previous versions of MySQL, it can be used for certain\nkinds of tables (such as MyISAM), such that when a client uses INSERT\nDELAYED, it gets an okay from the server at once, and the row is queued\nto be inserted when the table is not in use by any other thread.\n\nDELAYED inserts and replaces were deprecated in MySQL 5.6. In MySQL\n5.7, DELAYED is not supported. The server recognizes but ignores the\nDELAYED keyword, handles the insert as a nondelayed insert, and\ngenerates an ER_WARN_LEGACY_SYNTAX_CONVERTED warning ("INSERT DELAYED\nis no longer supported. The statement was converted to INSERT"). The\nDELAYED keyword is scheduled for removal in a future release.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/insert-delayed.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (630,27,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nTo use either statement, you must be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE 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\nmysql> SHOW 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+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/show-procedure-code.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (631,23,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 − 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. Each MEDIUMTEXT value is stored using a 3-byte\nlength prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (632,27,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION WHERE Charset = \'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+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-collation.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (633,3,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0.0E0, the function\nreturns NULL and (as of MySQL 5.7.4) a warning "Invalid argument for\nlogarithm" is reported.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n -> 0.69314718055995\nmysql> SELECT LOG(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (634,20,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n -> 1\nmysql> SELECT .01 <> \'0.01\';\n -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (635,24,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition expression is true. statement_list consists of one or\nmore SQL statements, each terminated by a semicolon (;) statement\ndelimiter.\n\nA WHILE statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/while.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND;\n','http://dev.mysql.com/doc/refman/5.7/en/while.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (636,7,'JSON_APPEND','Syntax:\nJSON_APPEND(json_doc, path, val[, path, val] ...)\n\nAppends values to the end of the indicated arrays within a JSON\ndocument and returns the result. This function was renamed to\nJSON_ARRAY_APPEND() in MySQL 5.7.9; the alias JSON_APPEND() is now\ndeprecated in MySQL 5.7, and is removed in MySQL 8.0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (637,7,'JSON_LENGTH','Syntax:\nJSON_LENGTH(json_doc[, path])\n\nReturns the length of a JSON document, or, if a path argument is given,\nthe length of the value within the document identified by the path.\nReturns NULL if any argument is NULL or the path argument does not\nidentify a value in the document. An error occurs if the json_doc\nargument is not a valid JSON document or the path argument is not a\nvalid path expression or contains a * or ** wildcard.\n\nThe length of a document is determined as follows:\n\no The length of a scalar is 1.\n\no The length of an array is the number of array elements.\n\no The length of an object is the number of object members.\n\no The length does not count the length of nested arrays or objects.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','mysql> SELECT JSON_LENGTH(\'[1, 2, {"a": 3}]\');\n+---------------------------------+\n| JSON_LENGTH(\'[1, 2, {"a": 3}]\') |\n+---------------------------------+\n| 3 |\n+---------------------------------+\nmysql> SELECT JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\');\n+-----------------------------------------+\n| JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\') |\n+-----------------------------------------+\n| 2 |\n+-----------------------------------------+\nmysql> SELECT JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\', \'$.b\');\n+------------------------------------------------+\n| JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\', \'$.b\') |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (638,32,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.7/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (639,3,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians. (Note that\nπ radians equals 180 degrees.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (640,17,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (641,20,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nThe return type of COALESCE() is the aggregated type of the argument\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (642,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.7.25-standard\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (0,26,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n -> 0\nmysql> SELECT NOT 0;\n -> 1\nmysql> SELECT NOT NULL;\n -> NULL\nmysql> SELECT ! (1+1);\n -> 0\nmysql> SELECT ! 1+1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (1,4,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n -> 1\nmysql> SELECT .01 <> \'0.01\';\n -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (2,29,'%','Syntax:\nN % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (3,3,'&','Syntax:\n&\n\nBitwise AND.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n -> 13\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (4,29,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (5,29,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (6,29,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n -> -2\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (7,29,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the operand.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n -> -2\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (8,27,'->','Syntax:\ncolumn->path\n\nIn MySQL 5.7.9 and later, the -> operator serves as an alias for the\nJSON_EXTRACT() function when used with two arguments, a column\nidentifier on the left and a JSON path on the right that is evaluated\nagainst the JSON document (the column value). You can use such\nexpressions in place of column identifiers wherever they occur in SQL\nstatements.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT c, JSON_EXTRACT(c, "$.id"), g\n > FROM jemp\n > WHERE JSON_EXTRACT(c, "$.id") > 1\n > ORDER BY JSON_EXTRACT(c, "$.name");\n+-------------------------------+-----------+------+\n| c | c->"$.id" | g |\n+-------------------------------+-----------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 |\n| {"id": "4", "name": "Betty"} | "4" | 4 |\n| {"id": "2", "name": "Wilma"} | "2" | 2 |\n+-------------------------------+-----------+------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT c, c->"$.id", g\n > FROM jemp\n > WHERE c->"$.id" > 1\n > ORDER BY c->"$.name";\n+-------------------------------+-----------+------+\n| c | c->"$.id" | g |\n+-------------------------------+-----------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 |\n| {"id": "4", "name": "Betty"} | "4" | 4 |\n| {"id": "2", "name": "Wilma"} | "2" | 2 |\n+-------------------------------+-----------+------+\n3 rows in set (0.00 sec)\n\nmysql> ALTER TABLE jemp ADD COLUMN n INT;\nQuery OK, 0 rows affected (0.68 sec)\nRecords: 0 Duplicates: 0 Warnings: 0\n\nmysql> UPDATE jemp SET n=1 WHERE c->"$.id" = "4";\nQuery OK, 1 row affected (0.04 sec)\nRows matched: 1 Changed: 1 Warnings: 0\n\nmysql> SELECT c, c->"$.id", g, n\n > FROM jemp\n > WHERE JSON_EXTRACT(c, "$.id") > 1\n > ORDER BY c->"$.name";\n+-------------------------------+-----------+------+------+\n| c | c->"$.id" | g | n |\n+-------------------------------+-----------+------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 | NULL |\n| {"id": "4", "name": "Betty"} | "4" | 4 | 1 |\n| {"id": "2", "name": "Wilma"} | "2" | 2 | NULL |\n+-------------------------------+-----------+------+------+\n3 rows in set (0.00 sec)\n\nmysql> DELETE FROM jemp WHERE c->"$.id" = "4";\nQuery OK, 1 row affected (0.04 sec)\n\nmysql> SELECT c, c->"$.id", g, n\n > FROM jemp\n > WHERE JSON_EXTRACT(c, "$.id") > 1\n > ORDER BY c->"$.name";\n+-------------------------------+-----------+------+------+\n| c | c->"$.id" | g | n |\n+-------------------------------+-----------+------+------+\n| {"id": "3", "name": "Barney"} | "3" | 3 | NULL |\n| {"id": "2", "name": "Wilma"} | "2" | 2 | NULL |\n+-------------------------------+-----------+------+------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (9,27,'->>','Syntax:\ncolumn->>path\n\nThis is an improved, unquoting extraction operator available in MySQL\n5.7.13 and later. Whereas the -> operator simply extracts a value, the\n->> operator in addition unquotes the extracted result. In other words,\ngiven a JSON column value column and a path expression path, the\nfollowing three expressions return the same value:\n\no JSON_UNQUOTE( JSON_EXTRACT(column, path) )\n\no JSON_UNQUOTE(column -> path)\n\no column->>path\n\nThe ->> operator can be used wherever JSON_UNQUOTE(JSON_EXTRACT())\nwould be allowed. This includes (but is not limited to) SELECT lists,\nWHERE and HAVING clauses, and ORDER BY and GROUP BY clauses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT * FROM jemp WHERE g > 2;\n+-------------------------------+------+\n| c | g |\n+-------------------------------+------+\n| {"id": "3", "name": "Barney"} | 3 |\n| {"id": "4", "name": "Betty"} | 4 |\n+-------------------------------+------+\n2 rows in set (0.01 sec)\n\nmysql> SELECT c->\'$.name\' AS name\n -> FROM jemp WHERE g > 2;\n+----------+\n| name |\n+----------+\n| "Barney" |\n| "Betty" |\n+----------+\n2 rows in set (0.00 sec)\n\nmysql> SELECT JSON_UNQUOTE(c->\'$.name\') AS name\n -> FROM jemp WHERE g > 2;\n+--------+\n| name |\n+--------+\n| Barney |\n| Betty |\n+--------+\n2 rows in set (0.00 sec)\n\nmysql> SELECT c->>\'$.name\' AS name\n -> FROM jemp WHERE g > 2;\n+--------+\n| name |\n+--------+\n| Barney |\n| Betty |\n+--------+\n2 rows in set (0.00 sec)\n\nmysql> CREATE TABLE tj10 (a JSON, b INT);\nQuery OK, 0 rows affected (0.26 sec)\n\nmysql> INSERT INTO tj10 VALUES\n -> (\'[3,10,5,"x",44]\', 33),\n -> (\'[3,10,5,17,[22,"y",66]]\', 0);\nQuery OK, 2 rows affected (0.04 sec)\nRecords: 2 Duplicates: 0 Warnings: 0\n\nmysql> SELECT a->"$[3]", a->"$[4][1]" FROM tj10;\n+-----------+--------------+\n| a->"$[3]" | a->"$[4][1]" |\n+-----------+--------------+\n| "x" | NULL |\n| 17 | "y" |\n+-----------+--------------+\n2 rows in set (0.00 sec)\n\nmysql> SELECT a->>"$[3]", a->>"$[4][1]" FROM tj10;\n+------------+---------------+\n| a->>"$[3]" | a->>"$[4][1]" |\n+------------+---------------+\n| x | NULL |\n| 17 | y |\n+------------+---------------+\n2 rows in set (0.00 sec)\n\nmysql> EXPLAIN SELECT c->>\'$.name\' AS name\n -> FROM jemp WHERE g > 2\\G\n*************************** 1. row ***************************\n id: 1\n select_type: SIMPLE\n table: jemp\n partitions: NULL\n type: range\npossible_keys: i\n key: i\n key_len: 5\n ref: NULL\n rows: 2\n filtered: 100.00\n Extra: Using where\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS\\G\n*************************** 1. row ***************************\n Level: Note\n Code: 1003\nMessage: /* select#1 */ select\njson_unquote(json_extract(`jtest`.`jemp`.`c`,\'$.name\')) AS `name` from\n`jtest`.`jemp` where (`jtest`.`jemp`.`g` > 2)\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (10,29,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n -> 0.60\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (11,4,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (12,3,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nThe result is an unsigned 64-bit integer. The value is truncated to 64\nbits. In particular, if the shift count is greater or equal to the\nwidth of an unsigned 64-bit number, the result is zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (13,4,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (14,4,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nThe <=> operator is equivalent to the standard SQL IS NOT DISTINCT FROM\noperator.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (15,4,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n -> 0\nmysql> SELECT \'0\' = 0;\n -> 1\nmysql> SELECT \'0.0\' = 0;\n -> 1\nmysql> SELECT \'0.01\' = 0;\n -> 0\nmysql> SELECT \'.01\' = 0.01;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (16,4,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (17,4,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (18,3,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nThe result is an unsigned 64-bit integer. The value is truncated to 64\nbits. In particular, if the shift count is greater or equal to the\nwidth of an unsigned 64-bit number, the result is zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (19,29,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n -> 2\nmysql> SELECT ABS(-32);\n -> 32\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (20,29,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n -> 0\nmysql> SELECT ACOS(1.0001);\n -> NULL\nmysql> SELECT ACOS(0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (21,11,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee\nhttp://dev.mysql.com/doc/refman/5.7/en/expressions.html#temporal-interv\nals.\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (22,11,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (23,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str[,init_vector])\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nThe optional initialization vector argument, init_vector, is available\nas of MySQL 5.7.4. As of that version, statements that use\nAES_DECRYPT() are unsafe for statement-based replication and cannot be\nstored in the query cache.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (24,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str[,init_vector])\n\nAES_ENCRYPT() and AES_DECRYPT() implement encryption and decryption of\ndata using the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." The AES standard permits various key\nlengths. By default these functions implement AES with a 128-bit key\nlength. As of MySQL 5.7.4, key lengths of 196 or 256 bits can be used,\nas described later. The key length is a trade off between performance\nand security.\n\nAES_ENCRYPT() encrypts the string str using the key string key_str and\nreturns a binary string containing the encrypted output. AES_DECRYPT()\ndecrypts the encrypted string crypt_str using the key string key_str\nand returns the original cleartext string. If either function argument\nis NULL, the function returns NULL.\n\nThe str and crypt_str arguments can be any length, and padding is\nautomatically added to str so it is a multiple of a block as required\nby block-based algorithms such as AES. This padding is automatically\nremoved by the AES_DECRYPT() function. The length of crypt_str can be\ncalculated using this formula:\n\n16 * (trunc(string_length / 16) + 1)\n\nFor a key length of 128 bits, the most secure way to pass a key to the\nkey_str argument is to create a truly random 128-bit value and pass it\nas a binary value. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\',UNHEX(\'F3229A0B371ED2D9441B830D21A390C3\')));\n\nA passphrase can be used to generate an AES key by hashing the\npassphrase. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\', UNHEX(SHA2(\'My secret passphrase\',512))));\n\nDo not pass a password or passphrase directly to crypt_str, hash it\nfirst. Previous versions of this documentation suggested the former\napproach, but it is no longer recommended as the examples shown here\nare more secure.\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nAs of MySQL 5.7.4, AES_ENCRYPT() and AES_DECRYPT() permit control of\nthe block encryption mode and take an optional init_vector\ninitialization vector argument:\n\no The block_encryption_mode system variable controls the mode for\n block-based encryption algorithms. Its default value is aes-128-ecb,\n which signifies encryption using a key length of 128 bits and ECB\n mode. For a description of the permitted values of this variable, see\n http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\no The optional init_vector argument provides an initialization vector\n for block encryption modes that require it.\n\nFor modes that require the optional init_vector argument, it must be 16\nbytes or longer (bytes in excess of 16 are ignored). An error occurs if\ninit_vector is missing.\n\nFor modes that do not require init_vector, it is ignored and a warning\nis generated if it is specified.\n\nA random string of bytes to use for the initialization vector can be\nproduced by calling RANDOM_BYTES(16). For encryption modes that require\nan initialization vector, the same vector must be used for encryption\nand decryption.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SET block_encryption_mode = \'aes-256-cbc\';\nmysql> SET @key_str = SHA2(\'My secret passphrase\',512);\nmysql> SET @init_vector = RANDOM_BYTES(16);\nmysql> SET @crypt_str = AES_ENCRYPT(\'text\',@key_str,@init_vector);\nmysql> SELECT AES_DECRYPT(@crypt_str,@key_str,@init_vector);\n+-----------------------------------------------+\n| AES_DECRYPT(@crypt_str,@key_str,@init_vector) |\n+-----------------------------------------------+\n| text |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (25,8,'ALTER DATABASE','Syntax:\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\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nNational Language Characteristics\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.7/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nIf you change the default character set or collation for a database,\nstored routines that use the database defaults must be dropped and\nrecreated so that they use the new defaults. (In a stored routine,\nvariables with character data types use the database defaults if the\ncharacter set or collation are not specified explicitly. See [HELP\nCREATE PROCEDURE].)\n\nUpgrading from Versions Older than MySQL 5.1\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates\nthe name of the directory associated with the database to use the\nencoding implemented in MySQL 5.1 for mapping database names to\ndatabase directory names (see\nhttp://dev.mysql.com/doc/refman/5.7/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n versions.\n\no It is intended to update a database directory name to the current\n encoding format if the name contains special characters that need\n encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example, if a database in MySQL 5.0 has the name a-b-c, the name\ncontains instances of the - (dash) character. In MySQL 5.0, the\ndatabase directory is also named a-b-c, which is not necessarily safe\nfor all file systems. In MySQL 5.1 and later, the same database name is\nencoded as a@002db@002dc to produce a file system-neutral directory\nname.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\n*Note*:\n\nThe UPGRADE DATA DIRECTORY NAME clause is deprecated in MySQL 5.7.6 and\nwill be removed in a future version of MySQL. If it is necessary to\nconvert MySQL 5.0 database or table names, a workaround is to upgrade a\nMySQL 5.0 installation to MySQL 5.1 before upgrading to a more recent\nrelease.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (26,8,'ALTER EVENT','Syntax:\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'string\']\n [DO event_body]\n\nThe ALTER EVENT statement changes one or more of the characteristics of\nan existing event without the need to drop and recreate it. The syntax\nfor each of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE /\nDISABLE, and DO clauses is exactly the same as when used with CREATE\nEVENT. (See [HELP CREATE EVENT].)\n\nAny user can alter an event defined on a database for which that user\nhas the EVENT privilege. When a user executes a successful ALTER EVENT\nstatement, that user becomes the definer for the affected event.\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n > ON SCHEDULE \n > EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (27,8,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (28,8,'ALTER INSTANCE','Syntax:\nALTER INSTANCE ROTATE INNODB MASTER KEY\n\nALTER INSTANCE, introduced in MySQL 5.7.11, defines actions applicable\nto a MySQL server instance.\n\nThe ALTER INSTANCE ROTATE INNODB MASTER KEY statement is used to rotate\nthe master encryption key used for InnoDB tablespace encryption. A\nkeyring plugin must be installed and configured to use this statement.\nFor information about keyring plugins, see\nhttp://dev.mysql.com/doc/refman/5.7/en/keyring.html. Key rotation\nrequires the SUPER privilege.\n\nALTER INSTANCE ROTATE INNODB MASTER KEY supports concurrent DML.\nHowever, it cannot be run concurrently with CREATE TABLE ... ENCRYPTION\nor ALTER TABLE ... ENCRYPTION operations, and locks are taken to\nprevent conflicts that could arise from concurrent execution of these\nstatements. If one of the conflicting statements is running, it must\ncomplete before another can proceed.\n\nALTER INSTANCE actions are written to the binary log so that they can\nbe executed on replicated servers.\n\nFor additional ALTER INSTANCE ROTATE INNODB MASTER KEY usage\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-tablespace-encryption.htm\nl. For information about keyring plugins, see\nhttp://dev.mysql.com/doc/refman/5.7/en/keyring.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-instance.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-instance.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (29,8,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an undo log file with the same name, or an undo log file\nand a data file with the same name.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size defaults to 134217728 (128\nMB). You may optionally follow size with a one-letter abbreviation for\nan order of magnitude, similar to those used in my.cnf. Generally, this\nis one of the letters M (megabytes) or G (gigabytes). (Bug #13116514,\nBug #16104705, Bug #62858)\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB). (Bug\n#29574)\n\n*Note*:\n\nWAIT is parsed but otherwise ignored. This keyword currently has no\neffect, and is intended for future expansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. Currently, the only accepted values for engine_name are\n"NDBCLUSTER" and "NDB". The two values are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-logfile-group.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (30,8,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. By\ndefault, that privilege is granted automatically to the procedure\ncreator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-routines-privileges.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (31,8,'ALTER SERVER','Syntax:\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting any of the\noptions permitted in the CREATE SERVER statement. The corresponding\nfields in the mysql.servers table are updated accordingly. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.7/en/alter-server.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (32,8,'ALTER TABLE','Syntax:\nALTER TABLE tbl_name\n [alter_specification [, alter_specification] ...]\n [partition_options]\n\nalter_specification:\n table_options\n | ADD [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | ADD [COLUMN] (col_name column_definition,...)\n | ADD {INDEX|KEY} [index_name]\n [index_type] (key_part,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (key_part,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (key_part,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (key_part,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (key_part,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [index_name] (col_name,...)\n reference_definition\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n | CHANGE [COLUMN] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | {DISABLE|ENABLE} KEYS\n | {DISCARD|IMPORT} TABLESPACE\n | DROP [COLUMN] col_name\n | DROP {INDEX|KEY} index_name\n | DROP PRIMARY KEY\n | DROP FOREIGN KEY fk_symbol\n | FORCE\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | MODIFY [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | ORDER BY col_name [, col_name] ...\n | RENAME {INDEX|KEY} old_index_name TO new_index_name\n | RENAME [TO|AS] new_tbl_name\n | {WITHOUT|WITH} VALIDATION\n | ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | DISCARD PARTITION {partition_names | ALL} TABLESPACE\n | IMPORT PARTITION {partition_names | ALL} TABLESPACE\n | TRUNCATE PARTITION {partition_names | ALL}\n | COALESCE PARTITION number\n | REORGANIZE PARTITION partition_names INTO (partition_definitions)\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name [{WITH|WITHOUT} VALIDATION]\n | ANALYZE PARTITION {partition_names | ALL}\n | CHECK PARTITION {partition_names | ALL}\n | OPTIMIZE PARTITION {partition_names | ALL}\n | REBUILD PARTITION {partition_names | ALL}\n | REPAIR PARTITION {partition_names | ALL}\n | REMOVE PARTITIONING\n | UPGRADE PARTITIONING\n\nkey_part:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | COMPRESSION [=] {\'ZLIB\'|\'LZ4\'|\'NONE\'}\n | CONNECTION [=] \'connect_string\'\n | {DATA|INDEX} DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTION [=] {\'Y\' | \'N\'}\n | ENGINE [=] engine_name\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] value\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n (see CREATE TABLE options)\n\nALTER TABLE changes the structure of a table. For example, you can add\nor delete columns, create or destroy indexes, change the type of\nexisting columns, or rename columns or the table itself. You can also\nchange characteristics such as the storage engine used for the table or\nthe table comment.\n\no To use ALTER TABLE, you need ALTER, CREATE, and INSERT privileges for\n the table. Renaming a table requires ALTER and DROP on the old table,\n ALTER, CREATE, and INSERT on the new table.\n\no Following the table name, specify the alterations to be made. If none\n are given, ALTER TABLE does nothing.\n\no The syntax for many of the permissible alterations is similar to\n clauses of the CREATE TABLE statement. column_definition clauses use\n the same syntax for ADD and CHANGE as for CREATE TABLE. For more\n information, see [HELP CREATE TABLE].\n\no The word COLUMN is optional and can be omitted.\n\no Multiple ADD, ALTER, DROP, and CHANGE clauses are permitted in a\n single ALTER TABLE statement, separated by commas. This is a MySQL\n extension to standard SQL, which permits only one of each clause per\n ALTER TABLE statement. For example, to drop multiple columns in a\n single statement, do this:\n\nALTER TABLE t2 DROP COLUMN c, DROP COLUMN d;\n\no If a storage engine does not support an attempted ALTER TABLE\n operation, a warning may result. Such warnings can be displayed with\n SHOW WARNINGS. See [HELP SHOW WARNINGS]. For information on\n troubleshooting ALTER TABLE, see\n http://dev.mysql.com/doc/refman/5.7/en/alter-table-problems.html.\n\no For information about generated columns, see\n http://dev.mysql.com/doc/refman/5.7/en/alter-table-generated-columns.\n html.\n\no For usage examples, see\n http://dev.mysql.com/doc/refman/5.7/en/alter-table-examples.html.\n\no With the mysql_info() C API function, you can find out how many rows\n were copied by ALTER TABLE. See\n http://dev.mysql.com/doc/refman/5.7/en/mysql-info.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (33,8,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement is used either to add a new data file, or to drop a data\nfile from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 134217728 (128 MB). You may optionally follow size with a\none-letter abbreviation for an order of magnitude, similar to those\nused in my.cnf. Generally, this is one of the letters M (megabytes) or\nG (gigabytes).\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an data file with the same name, or an undo log file and\na tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.7. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.7/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for NDB Cluster.\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-tablespace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (34,1,'ALTER USER','Syntax:\nALTER USER [IF EXISTS]\n user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [password_option | lock_option] ...\n\nALTER USER [IF EXISTS]\n USER() IDENTIFIED BY \'auth_string\'\n\nuser:\n (see )\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\npassword_option: {\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n}\n\nlock_option: {\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nThe ALTER USER statement modifies MySQL accounts. It enables\nauthentication, SSL/TLS, resource-limit, and password-management\nproperties to be modified for existing accounts. It can also be used to\nlock and unlock accounts.\n\nTo use ALTER USER, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql system database. When the read_only\nsystem variable is enabled, ALTER USER additionally requires the SUPER\nprivilege.\n\nBy default, an error occurs if you try to modify a user that does not\nexist. If the IF EXISTS clause is given, the statement produces a\nwarning for each named user that does not exist, rather than an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (35,8,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW see [HELP CREATE VIEW]). This\nstatement requires the CREATE VIEW and DROP privileges for the view,\nand some privilege for each column referred to in the SELECT statement.\nALTER VIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/alter-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (36,36,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n\nANALYZE TABLE performs a key distribution analysis and stores the\ndistribution for the named table or tables. For MyISAM tables, this\nstatement is equivalent to using myisamchk --analyze.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE works with InnoDB, NDB, and MyISAM tables. It does not\nwork with views.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-maintenance.html.\n\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM.\n\nBy default, the server writes ANALYZE TABLE statements to the binary\nlog so that they replicate to replication slaves. To suppress logging,\nspecify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/analyze-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (37,26,'AND','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT 1 AND 1;\n -> 1\nmysql> SELECT 1 AND 0;\n -> 0\nmysql> SELECT 1 AND NULL;\n -> NULL\nmysql> SELECT 0 AND NULL;\n -> 0\nmysql> SELECT NULL AND 0;\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (38,28,'ANY_VALUE','ANY_VALUE(arg)\n\nThis function is useful for GROUP BY queries when the\nONLY_FULL_GROUP_BY SQL mode is enabled, for cases when MySQL rejects a\nquery that you know is valid for reasons that MySQL cannot determine.\nThe function return value and type are the same as the return value and\ntype of its argument, but the function result is not checked for the\nONLY_FULL_GROUP_BY SQL mode.\n\nFor example, if name is a nonindexed column, the following query fails\nwith ONLY_FULL_GROUP_BY enabled:\n\nmysql> SELECT name, address, MAX(age) FROM t GROUP BY name;\nERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP\nBY clause and contains nonaggregated column \'mydb.t.address\' which\nis not functionally dependent on columns in GROUP BY clause; this\nis incompatible with sql_mode=only_full_group_by\n\nThe failure occurs because address is a nonaggregated column that is\nneither named among GROUP BY columns nor functionally dependent on\nthem. As a result, the address value for rows within each name group is\nnondeterministic. There are multiple ways to cause MySQL to accept the\nquery:\n\no Alter the table to make name a primary key or a unique NOT NULL\n column. This enables MySQL to determine that address is functionally\n dependent on name; that is, address is uniquely determined by name.\n (This technique is inapplicable if NULL must be permitted as a valid\n name value.)\n\no Use ANY_VALUE() to refer to address:\n\nSELECT name, ANY_VALUE(address), MAX(age) FROM t GROUP BY name;\n\n In this case, MySQL ignores the nondeterminism of address values\n within each name group and accepts the query. This may be useful if\n you simply do not care which value of a nonaggregated column is\n chosen for each group. ANY_VALUE() is not an aggregate function,\n unlike functions such as SUM() or COUNT(). It simply acts to suppress\n the test for nondeterminism.\n\no Disable ONLY_FULL_GROUP_BY. This is equivalent to using ANY_VALUE()\n with ONLY_FULL_GROUP_BY enabled, as described in the previous item.\n\nANY_VALUE() is also useful if functional dependence exists between\ncolumns but MySQL cannot determine it. The following query is valid\nbecause age is functionally dependent on the grouping column age-1, but\nMySQL cannot tell that and rejects the query with ONLY_FULL_GROUP_BY\nenabled:\n\nSELECT age FROM t GROUP BY age-1;\n\nTo cause MySQL to accept the query, use ANY_VALUE():\n\nSELECT ANY_VALUE(age) FROM t GROUP BY age-1;\n\nANY_VALUE() can be used for queries that refer to aggregate functions\nin the absence of a GROUP BY clause:\n\nmysql> SELECT name, MAX(age) FROM t;\nERROR 1140 (42000): In aggregated query without GROUP BY, expression\n#1 of SELECT list contains nonaggregated column \'mydb.t.name\'; this\nis incompatible with sql_mode=only_full_group_by\n\nWithout GROUP BY, there is a single group and it is nondeterministic\nwhich name value to choose for the group. ANY_VALUE() tells MySQL to\naccept the query:\n\nSELECT ANY_VALUE(name), MAX(age) FROM t;\n\nIt may be that, due to some property of a given data set, you know that\na selected nonaggregated column is effectively functionally dependent\non a GROUP BY column. For example, an application may enforce\nuniqueness of one column with respect to another. In this case, using\nANY_VALUE() for the effectively functionally dependent column may make\nsense.\n\nFor additional discussion, see\nhttp://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (39,32,'AREA','Area({poly|mpoly})\n\nST_Area() and Area() are synonyms. For more information, see the\ndescription of ST_Area().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (40,40,'ASBINARY','AsBinary(g), AsWKB(g)\n\nST_AsBinary(), ST_AsWKB(), AsBinary(), and AsWKB() are synonyms. For\nmore information, see the description of ST_AsBinary().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (41,35,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n -> 50\nmysql> SELECT ASCII(2);\n -> 50\nmysql> SELECT ASCII(\'dx\');\n -> 100\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (42,29,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (43,26,'ASSIGN-EQUAL','Syntax:\n=\n\nThis operator is used to perform value assignments in two cases,\ndescribed in the next two paragraphs.\n\nWithin a SET statement, = is treated as an assignment operator that\ncauses the user variable on the left hand side of the operator to take\non the value to its right. (In other words, when used in a SET\nstatement, = is treated identically to :=.) The value on the right hand\nside may be a literal value, another variable storing a value, or any\nlegal expression that yields a scalar value, including the result of a\nquery (provided that this value is a scalar value). You can perform\nmultiple assignments in the same SET statement.\n\nIn the SET clause of an UPDATE statement, = also acts as an assignment\noperator; in this case, however, it causes the column named on the left\nhand side of the operator to assume the value given to the right,\nprovided any WHERE conditions that are part of the UPDATE are met. You\ncan make multiple assignments in the same SET clause of an UPDATE\nstatement.\n\nIn any other context, = is treated as a comparison operator.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n','http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (44,26,'ASSIGN-VALUE','Syntax:\n:=\n\nAssignment operator. Causes the user variable on the left hand side of\nthe operator to take on the value to its right. The value on the right\nhand side may be a literal value, another variable storing a value, or\nany legal expression that yields a scalar value, including the result\nof a query (provided that this value is a scalar value). You can\nperform multiple assignments in the same SET statement. You can perform\nmultiple assignments in the same statement.\n\nUnlike =, the := operator is never interpreted as a comparison\noperator. This means you can use := in any valid SQL statement (not\njust in SET statements) to assign a value to a variable.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n\nmysql> SELECT @var1:=COUNT(*) FROM t1;\n -> 4\nmysql> SELECT @var1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/assignment-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (45,40,'ASTEXT','AsText(g), AsWKT(g)\n\nST_AsText(), ST_AsWKT(), AsText(), and AsWKT() are synonyms. For more\ninformation, see the description of ST_AsText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (46,27,'ASYMMETRIC_DECRYPT','Syntax:\nASYMMETRIC_DECRYPT(algorithm, crypt_str, key_str)\n\nDecrypts an encrypted string using the given algorithm and key string,\nand returns the resulting cleartext as a binary string. If decryption\nfails, the result is NULL.\n\nkey_str must be a valid key string in PEM format. For successful\ndecryption, it must be the public or private key string corresponding\nto the private or public key string used with ASYMMETRIC_ENCRYPT() to\nproduce the encrypted string. algorithm indicates the encryption\nalgorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nFor a usage example, see the description of ASYMMETRIC_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (47,27,'ASYMMETRIC_DERIVE','Syntax:\nASYMMETRIC_DERIVE(pub_key_str, priv_key_str)\n\nDerives a symmetric key using the private key of one party and the\npublic key of another, and returns the resulting key as a binary\nstring. If key derivation fails, the result is NULL.\n\npub_key_str and priv_key_str must be valid key strings in PEM format.\nThey must be created using the DH algorithm.\n\nSuppose that you have two pairs of public and private keys:\n\nSET @dhp = CREATE_DH_PARAMETERS(1024);\nSET @priv1 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub1 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv1);\nSET @priv2 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub2 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv2);\n\nSuppose further that you use the private key from one pair and the\npublic key from the other pair to create a symmetric key string. Then\nthis symmetric key identity relationship holds:\n\nASYMMETRIC_DERIVE(@pub1, @priv2) = ASYMMETRIC_DERIVE(@pub2, @priv1)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (48,27,'ASYMMETRIC_ENCRYPT','Syntax:\nASYMMETRIC_ENCRYPT(algorithm, str, key_str)\n\nEncrypts a string using the given algorithm and key string, and returns\nthe resulting ciphertext as a binary string. If encryption fails, the\nresult is NULL.\n\nThe str length cannot be greater than the key_str length − 11, in\nbytes\n\nkey_str must be a valid key string in PEM format. algorithm indicates\nthe encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nTo encrypt a string, pass a private or public key string to\nASYMMETRIC_ENCRYPT(). To recover the original unencrypted string, pass\nthe encrypted string to ASYMMETRIC_DECRYPT(), along with the public or\nprivate key string correponding to the private or public key string\nused for encryption.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','-- Generate private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'RSA\', 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'RSA\', @priv);\n\n-- Encrypt using private key, decrypt using public key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @priv);\nSET @cleartext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @pub);\n\n-- Encrypt using public key, decrypt using private key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @pub);\nSET @cleartext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @priv);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (49,27,'ASYMMETRIC_SIGN','Syntax:\nASYMMETRIC_SIGN(algorithm, digest_str, priv_key_str, digest_type)\n\nSigns a digest string using a private key string, and returns the\nsignature as a binary string. If signing fails, the result is NULL.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\npriv_key_str is the private key string to use for signing the digest\nstring. It must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nFor a usage example, see the description of ASYMMETRIC_VERIFY().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (50,27,'ASYMMETRIC_VERIFY','Syntax:\nASYMMETRIC_VERIFY(algorithm, digest_str, sig_str, pub_key_str,\ndigest_type)\n\nVerifies whether the signature string matches the digest string, and\nreturns 1 or 0 to indicate whether verification succeeded or failed.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\nsig_str is the signature string. It can be generated by calling\nASYMMETRIC_SIGN().\n\npub_key_str is the public key string of the signer. It corresponds to\nthe private key passed to ASYMMETRIC_SIGN() to generate the signature\nstring and must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','-- Set the encryption algorithm and digest type\nSET @algo = \'RSA\';\nSET @dig_type = \'SHA224\';\n\n-- Create private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(@algo, 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(@algo, @priv);\n\n-- Generate digest from string\nSET @dig = CREATE_DIGEST(@dig_type, \'The quick brown fox\');\n\n-- Generate signature for digest and verify signature against digest\nSET @sig = ASYMMETRIC_SIGN(@algo, @dig, @priv, @dig_type);\nSET @verf = ASYMMETRIC_VERIFY(@algo, @dig, @sig, @pub, @dig_type);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (51,29,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (52,29,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (53,10,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n);\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.7/en/example-auto-increment.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (54,14,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nIf there are no matching rows, AVG() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (55,5,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs (stored procedures and functions,\ntriggers, and events). A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords. statement_list\nrepresents a list of one or more statements, each terminated by a\nsemicolon (;) statement delimiter. The statement_list itself is\noptional, so the empty compound statement (BEGIN END) is legal.\n\nBEGIN ... END blocks can be nested.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. In the mysql\ncommand-line client, this is handled with the delimiter command.\nChanging the ; end-of-statement delimiter (for example, to //) permit ;\nto be used in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. See [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/begin-end.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (56,22,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,AES_ENCRYPT(\'hello\',\'goodbye\'));\n+---------------------------------------------------+\n| BENCHMARK(1000000,AES_ENCRYPT(\'hello\',\'goodbye\')) |\n+---------------------------------------------------+\n| 0 |\n+---------------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (57,4,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.7/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (58,10,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (59,35,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (60,10,'BINARY','BINARY[(M)]\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. An optional length M\nrepresents the column length in bytes. If omitted, M defaults to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (61,35,'BINARY OPERATOR','Syntax:\nBINARY expr\n\nThe BINARY operator converts the expression to a binary string. A\ncommon use for BINARY is to force a character string comparison to be\ndone byte by byte rather than character by character, in effect\nbecoming case-sensitive. The BINARY operator also causes trailing\nspaces in comparisons to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n -> 0\nmysql> SELECT \'a\' = \'a \';\n -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (62,2,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.7/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/binlog.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (63,10,'BIT','BIT[(M)]\n\nA bit-value type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (64,14,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_AND() returns a neutral value (all\nbits set to 1).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (65,3,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N as an\nunsigned 64-bit integer, or NULL if the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n -> 4, 3\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (66,35,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n -> 32\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (67,14,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_OR() returns a neutral value (all\nbits set to 0).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (68,14,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_XOR() returns a neutral value (all\nbits set to 0).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (69,10,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 − 1) bytes. Each\nBLOB value is stored using a 2-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (70,10,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/blob.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (71,10,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (72,20,'BUFFER','Buffer(g, d[, strategy1[, strategy2[, strategy3]]])\n\nST_Buffer() and Buffer() are synonyms. For more information, see the\ndescription of ST_Buffer().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (73,2,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n [PARTITION (partition_list | ALL)]\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE 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: http://dev.mysql.com/doc/refman/5.7/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/cache-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (74,9,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nStored procedures that take no arguments can be invoked without\nparentheses. That is, CALL p() and CALL p are equivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nFor information about the effect of unhandled conditions on procedure\nparameters, see\nhttp://dev.mysql.com/doc/refman/5.7/en/conditions-and-parameters.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/call.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (75,7,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first CASE syntax returns the result for the first\nvalue=compare_value comparison that is true. The second syntax returns\nthe result for the first condition that is true. If no comparison or\ncondition is true, the result after ELSE is returned, or NULL if there\nis no ELSE part.\n\n*Note*:\n\nThe syntax of the CASE expression described here differs slightly from\nthat of the SQL CASE statement described in [HELP CASE statement], for\nuse inside stored programs. The CASE statement cannot have an ELSE NULL\nclause, and it is terminated with END CASE instead of END.\n\nThe return type of a CASE expression result is the aggregated type of\nall result values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n -> WHEN 2 THEN \'two\' ELSE \'more\' END;\n -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n -> WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (76,5,'CASE STATEMENT','Syntax:\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct.\n\n*Note*:\n\nThere is also a CASE expression, which differs from the CASE statement\ndescribed here. See\nhttp://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nFor the first syntax, case_value is an expression. This value is\ncompared to the when_value expression in each WHEN clause until one of\nthem is equal. When an equal when_value is found, the corresponding\nTHEN clause statement_list executes. If no when_value is equal, the\nELSE clause statement_list executes, if there is one.\n\nThis syntax cannot be used to test for equality with NULL because NULL\n= NULL is false. See\nhttp://dev.mysql.com/doc/refman/5.7/en/working-with-null.html.\n\nFor the second syntax, each WHEN clause search_condition expression is\nevaluated until one is true, at which point its corresponding THEN\nclause statement_list executes. If no search_condition is equal, the\nELSE clause statement_list executes, if there is one.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nTo handle situations where no value is matched by any WHEN clause, use\nan ELSE containing an empty BEGIN ... END block, as shown in this\nexample. (The indentation used here in the ELSE clause is for purposes\nof clarity only, and is not otherwise significant.)\n\nDELIMITER |\n\nCREATE PROCEDURE p()\n BEGIN\n DECLARE v INT DEFAULT 1;\n\n CASE v\n WHEN 2 THEN SELECT v;\n WHEN 3 THEN SELECT 0;\n ELSE\n BEGIN\n END;\n END CASE;\n END;\n |\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/case.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/case.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (77,35,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes an expression of any type and produces a\nresult value of the specified type, similar to CONVERT(). For more\ninformation, see the description of CONVERT().\n\nCAST() is standard SQL syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (78,29,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (79,29,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n -> 2\nmysql> SELECT CEILING(-1.23);\n -> -1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (80,32,'CENTROID','Centroid({poly|mpoly})\n\nST_Centroid() and Centroid() are synonyms. For more information, see\nthe description of ST_Centroid().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (81,37,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ... [ channel_option ]\n\noption:\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\n | MASTER_RETRY_COUNT = count\n | MASTER_DELAY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | MASTER_AUTO_POSITION = {0|1}\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | MASTER_TLS_VERSION = \'protocol_list\'\n | IGNORE_SERVER_IDS = (server_id_list)\n\nchannel_option:\n FOR CHANNEL channel\n\nserver_id_list:\n [server_id [, server_id] ... ]\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the master\ninfo and relay log info repositories (see\nhttp://dev.mysql.com/doc/refman/5.7/en/slave-logs.html). CHANGE MASTER\nTO requires the SUPER privilege.\n\nPrior to MySQL 5.7.4, the slave replication threads must be stopped,\nusing STOP SLAVE if necessary, before issuing this statement. In MySQL\n5.7.4 and later, you can issue CHANGE MASTER TO statements on a running\nslave without doing this, depending on the states of the slave SQL\nthread and slave I/O thread. The rules governing such use are provided\nlater in this section.\n\nWhen using a multithreaded slave (in other words slave_parallel_workers\nis greater than 0), stopping the slave can cause "gaps" in the sequence\nof transactions that have been executed from the relay log, regardless\nof whether the slave was stopped intentionally or otherwise. When such\ngaps exist, issuing CHANGE MASTER TO fails. The solution in this\nsituation is to issue START SLAVE UNTIL SQL_AFTER_MTS_GAPS which\nensures that the gaps are closed.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the CHANGE MASTER TO statement to a specific\nreplication channel, and is used to add a new channel or modify an\nexisting channel. For example, to add a new channel called channel2:\n\nCHANGE MASTER TO MASTER_HOST=host1, MASTER_PORT=3002 FOR CHANNEL \'channel2\'\n\nIf no clause is named and no extra channels exist, the statement\napplies to the default channel.\n\nWhen using multiple replication channels, if a CHANGE MASTER TO\nstatement does not name a channel using a FOR CHANNEL channel clause,\nan error occurs. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, issue this statement to tell the slave\nabout the new password:\n\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n master host and its TCP/IP port.\n\n *Note*:\n\n Replication cannot use Unix socket files. You must be able to connect\n to the master MySQL server using TCP/IP.\n\n If you specify the MASTER_HOST or MASTER_PORT option, the slave\n assumes that the master server is different from before (even if the\n option value is the same as its current value.) In this case, the old\n values for the master binary log file name and position are\n considered no longer applicable, so if you do not specify\n MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n empty string) is not the same as not setting MASTER_HOST at all.\n Beginning with MySQL 5.5, trying to set MASTER_HOST to an empty\n string fails with an error. Previously, setting MASTER_HOST to an\n empty string caused START SLAVE subsequently to fail. (Bug #28796)\n\n Values used for MASTER_HOST and other CHANGE MASTER TO options are\n checked for linefeed (\\n or 0x0A) characters; the presence of such\n characters in these values causes the statement to fail with\n ER_MASTER_INFO. (Bug #11758581, Bug #50801)\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n account to use for connecting to the master.\n\n MASTER_USER cannot be made empty; setting MASTER_USER = \'\' or leaving\n it unset when setting a value for MASTER_PASSWORD causes an error\n (Bug #13427949).\n\n The password used for a MySQL Replication slave account in a CHANGE\n MASTER TO statement is limited to 32 characters in length; prior to\n MySQL 5.7.5, if the password was longer, the statement succeeded, but\n any excess characters were silently truncated. In MySQL 5.7.5 and\n later, trying to use a password of more than 32 characters causes\n CHANGE MASTER TO to fail. (Bug #11752299, Bug #43439)\n\n The text of a running CHANGE MASTER TO statement, including values\n for MASTER_USER and MASTER_PASSWORD, can be seen in the output of a\n concurrent SHOW PROCESSLIST statement. (The complete text of a START\n SLAVE statement is also visible to SHOW PROCESSLIST.)\n\nThe MASTER_SSL_xxx options, and the MASTER_TLS_VERSION option, specify\nhow the slave uses encryption and ciphers to secure the replication\nconnection. These options can be changed even on slaves that are\ncompiled without SSL support. They are saved to the master info\nrepository, but are ignored if the slave does not have SSL support\nenabled. The MASTER_SSL_xxx options perform the same functions as the\n--ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-options.htm\nl. The correspondence between the two sets of options, and the use of\nthe MASTER_SSL_xxx and MASTER_TLS_VERSION options to set up a secure\nconnection, is explained in\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-solutions-encrypted-\nconnections.html.\n\nAs of MySQL 5.7.3, setting MASTER_SSL=1 means that the slave connection\nto the master must use SSL, or the connection attempt fails. Before\n5.7.3, the use of an SSL connection by the slave was not enforced with\nMASTER_SSL=1. This is analogous to the client-side meaning of the --ssl\ncommand-line option; see\nhttp://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-options.htm\nl.\n\nThe MASTER_HEARTBEAT_PERIOD, MASTER_CONNECT_RETRY, and\nMASTER_RETRY_COUNT options control how the slave recognizes that the\nconnection to the master has been lost and makes attempts to reconnect.\n\no The slave_net_timeout system variable specifies the number of seconds\n that the slave waits for either more data or a heartbeat signal from\n the master, before the slave considers the connection broken, aborts\n the read, and tries to reconnect. The default value is 60 seconds\n (one minute). Prior to MySQL 5.7.7, the default was 3600 seconds (one\n hour).\n\no The heartbeat interval, which stops the connection timeout occurring\n in the absence of data if the connection is still good, is controlled\n by the MASTER_HEARTBEAT_PERIOD option. A heartbeat signal is sent to\n the slave after that number of seconds, and the waiting period is\n reset whenever the master\'s binary log is updated with an event.\n Heartbeats are therefore sent by the master only if there are no\n unsent events in the binary log file for a period longer than this.\n The heartbeat interval interval is a decimal value having the range 0\n to 4294967 seconds and a resolution in milliseconds; the smallest\n nonzero value is 0.001. Setting interval to 0 disables heartbeats\n altogether. The heartbeat interval defaults to half the value of the\n slave_net_timeout system variable. It is recorded in the master info\n log and shown in the replication_connection_configuration Performance\n Schema table. Issuing RESET SLAVE resets the heartbeat interval to\n the default value.\n\no Prior to MySQL 5.7.4, not including MASTER_HEARTBEAT_PERIOD caused\n CHANGE MASTER TO to reset the heartbeat interval to the default (half\n the value of the slave_net_timeout system variable), and\n Slave_received_heartbeats to 0. The heartbeat interval is now not\n reset except by RESET SLAVE. (Bug #18185490)\n\no Note that a change to the value or default setting of\n slave_net_timeout does not automatically change the heartbeat\n interval, whether that has been set explicitly or is using a\n previously calculated default. A warning is issued if you set\n @@GLOBAL.slave_net_timeout to a value less than that of the current\n heartbeat interval. If slave_net_timeout is changed, you must also\n issue CHANGE MASTER TO to adjust the heartbeat interval to an\n appropriate value so that the heartbeat signal occurs before the\n connection timeout. If you do not do this, the heartbeat signal has\n no effect, and if no data is received from the master, the slave can\n make repeated reconnection attempts, creating zombie dump threads.\n\no If the slave does need to reconnect, the first retry occurs\n immediately after the timeout. MASTER_CONNECT_RETRY specifies the\n interval between reconnection attempts, and MASTER_RETRY_COUNT limits\n the number of reconnection attempts. If both the default settings are\n used, the slave waits 60 seconds between reconnection attempts\n (MASTER_CONNECT_RETRY=60), and keeps attempting to reconnect at this\n rate for 24 hours (MASTER_RETRY_COUNT=86400). These values are\n recorded in the master info log and shown in the\n replication_connection_configuration Performance Schema table.\n MASTER_RETRY_COUNT supersedes the --master-retry-count server startup\n option.\n\nMASTER_DELAY specifies how many seconds behind the master the slave\nmust lag. An event received from the master is not executed until at\nleast interval seconds later than its execution on the master. The\ndefault is 0. An error occurs if interval is not a nonnegative integer\nin the range from 0 to 231−1. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-delayed.html.\n\nFrom MySQL 5.7, a CHANGE MASTER TO statement employing the MASTER_DELAY\noption can be executed on a running slave when the slave SQL thread is\nstopped.\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master.\n\nThe address configured with this option, if any, can be seen in the\nMaster_Bind column of the output from SHOW SLAVE STATUS. If you are\nusing slave status log tables (server started with\n--master-info-repository=TABLE), the value can also be seen as the\nMaster_bind column of the mysql.slave_master_info table.\n\nThe ability to bind a replication slave to a specific network interface\nis also supported by NDB Cluster.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIf you specify either of MASTER_LOG_FILE or MASTER_LOG_POS, you also\ncannot specify MASTER_AUTO_POSITION = 1 (described later in this\nsection). If neither of MASTER_LOG_FILE or MASTER_LOG_POS is specified,\nthe slave uses the last coordinates of the slave SQL thread before\nCHANGE MASTER TO was issued. This ensures that there is no\ndiscontinuity in replication, even if the slave SQL thread was late\ncompared to the slave I/O thread, when you merely want to change, say,\nthe password to use.\n\nFrom MySQL 5.7, a CHANGE MASTER TO statement employing RELAY_LOG_FILE,\nRELAY_LOG_POS, or both options can be executed on a running slave when\nthe slave SQL thread is stopped. Prior to MySQL 5.7.4, CHANGE MASTER TO\ndeletes all relay log files and starts a new one, unless you specify\nRELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay log files are\nkept; the relay_log_purge global variable is set silently to 0. In\nMySQL 5.7.4 and later, relay logs are preserved if at least one of the\nslave SQL thread and the slave I/O thread is running; if both threads\nare stopped, all relay log files are deleted unless at least one of\nRELAY_LOG_FILE or RELAY_LOG_POS is specified.\n\nRELAY_LOG_FILE can use either an absolute or relative path, and uses\nthe same base name as MASTER_LOG_FILE. (Bug #12190)\n\nWhen MASTER_AUTO_POSITION = 1 is used with CHANGE MASTER TO, the slave\nattempts to connect to the master using the GTID-based replication\nprotocol. From MySQL 5.7, this option can be employed by CHANGE MASTER\nTO only if both the slave SQL and slave I/O threads are stopped. Both\nthe slave and the master must have GTIDs enabled (GTID_MODE=ON,\nON_PERMISSIVE, or OFF_PERMISSIVE on the slave, and GTID_MODE=ON on the\nmaster). Auto-positioning is used for the connection, so the\ncoordinates represented by MASTER_LOG_FILE and MASTER_LOG_POS are not\nused, and the use of either or both of these options together with\nMASTER_AUTO_POSITION = 1 causes an error. If multi-source replication\nis enabled on the slave, you need to set the MASTER_AUTO_POSITION = 1\noption for each applicable replication channel.\n\nWith MASTER_AUTO_POSITION = 1 set, in the initial connection handshake,\nthe slave sends a GTID set containing the transactions that it has\nalready received, committed, or both. The master responds by sending\nall transactions recorded in its binary log whose GTID is not included\nin the GTID set sent by the slave. This exchange ensures that the\nmaster only sends the transactions with a GTID that the slave has not\nalready recorded or committed. If the slave receives transactions from\nmore than one master, as in the case of a diamond topology, the\nauto-skip function ensures that the transactions are not applied twice.\nFor details of how the GTID set sent by the slave is computed, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-auto-positioni\nng.html.\n\nIf any of the transactions that should be sent by the master have been\npurged from the master\'s binary log, or added to the set of GTIDs in\nthe gtid_purged system variable by another method, the master sends the\nerror ER_MASTER_HAS_PURGED_REQUIRED_GTIDS to the slave, and replication\ndoes not start. Also, if during the exchange of transactions it is\nfound that the slave has recorded or committed transactions with the\nmaster\'s UUID in the GTID, but the master itself has not committed\nthem, the master sends the error ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER to\nthe slave and replication does not start. For information on how to\nhandle these situations, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-auto-positioni\nng.html.\n\nYou can see whether replication is running with auto-positioning\nenabled by checking the Performance Schema\nreplication_connection_status table or the output of SHOW SLAVE STATUS.\nDisabling the MASTER_AUTO_POSITION option again makes the slave revert\nto file-based replication, in which case you must also specify one or\nboth of the MASTER_LOG_FILE or MASTER_LOG_POS options.\n\nIGNORE_SERVER_IDS takes a comma-separated list of 0 or more server IDs.\nEvents originating from the corresponding servers are ignored, with the\nexception of log rotation and deletion events, which are still recorded\nin the relay log.\n\nIn circular replication, the originating server normally acts as the\nterminator of its own events, so that they are not applied more than\nonce. Thus, this option is useful in circular replication when one of\nthe servers in the circle is removed. Suppose that you have a circular\nreplication setup with 4 servers, having server IDs 1, 2, 3, and 4, and\nserver 3 fails. When bridging the gap by starting replication from\nserver 2 to server 4, you can include IGNORE_SERVER_IDS = (3) in the\nCHANGE MASTER TO statement that you issue on server 4 to tell it to use\nserver 2 as its master instead of server 3. Doing so causes it to\nignore and not to propagate any statements that originated with the\nserver that is no longer in use.\n\nIf a CHANGE MASTER TO statement is issued without any IGNORE_SERVER_IDS\noption, any existing list is preserved. To clear the list of ignored\nservers, it is necessary to use the option with an empty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\n\nPrior to MySQL 5.7.5, RESET SLAVE ALL has no effect on the server ID\nlist. In MySQL 5.7.5 and later, RESET SLAVE ALL clears\nIGNORE_SERVER_IDS. (Bug #18816897)\n\nIf IGNORE_SERVER_IDS contains the server\'s own ID and the server was\nstarted with the --replicate-same-server-id option enabled, an error\nresults.\n\nThe master info repository and the output of SHOW SLAVE STATUS provide\nthe list of servers that are currently ignored. For more information,\nsee http://dev.mysql.com/doc/refman/5.7/en/slave-logs-status.html, and\n[HELP SHOW SLAVE STATUS].\n\nInvoking CHANGE MASTER TO causes the previous values for MASTER_HOST,\nMASTER_PORT, MASTER_LOG_FILE, and MASTER_LOG_POS to be written to the\nerror log, along with other information about the slave\'s state prior\nto execution.\n\nCHANGE MASTER TO causes an implicit commit of an ongoing transaction.\nSee http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nIn MySQL 5.7.4 and later, the strict requirement to execute STOP SLAVE\nprior to issuing any CHANGE MASTER TO statement (and START SLAVE\nafterward) is removed. Instead of depending on whether the slave is\nstopped, the behavior of CHANGE MASTER TO depends (in MySQL 5.7.4 and\nlater) on the states of the slave SQL thread and slave I/O threads;\nwhich of these threads is stopped or running now determines the options\nthat can or cannot be used with a CHANGE MASTER TO statement at a given\npoint in time. The rules for making this determination are listed here:\n\no If the SQL thread is stopped, you can execute CHANGE MASTER TO using\n any combination that is otherwise allowed of RELAY_LOG_FILE,\n RELAY_LOG_POS, and MASTER_DELAY options, even if the slave I/O thread\n is running. No other options may be used with this statement when the\n I/O thread is running.\n\no If the I/O thread is stopped, you can execute CHANGE MASTER TO using\n any of the options for this statement (in any allowed combination)\n except RELAY_LOG_FILE, RELAY_LOG_POS, or MASTER_DELAY, even when the\n SQL thread is running. These three options may not be used when the\n I/O thread is running.\n\no Both the SQL thread and the I/O thread must be stopped before issuing\n a CHANGE MASTER TO statement that employs MASTER_AUTO_POSITION = 1.\n\nYou can check the current state of the slave SQL and I/O threads using\nSHOW SLAVE STATUS.\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-solutions-switch.htm\nl.\n\nIf you are using statement-based replication and temporary tables, it\nis possible for a CHANGE MASTER TO statement following a STOP SLAVE\nstatement to leave behind temporary tables on the slave. From MySQL\n5.7, a warning (ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO) is issued\nwhenever this occurs. You can avoid this in such cases by making sure\nthat the value of the Slave_open_temp_tables system status variable is\nequal to 0 prior to executing such a CHANGE MASTER TO statement.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it with the master, you can\nrun CHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos\non the slave to specify the coordinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.example.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'password\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/change-master-to.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (82,37,'CHANGE REPLICATION FILTER','Syntax:\nCHANGE REPLICATION FILTER filter[, filter][, ...]\n\nfilter:\n REPLICATE_DO_DB = (db_list)\n | REPLICATE_IGNORE_DB = (db_list)\n | REPLICATE_DO_TABLE = (tbl_list)\n | REPLICATE_IGNORE_TABLE = (tbl_list)\n | REPLICATE_WILD_DO_TABLE = (wild_tbl_list)\n | REPLICATE_WILD_IGNORE_TABLE = (wild_tbl_list)\n | REPLICATE_REWRITE_DB = (db_pair_list)\n\ndb_list:\n db_name[, db_name][, ...]\n\ntbl_list:\n db_name.table_name[, db_table_name][, ...]\nwild_tbl_list:\n \'db_pattern.table_pattern\'[, \'db_pattern.table_pattern\'][, ...]\n\ndb_pair_list:\n (db_pair)[, (db_pair)][, ...]\n\ndb_pair:\n from_db, to_db\n\nCHANGE REPLICATION FILTER sets one or more replication filtering rules\non the slave in the same way as starting the slave mysqld with\nreplication filtering options such as --replicate-do-db or\n--replicate-wild-ignore-table. Unlike the case with the server options,\nthis statement does not require restarting the server to take effect,\nonly that the slave SQL thread be stopped using STOP SLAVE SQL_THREAD\nfirst (and restarted with START SLAVE SQL_THREAD afterwards). CHANGE\nREPLICATION FILTER requires the SUPER privilege.\n\nReplication filters cannot be set on a MySQL server instance that is\nconfigured for Group Replication, because filtering transactions on\nsome servers would make the group unable to reach agreement on a\nconsistent state.\n\nThe following list shows the CHANGE REPLICATION FILTER options and how\nthey relate to --replicate-* server options:\n\no REPLICATE_DO_DB: Include updates based on database name. Equivalent\n to --replicate-do-db.\n\no REPLICATE_IGNORE_DB: Exclude updates based on database name.\n Equivalent to --replicate-ignore-db.\n\no REPLICATE_DO_TABLE: Include updates based on table name. Equivalent\n to --replicate-do-table.\n\no REPLICATE_IGNORE_TABLE: Exclude updates based on table name.\n Equivalent to --replicate-ignore-table.\n\no REPLICATE_WILD_DO_TABLE: Include updates based on wildcard pattern\n matching table name. Equivalent to --replicate-wild-do-table.\n\no REPLICATE_WILD_IGNORE_TABLE: Exclude updates based on wildcard\n pattern matching table name. Equivalent to\n --replicate-wild-ignore-table.\n\no REPLICATE_REWRITE_DB: Perform updates on slave after substituting new\n name on slave for specified database on master. Equivalent to\n --replicate-rewrite-db.\n\nThe precise effects of REPLICATE_DO_DB and REPLICATE_IGNORE_DB filters\nare dependent on whether statement-based or row-based replication is in\neffect. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-rules.html, for more\ninformation.\n\nMultiple replication filtering rules can be created in a single CHANGE\nREPLICATION FILTER statement by separating the rules with commas, as\nshown here:\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (d1), REPLICATE_IGNORE_DB = (d2);\n\nIssuing the statement just shown is equivalent to starting the slave\nmysqld with the options --replicate-do-db=d1 --replicate-ignore-db=d2.\n\nIf the same filtering rule is specified multiple times, only the last\nsuch rule is actually used. For example, the two statements shown here\nhave exactly the same effect, because the first REPLICATE_DO_DB rule in\nthe first statement is ignored:\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (db1, db2), REPLICATE_DO_DB = (db3, db4);\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (db3,db4);\n\n*Caution*:\n\nThis behavior differs from that of the --replicate-* filter options\nwhere specifying the same option multiple times causes the creation of\nmultiple filter rules.\n\nNames of tables and database not containing any special characters need\nnot be quoted. Values used with REPLICATION_WILD_TABLE and\nREPLICATION_WILD_IGNORE_TABLE are string expressions, possibly\ncontaining (special) wildcard characters, and so must be quoted. This\nis shown in the following example statements:\n\nCHANGE REPLICATION FILTER\n REPLICATE_WILD_DO_TABLE = (\'db1.old%\');\n\nCHANGE REPLICATION FILTER\n REPLICATE_WILD_IGNORE_TABLE = (\'db1.new%\', \'db2.new%\');\n\nValues used with REPLICATE_REWRITE_DB represent pairs of database\nnames; each such value must be enclosed in parentheses. The following\nstatement rewrites statements occurring on database db1 on the master\nto database db2 on the slave:\n\nCHANGE REPLICATION FILTER REPLICATE_REWRITE_DB = ((db1, db2));\n\nThe statement just shown contains two sets of parentheses, one\nenclosing the pair of database names, and the other enclosing the\nentire list. This is perhap more easily seen in the following example,\nwhich creates two rewrite-db rules, one rewriting database dbA to dbB,\nand one rewriting database dbC to dbD:\n\nCHANGE REPLICATION FILTER\n REPLICATE_REWRITE_DB = ((dbA, dbB), (dbC, dbD));\n\nThis statement leaves any existing replication filtering rules\nunchanged; to unset all filters of a given type, set the filter\'s value\nto an explicitly empty list, as shown in this example, which removes\nall existing REPLICATE_DO_DB and REPLICATE_IGNORE_DB rules:\n\nCHANGE REPLICATION FILTER\n REPLICATE_DO_DB = (), REPLICATE_IGNORE_DB = ();\n\nSetting a filter to empty in this way removes all existing rules, does\nnot create any new ones, and does not restore any rules set at mysqld\nstartup using --replicate-* options on the command line or in the\nconfiguration file.\n\nValues employed with REPLICATE_WILD_DO_TABLE and\nREPLICATE_WILD_IGNORE_TABLE must be in the format db_name.tbl_name.\nPrior to MySQL 5.7.5, this was not strictly enforced, although using\nnonconforming values with these options could lead to erroneous results\n(Bug #18095449).\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-rules.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (83,10,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*:\n\nTrailing spaces are removed when CHAR values are retrieved unless the\nPAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (84,10,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (85,35,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(X\'65\')), CHARSET(CHAR(X\'65\' USING utf8));\n+----------------------+---------------------------------+\n| CHARSET(CHAR(X\'65\')) | CHARSET(CHAR(X\'65\' USING utf8)) |\n+----------------------+---------------------------------+\n| binary | utf8 |\n+----------------------+---------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (86,35,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (87,22,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (88,35,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmultibyte character counts as a single character. This means that for a\nstring containing five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (89,36,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption: {\n FOR UPGRADE\n | QUICK\n | FAST\n | MEDIUM\n | EXTENDED\n | CHANGED\n}\n\nCHECK TABLE checks a table or tables for errors. For MyISAM tables, the\nkey statistics are updated as well. CHECK TABLE can also check views\nfor problems, such as tables that are referenced in the view definition\nthat no longer exist.\n\nTo check a table, you must have some privilege for it.\n\nCHECK TABLE works for InnoDB, MyISAM, ARCHIVE, and CSV tables.\n\nBefore running CHECK TABLE on InnoDB tables, see\nhttp://dev.mysql.com/doc/refman/5.7/en/check-table.html#check-table-inn\nodb.\n\nCHECK TABLE is supported for partitioned tables, and you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-maintenance.html.\n\nCHECK TABLE ignores virtual generated columns that are not indexed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/check-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (90,36,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [QUICK | EXTENDED]\n\nCHECKSUM TABLE reports a checksum for the contents of a table. You can\nuse this statement to verify that the contents are the same before and\nafter a backup, rollback, or other operation that is intended to put\nthe data back to a known state.\n\nThis statement requires the SELECT privilege for the table.\n\nThis statement is not supported for views. If you run CHECKSUM TABLE\nagainst a view, the Checksum value is always NULL, and a warning is\nreturned.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nDuring the checksum operation, the table is locked with a read lock for\nInnoDB and MyISAM.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/checksum-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (91,5,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nAn error occurs if the cursor is not open.\n\nIf not closed explicitly, a cursor is closed at the end of the BEGIN\n... END block in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/close.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (92,4,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nThe return type of COALESCE() is the aggregated type of the argument\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (93,22,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n -> 0\nmysql> SELECT COERCIBILITY(USER());\n -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n -> 4\nmysql> SELECT COERCIBILITY(1000);\n -> 5\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (94,22,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (95,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (96,35,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent nonbinary string form.\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (97,35,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (98,22,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nThe value returned by CONNECTION_ID() is the same type of value as\ndisplayed in the ID column of the INFORMATION_SCHEMA.PROCESSLIST table,\nthe Id column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column\nof the Performance Schema threads table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n -> 23786\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (99,8,'CONSTRAINT','MySQL supports foreign keys, which let you cross-reference related data\nacross tables, and foreign key constraints, which help keep this\nspread-out data consistent. The essential syntax for a foreign key\nconstraint definition in a CREATE TABLE or ALTER TABLE statement looks\nlike this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (col_name, ...)\n REFERENCES tbl_name (col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html\n\n','CREATE TABLE product (\n category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)\n) ENGINE=INNODB;\n\nCREATE TABLE customer (\n id INT NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=INNODB;\n\nCREATE TABLE product_order (\n 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\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n INDEX (customer_id),\n\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)\n) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (100,27,'CONTAINS','Contains(g1, g2)\n\nMBRContains() and Contains() are synonyms. For more information, see\nthe description of MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (101,29,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If from_base\nis a negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+X\'0a\',10,10);\n -> \'40\'\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (102,35,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() function takes an expression of any type and produces a\nresult value of the specified type.\n\nDiscussion of CONVERT(expr, type) syntax here also applies to CAST(expr\nAS type), which is equivalent.\n\nCONVERT(... USING ...) is standard SQL syntax. The non-USING form of\nCONVERT() is ODBC syntax.\n\nCONVERT() with USING converts data between different character sets. In\nMySQL, transcoding names are the same as the corresponding character\nset names. For example, this statement converts the string \'abc\' in the\ndefault character set to the corresponding string in the utf8 character\nset:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nCONVERT() without USING and CAST() take an expression and a type value\nspecifying the result type. These type values are permitted:\n\no BINARY[(N)]\n\n Produces a string with the BINARY data type. See\n http://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html for a\n description of how this affects comparisons. If the optional length N\n is given, BINARY(N) causes the cast to use no more than N bytes of\n the argument. Values shorter than N bytes are padded with 0x00 bytes\n to a length of N.\n\no CHAR[(N)] [charset_info]\n\n Produces a string with the CHAR data type. If the optional length N\n is given, CHAR(N) causes the cast to use no more than N characters of\n the argument. No padding occurs for values shorter than N characters.\n\n With no charset_info clause, CHAR produces a string with the default\n character set. To specify the character set explicitly, these\n charset_info values are permitted:\n\n o CHARACTER SET charset_name: Produces a string with the given\n character set.\n\n o ASCII: Shorthand for CHARACTER SET latin1.\n\n o UNICODE: Shorthand for CHARACTER SET ucs2.\n\n In all cases, the string has the default collation for the character\n set.\n\no DATE\n\n Produces a DATE value.\n\no DATETIME\n\n Produces a DATETIME value.\n\no DECIMAL[(M[,D])]\n\n Produces a DECIMAL value. If the optional M and D values are given,\n they specify the maximum number of digits (the precision) and the\n number of digits following the decimal point (the scale).\n\no JSON (added in MySQL 5.7.8)\n\n Produces a JSON value. For details on the rules for conversion of\n values between JSON and other types, see\n http://dev.mysql.com/doc/refman/5.7/en/json.html#json-comparison.\n\no NCHAR[(N)]\n\n Like CHAR, but produces a string with the national character set. See\n http://dev.mysql.com/doc/refman/5.7/en/charset-national.html.\n\n Unlike CHAR, NCHAR does not permit trailing character set information\n to be specified.\n\no SIGNED [INTEGER]\n\n Produces a signed integer value.\n\no TIME\n\n Produces a TIME value.\n\no UNSIGNED [INTEGER]\n\n Produces an unsigned integer value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/cast-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (103,11,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (104,20,'CONVEXHULL','ConvexHull(g)\n\nST_ConvexHull() and ConvexHull() are synonyms. For more information,\nsee the description of ST_ConvexHull().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (105,29,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n -> -1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (106,29,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n -> -1.5726734063977\nmysql> SELECT COT(0);\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (107,14,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nIf there are no matching rows, COUNT() returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n FROM student,course\n WHERE student.student_id=course.student_id\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (108,14,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nIf there are no matching rows, COUNT(DISTINCT) returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (109,29,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n -> 2501908538\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (110,8,'CREATE DATABASE','Syntax:\nCREATE {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\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (111,8,'CREATE EVENT','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\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 \'string\']\n DO event_body;\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\nThis statement creates and schedules a new event. The event will not\nrun unless the Event Scheduler is enabled. For information about\nchecking Event Scheduler status and enabling it if necessary, see\nhttp://dev.mysql.com/doc/refman/5.7/en/events-configuration.html.\n\nCREATE EVENT requires the EVENT privilege for the schema in which the\nevent is to be created. It might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n identifies the event in a database schema.\n\no An ON SCHEDULE clause, which determines when and how often the event\n executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once---one hour following its creation---by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case-sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.7/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (112,8,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (113,38,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name\n RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the base name of the shared library file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/udf-loading.html.\n\nTo create a function, you must have the INSERT privilege for the mysql\nsystem database. This is necessary because CREATE FUNCTION adds a row\nto the mysql.func system table that records the function\'s name, type,\nand shared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-function-udf.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (114,8,'CREATE INDEX','Syntax:\nCREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name\n [index_type]\n ON tbl_name (key_part,...)\n [index_option]\n [algorithm_option | lock_option] ...\n\nkey_part:\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\nindex_type:\n USING {BTREE | HASH}\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT | INPLACE | COPY}\n\nlock_option:\n LOCK [=] {DEFAULT | NONE | SHARED | EXCLUSIVE}\n\nNormally, you create all indexes on a table at the time the table\nitself is created with CREATE TABLE. See [HELP CREATE TABLE]. This\nguideline is especially important for InnoDB tables, where the primary\nkey determines the physical layout of rows in the data file. CREATE\nINDEX enables you to add indexes to existing tables.\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (115,8,'CREATE LOGFILE GROUP','Syntax:\nCREATE LOGFILE GROUP logfile_group\n ADD UNDOFILE \'undo_file\'\n [INITIAL_SIZE [=] initial_size]\n [UNDO_BUFFER_SIZE [=] undo_buffer_size]\n [REDO_BUFFER_SIZE [=] redo_buffer_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] \'string\']\n ENGINE [=] engine_name\n\nThis statement creates a new log file group named logfile_group having\na single UNDO file named \'undo_file\'. A CREATE LOGFILE GROUP statement\nhas one and only one ADD UNDOFILE clause. For rules covering the naming\nof log file groups, see\nhttp://dev.mysql.com/doc/refman/5.7/en/identifiers.html.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nThere can be only one log file group per NDB Cluster instance at any\ngiven time.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size;\nif not specified, it defaults to 128M (128 megabytes). The optional\nUNDO_BUFFER_SIZE parameter sets the size used by the UNDO buffer for\nthe log file group; The default value for UNDO_BUFFER_SIZE is 8M (eight\nmegabytes); this value cannot exceed the amount of system memory\navailable. Both of these parameters are specified in bytes. You may\noptionally follow either or both of these with a one-letter\nabbreviation for an order of magnitude, similar to those used in\nmy.cnf. Generally, this is one of the letters M (for megabytes) or G\n(for gigabytes).\n\nMemory used for UNDO_BUFFER_SIZE comes from the global pool whose size\nis determined by the value of the SharedGlobalMemory data node\nconfiguration parameter. This includes any default value implied for\nthis option by the setting of the InitialLogFileGroup data node\nconfiguration parameter.\n\nThe maximum permitted for UNDO_BUFFER_SIZE is 629145600 (600 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB).\n\nThe ENGINE option determines the storage engine to be used by this log\nfile group, with engine_name being the name of the storage engine. In\nMySQL 5.7, this must be NDB (or NDBCLUSTER). If ENGINE is not set,\nMySQL tries to use the engine specified by the default_storage_engine\nserver system variable (formerly storage_engine). In any case, if the\nengine is not specified as NDB or NDBCLUSTER, the CREATE LOGFILE GROUP\nstatement appears to succeed but actually fails to create the log file\ngroup, as shown here:\n\nmysql> CREATE LOGFILE GROUP lg1\n -> ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+-------+------+------------------------------------------------------------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------------------------------------------------------------+\n| Error | 1478 | Table storage engine \'InnoDB\' does not support the create option \'TABLESPACE or LOGFILE GROUP\' |\n+-------+------+------------------------------------------------------------------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> DROP LOGFILE GROUP lg1 ENGINE = NDB; \nERROR 1529 (HY000): Failed to drop LOGFILE GROUP\n\nmysql> CREATE LOGFILE GROUP lg1\n -> ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M\n -> ENGINE = NDB;\nQuery OK, 0 rows affected (2.97 sec)\n\nThe fact that the CREATE LOGFILE GROUP statement does not actually\nreturn an error when a non-NDB storage engine is named, but rather\nappears to succeed, is a known issue which we hope to address in a\nfuture release of NDB Cluster.\n\nREDO_BUFFER_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but ignored,\nand so have no effect in MySQL 5.7. These options are intended for\nfuture expansion.\n\nWhen used with ENGINE [=] NDB, a log file group and associated UNDO log\nfile are created on each Cluster data node. You can verify that the\nUNDO files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, LOGFILE_GROUP_NUMBER, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE FILE_NAME = \'undo_10.dat\';\n+--------------------+----------------------+----------------+\n| LOGFILE_GROUP_NAME | LOGFILE_GROUP_NUMBER | EXTRA |\n+--------------------+----------------------+----------------+\n| lg_3 | 11 | CLUSTER_NODE=3 |\n| lg_3 | 11 | CLUSTER_NODE=4 |\n+--------------------+----------------------+----------------+\n2 rows in set (0.06 sec)\n\nCREATE LOGFILE GROUP is useful only with Disk Data storage for NDB\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-logfile-group.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (116,8,'CREATE PROCEDURE','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n FUNCTION sp_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n param_name type\n\ntype:\n Any valid MySQL data type\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nroutine_body:\n Valid SQL routine statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.7/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. Stored functions share\ntheir namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.7/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nCREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE\nprivilege. They might also require the SUPER privilege, depending on\nthe DEFINER value, as described later in this section. If binary\nlogging is enabled, CREATE FUNCTION might require the SUPER privilege,\nas described in\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html.\n\nBy default, MySQL automatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the routine creator. This behavior can be changed by\ndisabling the automatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-routines-privileges.html.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later in this section.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always permissible to have spaces after a stored\nroutine name, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*:\n\nSpecifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. For a FUNCTION, parameters are always regarded as IN\nparameters.\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an OUT or INOUT\nparameter. If you are calling the procedure from within a trigger, you\ncan also pass NEW.col_name as an OUT or INOUT parameter.\n\nFor information about the effect of unhandled conditions on procedure\nparameters, see\nhttp://dev.mysql.com/doc/refman/5.7/en/conditions-and-parameters.html.\n\nRoutine parameters cannot be referenced in statements prepared within\nthe routine; see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html\n.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n -> BEGIN\n -> SELECT COUNT(*) INTO param1 FROM t;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a |\n+------+\n| 3 |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis enables the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type. The COLLATE attribute can be used if preceded by a\nCHARACTER SET specification.\n\nThe routine_body consists of a valid SQL routine statement. This can be\na simple statement such as SELECT or INSERT, or a compound statement\nwritten using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.7/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL permits routines to contain DDL statements, such as CREATE and\nDROP. MySQL also permits stored procedures (but not stored functions)\nto contain SQL transaction statements such as COMMIT. Stored functions\nmay not contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\npermit them.\n\nStatements that return a result set can be used within a stored\nprocedure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are not permitted. When a routine\nis invoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). The causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not permitted in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting in effect when a\nroutine is created or altered, and always executes the routine with\nthis setting in force, regardless of the current server SQL mode when\nthe routine begins executing.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (117,8,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\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\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nin the servers table in the mysql database. This statement requires the\nSUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name is an identifier and may be quoted with single\nquotation marks.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*:\n\nThe OWNER option is currently not applied, and has no effect on the\nownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'198.51.100.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.7/en/create-server.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (118,8,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n [IGNORE | REPLACE]\n [AS] query_expression\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n col_name column_definition\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (key_part,...)\n [index_option] ...\n | {INDEX|KEY} [index_name] [index_type] (key_part,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n [index_name] [index_type] (key_part,...)\n [index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (key_part,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (col_name,...) reference_definition\n | CHECK (expr)\n\ncolumn_definition:\n data_type [NOT NULL | NULL] [DEFAULT default_value]\n [AUTO_INCREMENT] [UNIQUE [KEY]] [[PRIMARY] KEY]\n [COMMENT \'string\']\n [COLLATE collation_name]\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [STORAGE {DISK|MEMORY|DEFAULT}]\n [reference_definition]\n | data_type [GENERATED ALWAYS] AS (expression)\n [VIRTUAL | STORED] [NOT NULL | NULL]\n [UNIQUE [KEY]] [[PRIMARY] KEY]\n [COMMENT \'string\']\n\ndata_type:\n (see http://dev.mysql.com/doc/refman/5.7/en/data-types.html)\n\nkey_part:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nreference_definition:\n REFERENCES tbl_name (key_part,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | COMPRESSION [=] {\'ZLIB\'|\'LZ4\'|\'NONE\'}\n | CONNECTION [=] \'connect_string\'\n | {DATA|INDEX} DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTION [=] {\'Y\' | \'N\'}\n | ENGINE [=] engine_name\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] value\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list)\n | RANGE{(expr) | COLUMNS(column_list)}\n | LIST{(expr) | COLUMNS(column_list)} }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n PARTITION partition_name\n [VALUES\n {LESS THAN {(expr | value_list) | MAXVALUE}\n |\n IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'string\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'string\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n\nquery_expression:\n SELECT ... (Some valid select or union statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nBy default, tables are created in the default database, using the\nInnoDB storage engine. An error occurs if the table exists, if there is\nno default database, or if the database does not exist.\n\nFor information about the physical representation of a table, see\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-files.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (119,8,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n\n InnoDB and NDB:\n ADD DATAFILE \'file_name\'\n\n InnoDB only:\n [FILE_BLOCK_SIZE = value]\n\n NDB only:\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] \'string\']\n\n InnoDB and NDB:\n [ENGINE [=] engine_name]\n\nThis statement is used to create a tablespace. The precise syntax and\nsemantics depend on the storage engine used. In standard MySQL 5.7\nreleases, this is always an InnoDB tablespace. MySQL NDB Cluster 7.5\nalso supports tablespaces using the NDB storage engine in addition to\nthose using InnoDB.\n\no http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html#create-\n tablespace-innodb\n\no http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html#create-\n tablespace-ndb\n\no http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html#create-\n tablespace-options\n\no http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html#create-\n tablespace-notes\n\no http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html#create-\n tablespace-innodb-examples\n\no http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html#create-\n tablespace-ndb-examples\n\nConsiderations for InnoDB\n\nCREATE TABLESPACE syntax is used to create general tabelspaces. A\ngeneral tablespace is a shared tablespace. It can hold multiple tables,\nand supports all table row formats. General tablespaces can be created\nin a location relative to or independent of the data directory.\n\nAfter creating an InnoDB general tablespace, you can use CREATE TABLE\ntbl_name ... TABLESPACE [=] tablespace_name or ALTER TABLE tbl_name\nTABLESPACE [=] tablespace_name to add tables to the tablespace. For\nmore information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/general-tablespaces.html.\n\nConsiderations for NDB Cluster\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for NDB Cluster Disk Data\ntables (see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data.html).\nOne data file is created and added to the tablespace using this\nstatement. Additional data files may be added to the tablespace by\nusing the ALTER TABLESPACE statement (see [HELP ALTER TABLESPACE]).\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see [HELP CREATE LOGFILE GROUP]). Multiple tablespaces\nmay use the same log file group for UNDO logging.\n\nWhen setting EXTENT_SIZE or INITIAL_SIZE, you may optionally follow the\nnumber with a one-letter abbreviation for an order of magnitude,\nsimilar to those used in my.cnf. Generally, this is one of the letters\nM (for megabytes) or G (for gigabytes).\n\nINITIAL_SIZE and EXTENT_SIZE are subject to rounding as follows:\n\no EXTENT_SIZE is rounded up to the nearest whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K;\n this result is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nWhen CREATE TABLESPACE is used with ENGINE [=] NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. (See the example\nlater in this section.)\n\n(See http://dev.mysql.com/doc/refman/5.7/en/files-table.html.)\n\nOptions\n\no ADD DATAFILE: Defines the name of a tablespace data file; this option\n is always required. An InnoDB tablespace supports only a single data\n file, whose name must include a .ibd extension. An NDB Cluster\n tablespace supports multiple data files which can have any legal file\n names; more data files can be added to an NDB Cluster tablespace\n following its creation by using an ALTER TABLESPACE statement.\n\n *Note*:\n\n ALTER TABLESPACE is not supported by InnoDB.\n\n To place the data file in a location outside of the data directory\n (datadir), include an absolute directory path or a path relative to\n the data directory. If you do not specify a path, the tablespace is\n created in the data directory. An isl file is created in the data\n directory when an InnoDB tablespace is created outside of the data\n directory.\n\n To avoid conflicts with implicitly created file-per-table\n tablespaces, creating a general tablespace in a subdirectory under\n the data directory is not supported. When creating a general\n tablespace outside of the data directory, the directory must exist\n prior to creating the tablespace.\n\n The file_name, including any specified path, must be quoted with\n single or double quotations marks. File names (not counting the file\n extension) and directory names must be at least one byte in length.\n Zero length file names and directory names are not supported.\n\no FILE_BLOCK_SIZE: This option---which is specific to InnoDB, and is\n ignored by NDB---defines the block size for the tablespace data file.\n Values can be specified in bytes or kilobytes. For example, an 8\n kilobyte file block size can be specified as 8192 or 8K. If you do\n not specify this option, FILE_BLOCK_SIZE defaults to the\n innodb_page_size value. FILE_BLOCK_SIZE is required when you intend\n to use the tablespace for storing compressed InnoDB tables\n (ROW_FORMAT=COMPRESSED). In this case, you must define the tablespace\n FILE_BLOCK_SIZE when creating the tablespace.\n\n If FILE_BLOCK_SIZE is equal the innodb_page_size value, the\n tablespace can contain only tables having an uncompressed row format\n (COMPACT, REDUNDANT, and DYNAMIC). Tables with a COMPRESSED row\n format have a different physical page size than uncompressed tables.\n Therefore, compressed tables cannot coexist in the same tablespace as\n uncompressed tables.\n\n For a general tablespace to contain compressed tables,\n FILE_BLOCK_SIZE must be specified, and the FILE_BLOCK_SIZE value must\n be a valid compressed page size in relation to the innodb_page_size\n value. Also, the physical page size of the compressed table\n (KEY_BLOCK_SIZE) must be equal to FILE_BLOCK_SIZE/1024. For example,\n if innodb_page_size=16K, and FILE_BLOCK_SIZE=8K, the KEY_BLOCK_SIZE\n of the table must be 8. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/general-tablespaces.html.\n\no USE LOGFILE GROUP: Required for NDB, this is the name of a log file\n group previously created using CREATE LOGFILE GROUP. Not supported\n for InnoDB, where it fails with an error.\n\no EXTENT_SIZE: This option is specific to NDB, and is not supported by\n InnoDB, where it fails with an error. EXTENT_SIZE sets the size, in\n bytes, of the extents used by any files belonging to the tablespace.\n The default value is 1M. The minimum size is 32K, and theoretical\n maximum is 2G, although the practical maximum size depends on a\n number of factors. In most cases, changing the extent size does not\n have any measurable effect on performance, and the default value is\n recommended for all but the most unusual situations.\n\n An extent is a unit of disk space allocation. One extent is filled\n with as much data as that extent can contain before another extent is\n used. In theory, up to 65,535 (64K) extents may used per data file;\n however, the recommended maximum is 32,768 (32K). The recommended\n maximum size for a single data file is 32G---that is, 32K extents x 1\n MB per extent. In addition, once an extent is allocated to a given\n partition, it cannot be used to store data from a different\n partition; an extent cannot store data from more than one partition.\n This means, for example that a tablespace having a single datafile\n whose INITIAL_SIZE (described in the following item) is 256 MB and\n whose EXTENT_SIZE is 128M has just two extents, and so can be used to\n store data from at most two different disk data table partitions.\n\n You can see how many extents remain free in a given data file by\n querying the INFORMATION_SCHEMA.FILES table, and so derive an\n estimate for how much space remains free in the file. For further\n discussion and examples, see\n http://dev.mysql.com/doc/refman/5.7/en/files-table.html.\n\no INITIAL_SIZE: This option is specific to NDB, and is not supported by\n InnoDB, where it fails with an error.\n\n The INITIAL_SIZE parameter sets the total size in bytes of the data\n file that was specific using ADD DATATFILE. Once this file has been\n created, its size cannot be changed; however, you can add more data\n files to the tablespace using ALTER TABLESPACE ... ADD DATAFILE.\n\n INITIAL_SIZE is optional; its default value is 134217728 (128 MB).\n\n On 32-bit systems, the maximum supported value for INITIAL_SIZE is\n 4294967296 (4 GB).\n\no AUTOEXTEND_SIZE: Currently ignored by MySQL; reserved for possible\n future use. Has no effect in any release of MySQL 5.7 or MySQL NDB\n Cluster 7.5, regardless of the storage engine used.\n\no MAX_SIZE: Currently ignored by MySQL; reserved for possible future\n use. Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster\n 7.5, regardless of the storage engine used.\n\no NODEGROUP: Currently ignored by MySQL; reserved for possible future\n use. Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster\n 7.5, regardless of the storage engine used.\n\no WAIT: Currently ignored by MySQL; reserved for possible future use.\n Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster 7.5,\n regardless of the storage engine used.\n\no COMMENT: Currently ignored by MySQL; reserved for possible future\n use. Has no effect in any release of MySQL 5.7 or MySQL NDB Cluster\n 7.5, regardless of the storage engine used.\n\no ENGINE: Defines the storage engine which uses the tablespace, where\n engine_name is the name of the storage engine. Currently, only the\n InnoDB storage engine is supported by standard MySQL 5.7 releases.\n MySQL NDB Cluster 7.5 supports both NDB and InnoDB tablespaces. The\n value of the default_storage_engine system variable is used for\n ENGINE if the option is not specified.\n\nNotes\n\no For the rules covering the naming of MySQL tablespaces, see\n http://dev.mysql.com/doc/refman/5.7/en/identifiers.html. In addition\n to these rules, the slash character ("/") is not permitted, nor can\n you use names beginning with innodb_, as this prefix is reserved for\n system use.\n\no Tablespaces do not support temporary tables.\n\no innodb_file_per_table, innodb_file_format, and innodb_file_format_max\n settings have no influence on CREATE TABLESPACE operations.\n innodb_file_per_table does not need to be enabled. General\n tablespaces support all table row formats regardless of file format\n settings. Likewise, general tablespaces support the addition of\n tables of any row format using CREATE TABLE ... TABLESPACE,\n regardless of file format settings.\n\no innodb_strict_mode is not applicable to general tablespaces.\n Tablespace management rules are strictly enforced independently of\n innodb_strict_mode. If CREATE TABLESPACE parameters are incorrect or\n incompatible, the operation fails regardless of the\n innodb_strict_mode setting. When a table is added to a general\n tablespace using CREATE TABLE ... TABLESPACE or ALTER TABLE ...\n TABLESPACE, innodb_strict_mode is ignored but the statement is\n evaluated as if innodb_strict_mode is enabled.\n\no Use DROP TABLESPACE to remove a tablespace. All tables must be\n dropped from a tablespace using DROP TABLE prior to dropping the\n tablespace. Before dropping an NDB Cluster tablespace you must also\n remove all its data files using one or more ALTER TABLESPACE ... DROP\n DATATFILE statements. See\n http://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data-object\n s.html.\n\no All parts of an InnoDB table added to an InnoDB general tablespace\n reside in the general tablespace, including indexes and BLOB pages.\n\n For an NDB table assigned to a tablespace, only those columns which\n are not indexed are stored on disk, and actually use the tablespace\n data files. Indexes and indexed columns for all NDB tables are always\n kept in memory.\n\no Similar to the system tablespace, truncating or dropping tables\n stored in a general tablespace creates free space internally in the\n general tablespace .ibd data file which can only be used for new\n InnoDB data. Space is not released back to the operating system as it\n is for file-per-table tablespaces.\n\no A general tablespace is not associated with any database or schema.\n\no ALTER TABLE ... DISCARD TABLESPACE and ALTER TABLE ...IMPORT\n TABLESPACE are not supported for tables that belong to a general\n tablespace.\n\no The server uses tablespace-level metadata locking for DDL that\n references general tablespaces. By comparison, the server uses\n table-level metadata locking for DDL that references file-per-table\n tablespaces.\n\no A generated or existing tablespace cannot be changed to a general\n tablespace.\n\no Tables stored in a general tablespace can only be opened in MySQL\n 5.7.6 or later due to the addition of new table flags.\n\no There is no conflict between general tablespace names and\n file-per-table tablespace names. The "/" character, which is present\n in file-per-table tablespace names, is not permitted in general\n tablespace names.\n\no mysqldump and mysqlpump do not dump InnoDB CREATE TABLESPACE\n statements.\n\nInnoDB Examples\n\nThis example demonstrates creating a general tablespace and adding\nthree uncompressed tables of different row formats.\n\nmysql> CREATE TABLESPACE `ts1` ADD DATAFILE \'ts1.ibd\' ENGINE=INNODB;\n\nmysql> CREATE TABLE t1 (c1 INT PRIMARY KEY) TABLESPACE ts1 ROW_FORMAT=REDUNDANT;\n\nmysql> CREATE TABLE t2 (c1 INT PRIMARY KEY) TABLESPACE ts1 ROW_FORMAT=COMPACT;\n\nmysql> CREATE TABLE t3 (c1 INT PRIMARY KEY) TABLESPACE ts1 ROW_FORMAT=DYNAMIC;\n\nThis example demonstrates creating a general tablespace and adding a\ncompressed table. The example assumes a default innodb_page_size value\nof 16K. The FILE_BLOCK_SIZE of 8192 requires that the compressed table\nhave a KEY_BLOCK_SIZE of 8.\n\nmysql> CREATE TABLESPACE `ts2` ADD DATAFILE \'ts2.ibd\' FILE_BLOCK_SIZE = 8192 Engine=InnoDB;\n\nmysql> CREATE TABLE t4 (c1 INT PRIMARY KEY) TABLESPACE ts2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;\n\nNDB Example\n\nSuppose that you wish to create an NDB Cluster Disk Data tablespace\nnamed myts using a datafile named mydata-1.dat. An NDB tablespace\nalways requires the use of a log file group consisting of one or more\nundo log files. For this example, we first create a log file group\nnamed mylg that contains one undo long file named myundo-1.dat, using\nthe CREATE LOGFILE GROUP statement shown here:\n\nmysql> CREATE LOGFILE GROUP myg1\n -> ADD UNDOFILE \'myundo-1.dat\'\n -> ENGINE=NDB;\nQuery OK, 0 rows affected (3.29 sec)\n\nNow you can create the tablespace previously described using the\nfollowing statement:\n\nmysql> CREATE TABLESPACE myts\n -> ADD DATAFILE \'mydata-1.dat\'\n -> USE LOGFILE GROUP mylg\n -> ENGINE=NDB;\nQuery OK, 0 rows affected (2.98 sec)\n\nYou can now create a Disk Data table using a CREATE TABLE statement\nwith the TABLESPACE and STORAGE DISK options, similar to what is shown\nhere:\n\nmysql> CREATE TABLE mytable (\n -> id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> lname VARCHAR(50) NOT NULL,\n -> fname VARCHAR(50) NOT NULL,\n -> dob DATE NOT NULL,\n -> joined DATE NOT NULL,\n -> INDEX(last_name, first_name)\n -> )\n -> TABLESPACE myts STORAGE DISK\n -> ENGINE=NDB;\nQuery OK, 0 rows affected (1.41 sec)\n\nIt is important to note that only the dob and joined columns from\nmytable are actually stored on disk, due to the fact that the id,\nlname, and fname columns are all indexed.\n\nAs mentioned previously, when CREATE TABLESPACE is used with ENGINE [=]\nNDB, a tablespace and associated data file are created on each NDB\nCluster data node. You can verify that the data files were created and\nobtain information about them by querying the INFORMATION_SCHEMA.FILES\ntable, as shown here:\n\nmysql> SELECT FILE_NAME, FILE_TYPE, LOGFILE_GROUP_NAME, STATUS, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'myts\';\n\n+--------------+------------+--------------------+--------+----------------+\n| file_name | file_type | logfile_group_name | status | extra |\n+--------------+------------+--------------------+--------+----------------+\n| mydata-1.dat | DATAFILE | mylg | NORMAL | CLUSTER_NODE=5 |\n| mydata-1.dat | DATAFILE | mylg | NORMAL | CLUSTER_NODE=6 |\n| NULL | TABLESPACE | mylg | NORMAL | NULL |\n+--------------+------------+--------------------+--------+----------------+\n3 rows in set (0.01 sec)\n\nFor additional information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-disk-data-objects.\nhtml.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-tablespace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (120,8,'CREATE TRIGGER','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name\n trigger_time trigger_event\n ON tbl_name FOR EACH ROW\n [trigger_order]\n trigger_body\n\ntrigger_time: { BEFORE | AFTER }\n\ntrigger_event: { INSERT | UPDATE | DELETE }\n\ntrigger_order: { FOLLOWS | PRECEDES } other_trigger_name\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nTrigger names exist in the schema namespace, meaning that all triggers\nmust have unique names within a schema. Triggers in different schemas\ncan have the same name.\n\nThis section describes CREATE TRIGGER syntax. For additional\ndiscussion, see\nhttp://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. The statement might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section. If\nbinary logging is enabled, CREATE TRIGGER might require the SUPER\nprivilege, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-logging.html.\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time, as described\nlater in this section.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\nBasic column value checks occur prior to trigger activation, so you\ncannot use BEFORE triggers to convert values inappropriate for the\ncolumn type to valid values.\n\ntrigger_event indicates the kind of operation that activates the\ntrigger. These trigger_event values are permitted:\n\no INSERT: The trigger activates whenever a new row is inserted into the\n table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger activates whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger activates whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements. DROP TABLE\n and TRUNCATE TABLE statements on the table do not activate this\n trigger, because they do not use DELETE. Dropping a partition does\n not activate DELETE triggers, either.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-trigger.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (121,1,'CREATE USER','Syntax:\nCREATE USER [IF NOT EXISTS]\n user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [password_option | lock_option] ...\n\nuser:\n (see )\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n | IDENTIFIED BY PASSWORD \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\npassword_option: {\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n}\n\nlock_option: {\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nThe CREATE USER statement creates new MySQL accounts. It enables\nauthentication, SSL/TLS, resource-limit, and password-management\nproperties to be established for new accounts, and controls whether\naccounts are initially locked or unlocked.\n\nTo use CREATE USER, you must have the global CREATE USER privilege, or\nthe INSERT privilege for the mysql system database. When the read_only\nsystem variable is enabled, CREATE USER additionally requires the SUPER\nprivilege.\n\nAn error occurs if you try to create an account that already exists. If\nthe IF NOT EXISTS clause is given, the statement produces a warning for\neach named account that already exists, rather than an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (122,8,'CREATE VIEW','Syntax:\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\nview if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW replaces it.\n\nFor information about restrictions on view use, see\nhttp://dev.mysql.com/doc/refman/5.7/en/view-restrictions.html.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (Selecting from the view selects, in effect, using the\nSELECT statement.) The select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time and is not affected by\nsubsequent changes to the definitions of the underlying tables. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view, and columns dropped\nfrom the table will result in an error when selecting from the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement, you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view. CREATE VIEW might also\nrequire the SUPER privilege, depending on the DEFINER value, as\ndescribed later in this section.\n\nWhen a view is referenced, privilege checking occurs as described later\nin this section.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nuse db_name.view_name syntax to qualify the view name with the database\nname:\n\nCREATE VIEW test.v AS SELECT * FROM t;\n\nUnqualified table or view names in the SELECT statement are also\ninterpreted with respect to the default database. A view can refer to\ntables or views in other databases by qualifying the table or view name\nwith the appropriate database name.\n\nWithin a database, base tables and views share the same namespace, so a\nbase table and a view cannot have the same name.\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns, or expressions that use functions, constant values,\noperators, and so forth.\n\nA view must have unique column names with no duplicates, just like a\nbase table. By default, the names of the columns retrieved by the\nSELECT statement are used for the view column names. To define explicit\nnames for the view columns, specify the optional column_list clause as\na list of comma-separated identifiers. The number of names in\ncolumn_list must be the same as the number of columns retrieved by the\nSELECT statement.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables:\n\nCREATE VIEW v_today (today) AS SELECT CURRENT_DATE;\n\nThe following example defines a view that selects two columns from\nanother table as well as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot refer to system variables or user-defined\n variables.\n\no Within a stored program, the SELECT statement cannot refer to program\n parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. If, after\n the view has been created, a table or view that the definition refers\n to is dropped, use of the view results in an error. To check a view\n definition for problems of this kind, use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n create a TEMPORARY view.\n\no You cannot associate a trigger with a view.\n\no Aliases for column names in the SELECT statement are checked against\n the maximum column length of 64 characters (not the maximum alias\n length of 256 characters).\n\nORDER BY is permitted in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nThe results obtained from a view may be affected if you change the\nquery processing environment by changing system variables:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. The valid SQL SECURITY\ncharacteristic values are DEFINER (the default) and INVOKER. These\nindicate that the required privileges must be held by the user who\ndefined or invoked the view, respectively.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount specified as \'user_name\'@\'host_name\', CURRENT_USER, or\nCURRENT_USER(). The default DEFINER value is the user who executes the\nCREATE VIEW statement. This is the same as specifying DEFINER =\nCURRENT_USER explicitly.\n\nIf the DEFINER clause is present, these rules determine the valid\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only valid user value is\n your own account, either specified literally or by using\n CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n valid account name. If the account does not exist, a warning is\n generated.\n\no Although it is possible to create a view with a nonexistent DEFINER\n account, an error occurs when the view is referenced if the SQL\n SECURITY value is DEFINER but the definer account does not exist.\n\nFor more information about view security, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-security.html.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default. For views defined with the SQL SECURITY INVOKER\ncharacteristic, CURRENT_USER returns the account for the view\'s\ninvoker. For information about user auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.7/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a routine, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nMySQL checks view privileges like this:\n\no At view definition time, the view creator must have the privileges\n needed to use the top-level objects accessed by the view. For\n example, if the view definition refers to table columns, the creator\n must have some privilege for each column in the select list of the\n definition, and the SELECT privilege for each column used elsewhere\n in the definition. If the definition refers to a stored function,\n only the privileges needed to invoke the function can be checked. The\n privileges required at function invocation time can be checked only\n as it executes: For different invocations, different execution paths\n within the function might be taken.\n\no The user who references a view must have appropriate privileges to\n access it (SELECT to select from it, INSERT to insert into it, and so\n forth.)\n\no When a view has been referenced, privileges for objects accessed by\n the view are checked against the privileges held by the view DEFINER\n account or invoker, depending on whether the SQL SECURITY\n characteristic is DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n privilege checking for statements executed within the function depend\n on whether the function SQL SECURITY characteristic is DEFINER or\n INVOKER. If the security characteristic is DEFINER, the function runs\n with the privileges of the DEFINER account. If the characteristic is\n INVOKER, the function runs with the privileges determined by the\n view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY DEFINER. The standard says that the definer of the view,\nwhich is the same as the owner of the view\'s schema, gets applicable\nprivileges on the view (for example, SELECT) and may grant them. MySQL\nhas no concept of a schema "owner", so MySQL adds a clause to identify\nthe definer. The DEFINER clause is an extension where the intent is to\nhave what the standard has; that is, a permanent record of who defined\nthe view. This is why the default DEFINER value is the account of the\nview creator.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/view-algorithms.html, as well as\nhttp://dev.mysql.com/doc/refman/5.7/en/derived-table-optimization.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nA generated column in a view is considered updatable because it is\npossible to assign to it. However, if such a column is updated\nexplicitly, the only permitted value is DEFAULT. For information about\ngenerated columns, see\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.h\ntml.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.7/en/view-updatability.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/view-check-option.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/create-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (123,27,'CREATE_ASYMMETRIC_PRIV_KEY','Syntax:\nCREATE_ASYMMETRIC_PRIV_KEY(algorithm, {key_len|dh_secret})\n\nCreates a private key using the given algorithm and key length or DH\nsecret, and returns the key as a binary string in PEM format. If key\ngeneration fails, the result is NULL.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nSupported key_len values: The minimum key length in bits is 1,024. The\nmaximum key length depends on the algorithm: 16,384 for RSA and 10,000\nfor DSA. These key-length limits are constraints imposed by OpenSSL.\nServer administrators can impose additional limits on maximum key\nlength by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-usage.html\n.\n\nFor DH keys, pass a shared DH secret instead of a key length. To create\nthe secret, pass the key length to CREATE_DH_PARAMETERS().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','SET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'DSA\', 2048);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'DSA\', @priv);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (124,27,'CREATE_ASYMMETRIC_PUB_KEY','Syntax:\nCREATE_ASYMMETRIC_PUB_KEY(algorithm, priv_key_str)\n\nDerives a public key from the given private key using the given\nalgorithm, and returns the key as a binary string in PEM format. If key\nderivation fails, the result is NULL.\n\npriv_key_str must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nFor a usage example, see the description of\nCREATE_ASYMMETRIC_PRIV_KEY().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (125,27,'CREATE_DH_PARAMETERS','CREATE_DH_PARAMETERS(key_len)\n\nCreates a shared secret for generating a DH private/public key pair and\nreturns a binary string that can be passed to\nCREATE_ASYMMETRIC_PRIV_KEY(). If secret generation fails, the result is\nnull.\n\nSupported key_len values: The minimum and maximum key lengths in bits\nare 1,024 and 10,000. These key-length limits are constraints imposed\nby OpenSSL. Server administrators can impose additional limits on\nmaximum key length by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-usage.html\n.\n\nFor an example showing how to use the return value for generating\nsymmetric keys, see the description of ASYMMETRIC_DERIVE().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','SET @dhp = CREATE_DH_PARAMETERS(1024);\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (126,27,'CREATE_DIGEST','Syntax:\nCREATE_DIGEST(digest_type, str)\n\nCreates a digest from the given string using the given digest type, and\nreturns the digest as a binary string. If digest generation fails, the\nresult is NULL.\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','SET @dig = CREATE_DIGEST(\'SHA512\', The quick brown fox\');\n','http://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (127,19,'CROSSES','Crosses(g1, g2)\n\nST_Crosses() and Crosses() are synonyms. For more information, see the\ndescription of ST_Crosses().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (128,11,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n -> 20080613\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (129,11,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (130,11,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME([fsp])\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (131,11,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP([fsp])\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (132,22,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (133,11,'CURTIME','Syntax:\nCURTIME([fsp])\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext. The value is expressed in the current time zone.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (134,22,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n -> \'test\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (135,10,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but permits assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (136,11,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (137,11,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 − expr2 expressed as a value in days from\none date to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n -> -31\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (138,10,'DATETIME','DATETIME[(fsp)]\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00.000000\' to \'9999-12-31 23:59:59.999999\'. MySQL displays\nDATETIME values in \'YYYY-MM-DD HH:MM:SS[.fraction]\' format, but permits\nassignment of values to DATETIME columns using either strings or\nnumbers.\n\nAn optional fsp value in the range from 0 to 6 may be given to specify\nfractional seconds precision. A value of 0 signifies that there is no\nfractional part. If omitted, the default precision is 0.\n\nAutomatic initialization and updating to the current date and time for\nDATETIME columns can be specified using DEFAULT and ON UPDATE column\ndefinition clauses, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (139,11,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is evaluated as a string; it may start with a - for negative\nintervals. unit is a keyword indicating the units in which the\nexpression should be interpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_ADD(\'2018-05-01\',INTERVAL 1 DAY);\n -> \'2018-05-02\'\nmysql> SELECT DATE_SUB(\'2018-05-01\',INTERVAL 1 YEAR);\n -> \'2017-05-01\'\nmysql> SELECT DATE_ADD(\'2020-12-31 23:59:59\',\n -> INTERVAL 1 SECOND);\n -> \'2021-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2018-12-31 23:59:59\',\n -> INTERVAL 1 DAY);\n -> \'2019-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n -> INTERVAL \'1:1\' MINUTE_SECOND);\n -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2025-01-01 00:00:00\',\n -> INTERVAL \'1 1:1:1\' DAY_SECOND);\n -> \'2024-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n -> INTERVAL \'-1 10\' DAY_HOUR);\n -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n -> INTERVAL \'1.999999\' SECOND_MICROSECOND);\n -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (140,11,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n -> \'%D %y %a %d %m %b %j\');\n -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n -> \'%H %k %I %r %T %S %w\');\n -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n -> \'00\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (141,11,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (142,11,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (143,11,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.7/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (144,11,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (145,11,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n -> 7\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (146,11,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (147,37,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error. If too many prepared statements are created and\nnot deallocated by either the DEALLOCATE PREPARE statement or the end\nof the session, you might encounter the upper limit enforced by the\nmax_prepared_stmt_count system variable.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/deallocate-prepare.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (148,10,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (149,10,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the - sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (150,5,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value: {\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n}\n\nThe DECLARE ... CONDITION statement declares a named error condition,\nassociating a name with a condition that needs specific handling. The\nname can be referred to in a subsequent DECLARE ... HANDLER statement\n(see [HELP DECLARE HANDLER]).\n\nCondition declarations must appear before cursor or handler\ndeclarations.\n\nThe condition_value for DECLARE ... CONDITION indicates the specific\ncondition or class of conditions to associate with the condition name.\nIt can take the following forms:\n\no mysql_error_code: An integer literal indicating a MySQL error code.\n\n Do not use MySQL error code 0 because that indicates success rather\n than an error condition. For a list of MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.7/en/server-error-reference.html.\n\no SQLSTATE [VALUE] sqlstate_value: A 5-character string literal\n indicating an SQLSTATE value.\n\n Do not use SQLSTATE values that begin with \'00\' because those\n indicate success rather than an error condition. For a list of\n SQLSTATE values, see\n http://dev.mysql.com/doc/refman/5.7/en/server-error-reference.html.\n\nCondition names referred to in SIGNAL or use RESIGNAL statements must\nbe associated with SQLSTATE values, not MySQL error codes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/declare-condition.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (151,5,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor and associates it with a SELECT\nstatement that retrieves the rows to be traversed by the cursor. To\nfetch the rows later, use a FETCH statement. The number of columns\nretrieved by the SELECT statement must match the number of output\nvariables specified in the FETCH statement.\n\nThe SELECT statement cannot have an INTO clause.\n\nCursor declarations must appear before handler declarations and after\nvariable and condition declarations.\n\nA stored program may contain multiple cursor declarations, but each\ncursor declared in a given block must have a unique name. For an\nexample, see http://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/declare-cursor.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (152,5,'DECLARE HANDLER','Syntax:\nDECLARE handler_action HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_action: {\n CONTINUE\n | EXIT\n | UNDO\n}\n\ncondition_value: {\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n}\n\nThe DECLARE ... HANDLER statement specifies a handler that deals with\none or more conditions. If one of these conditions occurs, the\nspecified statement executes. statement can be a simple statement such\nas SET var_name = value, or a compound statement written using BEGIN\nand END (see [HELP BEGIN END]).\n\nHandler declarations must appear after variable or condition\ndeclarations.\n\nThe handler_action value indicates what action the handler takes after\nexecution of the handler statement:\n\no CONTINUE: Execution of the current program continues.\n\no EXIT: Execution terminates for the BEGIN ... END compound statement\n in which the handler is declared. This is true even if the condition\n occurs in an inner block.\n\no UNDO: Not supported.\n\nThe condition_value for DECLARE ... HANDLER indicates the specific\ncondition or class of conditions that activates the handler. It can\ntake the following forms:\n\no mysql_error_code: An integer literal indicating a MySQL error code,\n such as 1051 to specify "unknown table":\n\nDECLARE CONTINUE HANDLER FOR 1051\n BEGIN\n -- body of handler\n END;\n\n Do not use MySQL error code 0 because that indicates success rather\n than an error condition. For a list of MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.7/en/server-error-reference.html.\n\no SQLSTATE [VALUE] sqlstate_value: A 5-character string literal\n indicating an SQLSTATE value, such as \'42S01\' to specify "unknown\n table":\n\nDECLARE CONTINUE HANDLER FOR SQLSTATE \'42S02\'\n BEGIN\n -- body of handler\n END;\n\n Do not use SQLSTATE values that begin with \'00\' because those\n indicate success rather than an error condition. For a list of\n SQLSTATE values, see\n http://dev.mysql.com/doc/refman/5.7/en/server-error-reference.html.\n\no condition_name: A condition name previously specified with DECLARE\n ... CONDITION. A condition name can be associated with a MySQL error\n code or SQLSTATE value. See [HELP DECLARE CONDITION].\n\no SQLWARNING: Shorthand for the class of SQLSTATE values that begin\n with \'01\'.\n\nDECLARE CONTINUE HANDLER FOR SQLWARNING\n BEGIN\n -- body of handler\n END;\n\no NOT FOUND: Shorthand for the class of SQLSTATE values that begin with\n \'02\'. This is relevant within the context of cursors and is used to\n control what happens when a cursor reaches the end of a data set. If\n no more rows are available, a No Data condition occurs with SQLSTATE\n value \'02000\'. To detect this condition, you can set up a handler for\n it or for a NOT FOUND condition.\n\nDECLARE CONTINUE HANDLER FOR NOT FOUND\n BEGIN\n -- body of handler\n END;\n\n For another example, see\n http://dev.mysql.com/doc/refman/5.7/en/cursors.html. The NOT FOUND\n condition also occurs for SELECT ... INTO var_list statements that\n retrieve no rows.\n\no SQLEXCEPTION: Shorthand for the class of SQLSTATE values that do not\n begin with \'00\', \'01\', or \'02\'.\n\nDECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n -- body of handler\n END;\n\nFor information about how the server chooses handlers when a condition\noccurs, see http://dev.mysql.com/doc/refman/5.7/en/handler-scope.html.\n\nIf a condition occurs for which no handler has been declared, the\naction taken depends on the condition class:\n\no For SQLEXCEPTION conditions, the stored program terminates at the\n statement that raised the condition, as if there were an EXIT\n handler. If the program was called by another stored program, the\n calling program handles the condition using the handler selection\n rules applied to its own handlers.\n\no For SQLWARNING conditions, the program continues executing, as if\n there were a CONTINUE handler.\n\no For NOT FOUND conditions, if the condition was raised normally, the\n action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the\n action is EXIT.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n BEGIN\n DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n SET @x = 1;\n INSERT INTO test.t VALUES (1);\n SET @x = 2;\n INSERT INTO test.t VALUES (1);\n SET @x = 3;\n END;\n //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n +------+\n | @x |\n +------+\n | 3 |\n +------+\n 1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/declare-handler.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (153,5,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement declares local variables within stored programs. To\nprovide a default value for a variable, include a DEFAULT clause. The\nvalue can be specified as an expression; it need not be a constant. If\nthe DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nVariable declarations must appear before cursor or handler\ndeclarations.\n\nLocal variable names are not case-sensitive. Permissible characters and\nquoting rules are the same as for other identifiers, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/identifiers.html.\n\nThe scope of a local variable is the BEGIN ... END block within which\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nFor examples of variable declarations, see\nhttp://dev.mysql.com/doc/refman/5.7/en/local-variable-scope.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/declare-local-variable.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (154,12,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDECODE() decrypts the encrypted string crypt_str using pass_str as the\npassword. crypt_str should be a string returned from ENCODE().\n\n*Note*:\n\nThe ENCODE() and DECODE() functions are deprecated in MySQL 5.7, will\nbe removed in a future MySQL release, and should no longer be used.\nConsider using AES_ENCRYPT() and AES_DECRYPT() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (155,28,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (156,29,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (157,9,'DELETE','Syntax:\nDELETE is a DML statement that removes rows from a table.\n\nSingle-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nThe DELETE statement deletes rows from tbl_name and returns the number\nof deleted rows. To check the number of deleted rows, call the\nROW_COUNT() function described in\nhttp://dev.mysql.com/doc/refman/5.7/en/information-functions.html.\n\nMain Clauses\n\nThe conditions in the optional WHERE clause identify which rows to\ndelete. With no WHERE clause, all rows are deleted.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nIf the ORDER BY clause is specified, the rows are deleted in the order\nthat is specified. The LIMIT clause places a limit on the number of\nrows that can be deleted. These clauses apply to single-table deletes,\nbut not multi-table deletes.\n\nMultiple-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nPrivileges\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nPerformance\n\nWhen you do not need to know the number of deleted rows, the TRUNCATE\nTABLE statement is a faster way to empty a table than a DELETE\nstatement with no WHERE clause. Unlike DELETE, TRUNCATE TABLE cannot be\nused within a transaction or if you have a lock on the table. See [HELP\nTRUNCATE TABLE] and [HELP LOCK].\n\nThe speed of delete operations may also be affected by factors\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/delete-optimization.html.\n\nTo ensure that a given DELETE statement does not take too much time,\nthe MySQL-specific LIMIT row_count clause for DELETE specifies the\nmaximum number of rows to be deleted. If the number of rows to delete\nis larger than the limit, repeat the DELETE statement until the number\nof affected rows is less than the LIMIT value.\n\nSubqueries\n\nYou cannot delete from a table and select from the same table in a\nsubquery.\n\nPartitioned Table Support\n\nDELETE supports explicit partition selection using the PARTITION\noption, which takes a list of the comma-separated names of one or more\npartitions or subpartitions (or both) from which to select rows to be\ndropped. Partitions not included in the list are ignored. Given a\npartitioned table t with a partition named p0, executing the statement\nDELETE FROM t PARTITION (p0) has the same effect on the table as\nexecuting ALTER TABLE t TRUNCATE PARTITION (p0); in both cases, all\nrows in partition p0 are dropped.\n\nPARTITION can be used along with a WHERE condition, in which case the\ncondition is tested only on rows in the listed partitions. For example,\nDELETE FROM t PARTITION (p0) WHERE c < 5 deletes rows only from\npartition p0 for which the condition c < 5 is true; rows in any other\npartitions are not checked and thus not affected by the DELETE.\n\nThe PARTITION option can also be used in multiple-table DELETE\nstatements. You can use up to one such option per table named in the\nFROM option.\n\nFor more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/delete.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (158,12,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.7/en/encrypted-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\n*Note*:\n\nThe DES_ENCRYPT() and DES_DECRYPT() functions are deprecated as of\nMySQL 5.7.6, will be removed in a future MySQL release, and should no\nlonger be used. Consider using AES_ENCRYPT() and AES_DECRYPT() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (159,12,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.7/en/encrypted-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0 to 9) from the DES key file is used. With a key_str argument, the\ngiven key string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\n*Note*:\n\nThe DES_ENCRYPT() and DES_DECRYPT() functions are deprecated as of\nMySQL 5.7.6, will be removed in a future MySQL release, and should no\nlonger be used. Consider using AES_ENCRYPT() and AES_DECRYPT() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (160,18,'DIMENSION','Dimension(g)\n\nST_Dimension() and Dimension() are synonyms. For more information, see\nthe description of ST_Dimension().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (161,27,'DISJOINT','Disjoint(g1, g2)\n\nMBRDisjoint() and Disjoint() are synonyms. For more information, see\nthe description of MBRDisjoint().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (162,19,'DISTANCE','Distance(g1, g2)\n\nST_Distance() and Distance() are synonyms. For more information, see\nthe description of ST_Distance().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (163,29,'DIV','Syntax:\nDIV\n\nInteger division. Discards from the division result any fractional part\nto the right of the decimal point.\n\nIf either operand has a noninteger type, the operands are converted to\nDECIMAL and divided using DECIMAL arithmetic before converting the\nresult to BIGINT. If the result exceeds BIGINT range, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2, -5 DIV 2, 5 DIV -2, -5 DIV -2;\n -> 2, -2, -2, 2\n','http://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (164,9,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nExample: This SELECT statement pauses, but also produces a result set:\n\nmysql> SELECT SLEEP(5);\n+----------+\n| SLEEP(5) |\n+----------+\n| 0 |\n+----------+\n1 row in set (5.02 sec)\n\nDO, on the other hand, pauses without producing a result set.:\n\nmysql> DO SLEEP(5);\nQuery OK, 0 rows affected (4.99 sec)\n\nThis could be useful, for example in a stored function or trigger,\nwhich prohibit statements that produce result sets.\n\nDO only executes expressions. It cannot be used in all cases where\nSELECT can be used. For example, DO id FROM t1 is invalid because it\nreferences a table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/do.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (165,10,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Permissible\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (166,10,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (167,8,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*:\n\nWhen a database is dropped, privileges granted specifically for the\ndatabase are not automatically dropped. They must be dropped manually.\nSee [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (168,8,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nThis statement requires the EVENT privilege for the schema to which the\nevent to be dropped belongs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (169,8,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (170,38,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\nsystem database. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-function-udf.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (171,8,'DROP INDEX','Syntax:\nDROP INDEX index_name ON tbl_name\n [algorithm_option | lock_option] ...\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (172,8,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (173,8,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row in the mysql.servers table is deleted. This statement\nrequires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-server.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (174,8,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n tbl_name [, tbl_name] ...\n [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table.\n\nBe careful with this statement! It removes the table definition and all\ntable data. For a partitioned table, it permanently removes the table\ndefinition, all its partitions, and all data stored in those\npartitions. It also removes partition definitions associated with the\ndropped table.\n\nDROP TABLE causes an implicit commit, except when used with the\nTEMPORARY keyword. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\n*Important*:\n\nWhen a table is dropped, privileges granted specifically for the table\nare not automatically dropped. They must be dropped manually. See [HELP\nGRANT].\n\nIf any tables named in the argument list do not exist, the statement\nreturns an error indicating by name which nonexisting tables it was\nunable to drop, but also drops all tables in the list that do exist.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. Instead of an error, a NOTE is generated for each nonexistent\ntable; these notes can be displayed with SHOW WARNINGS. See [HELP SHOW\nWARNINGS].\n\nIF EXISTS can also be useful for dropping tables in unusual\ncircumstances under which there is an .frm file but no table managed by\nthe storage engine. (For example, if an abnormal server exit occurs\nafter removal of the table from the storage engine but before .frm file\nremoval.)\n\nThe TEMPORARY keyword has the following effects:\n\no The statement drops only TEMPORARY tables.\n\no The statement does not cause an implicit commit.\n\no No access rights are checked. A TEMPORARY table is visible only with\n the session that created it, so no check is necessary.\n\nUsing TEMPORARY is a good way to ensure that you do not accidentally\ndrop a non-TEMPORARY table.\n\nThe RESTRICT and CASCADE keywords do nothing. They are permitted to\nmake porting easier from other database systems.\n\nDROP TABLE is not supported with all innodb_force_recovery settings.\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (175,8,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n [ENGINE [=] engine_name]\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE. It is supported with all MySQL NDB Cluster 7.5\nreleases, and with InnoDB in the standard MySQL Server as well.\n\nENGINE sets the storage engine that uses the tablespace, where\nengine_name is the name of the storage engine. Currently, the values\nInnoDB and NDB are supported. If not set, the value of\ndefault_storage_engine is used. If it is not the same as the storage\nengine used to create the tablespace, the DROP TABLESPACE statement\nfails.\n\nFor an InnoDB tablespace, all tables must be dropped from the\ntablespace prior to a DROP TABLESPACE operation. If the tablespace is\nnot empty, DROP TABLESPACE returns an error.\n\nAs with the InnoDB system tablespace, truncating or dropping InnoDB\ntables stored in a general tablespace creates free space in the\ntablespace .ibd data file, which can only be used for new InnoDB data.\nSpace is not released back to the operating system by such operations\nas it is for file-per-table tablespaces.\n\nAn NDB tablespace to be dropped must not contain any data files; in\nother words, before you can drop an NDB tablespace, you must first drop\neach of its data files using ALTER TABLESPACE ... DROP DATAFILE.\n\nNotes\n\no Tablespaces are not deleted automatically. A tablespace must be\n dropped explicitly using DROP TABLESPACE. DROP DATABASE has no effect\n in this regard, even if the operation drops all tables belonging to\n the tablespace.\n\no A DROP DATABASE operation can drop tables that belong to a general\n tablespace but it cannot drop the tablespace, even if the operation\n drops all tables that belong to the tablespace. The tablespace must\n be dropped explicitly using DROP TABLESPACE tablespace_name.\n\no Similar to the system tablespace, truncating or dropping tables\n stored in a general tablespace creates free space internally in the\n general tablespace .ibd data file which can only be used for new\n InnoDB data. Space is not released back to the operating system as it\n is for file-per-table tablespaces.\n\nInnoDB Example\n\nThis example demonstrates how to drop an InnoDB general tablespace. The\ngeneral tablespace ts1 is created with a single table. Before dropping\nthe tablespace, the table must be dropped.\n\nmysql> CREATE TABLESPACE `ts1` ADD DATAFILE \'ts1.ibd\' Engine=InnoDB; \n\nmysql> CREATE TABLE t1 (c1 INT PRIMARY KEY) TABLESPACE ts10 Engine=InnoDB; \n \nmysql> DROP TABLE t1;\n\nmysql> DROP TABLESPACE ts1;\n\nNDB Example\n\nThis example shows how to drop an NDB tablespace myts having a data\nfile named mydata-1.dat after first creating the tablespace, and\nassumes the existence of a log file group named mylg (see [HELP CREATE\nLOGFILE GROUP]).\n\nmysql> CREATE TABLESPACE myts\n -> ADD DATAFILE \'mydata-1.dat\'\n -> USE LOGFILE GROUP mylg\n -> ENGINE=NDB;\n\nYou must remove all data files from the tablespace using ALTER\nTABLESPACE, as shown here, before it can be dropped:\n\nmysql> ALTER TABLESPACE myts\n -> DROP DATAFILE \'mydata-1.dat\'\n -> ENGINE=NDB;\n\nmysql> DROP TABLESPACE myts;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-tablespace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (176,8,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER requires the TRIGGER privilege for the table\nassociated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS].\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-trigger.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (177,1,'DROP USER','Syntax:\nDROP USER [IF EXISTS] user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables.\n\nTo use DROP USER, you must have the global CREATE USER privilege, or\nthe DELETE privilege for the mysql system database. When the read_only\nsystem variable is enabled, DROP USER additionally requires the SUPER\nprivilege.\n\nAn error occurs if you try to drop an account that does not exist. If\nthe IF EXISTS clause is given, the statement produces a warning for\neach named user that does not exist, rather than an error.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (178,8,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view.\n\nIf any views named in the argument list do not exist, the statement\nreturns an error indicating by name which nonexisting views it was\nunable to drop, but also drops all views in the list that do exist.\n\n*Note*:\n\nIn MySQL 8.0, DROP VIEW fails if any views named in the argument list\ndo not exist. Due to the change in behavior, a partially completed DROP\nVIEW operation on a MySQL 5.7 master fails when replicated to a MySQL\n8.0 slave. To avoid this failure scenario, use IF EXISTS syntax in DROP\nVIEW statements to prevent an error from occurring for views that do\nnot exist. For more information, see Atomic Data Definition Statement\nSupport (http://dev.mysql.com/doc/refman/8.0/en/atomic-ddl.html).\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/drop-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (179,9,'DUAL','You are permitted to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/select.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (180,35,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'Aa\', \'Bb\', \'Cc\', \'Dd\');\n -> \'Aa\'\nmysql> SELECT ELT(4, \'Aa\', \'Bb\', \'Cc\', \'Dd\');\n -> \'Dd\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (181,12,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nENCODE() encrypts str using pass_str as the password. The result is a\nbinary string of the same length as str. To decrypt the result, use\nDECODE().\n\n*Note*:\n\nThe ENCODE() and DECODE() functions are deprecated in MySQL 5.7, will\nbe removed in a future MySQL release, and should no longer be used.\n\nIf you still need to use ENCODE(), a salt value must be used with it to\nreduce risk. For example:\n\nENCODE(\'cleartext\', CONCAT(\'my_random_salt\',\'my_secret_password\'))\n\nA new random salt value must be used whenever a password is updated.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (182,12,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument must be a string with at least two characters\nor the result will be NULL. If no salt argument is given, a random\nvalue is used.\n\n*Note*:\n\nThe ENCRYPT() function is deprecated as of MySQL 5.7.6, will be removed\nin a future MySQL release, and should no longer be used. For one-way\nhashing, consider using SHA2() instead.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (183,24,'ENDPOINT','EndPoint(ls)\n\nST_EndPoint() and EndPoint() are synonyms. For more information, see\nthe description of ST_EndPoint().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (184,10,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. ENUM values are represented internally as integers.\n\nAn ENUM column can have a maximum of 65,535 distinct elements. (The\npractical limit is less than 3000.) A table can have no more than 255\nunique element list definitions among its ENUM and SET columns\nconsidered as a group. For more information on these limits, see\nhttp://dev.mysql.com/doc/refman/5.7/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (185,18,'ENVELOPE','Envelope(g)\n\nST_Envelope() and Envelope() are synonyms. For more information, see\nthe description of ST_Envelope().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (186,27,'EQUALS','Equals(g1, g2)\n\nMBREquals() and Equals() are synonyms. For more information, see the\ndescription of MBREquals().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (187,37,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/execute.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (188,29,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n -> 7.3890560989307\nmysql> SELECT EXP(-2);\n -> 0.13533528323661\nmysql> SELECT EXP(0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (189,39,'EXPLAIN','Syntax:\n{EXPLAIN | DESCRIBE | DESC}\n tbl_name [col_name | wild]\n\n{EXPLAIN | DESCRIBE | DESC}\n [explain_type]\n {explainable_stmt | FOR CONNECTION connection_id}\n\nexplain_type: {\n EXTENDED\n | PARTITIONS\n | FORMAT = format_name\n}\n\nformat_name: {\n TRADITIONAL\n | JSON\n}\n\nexplainable_stmt: {\n SELECT statement\n | DELETE statement\n | INSERT statement\n | REPLACE statement\n | UPDATE statement\n}\n\nThe DESCRIBE and EXPLAIN statements are synonyms. In practice, the\nDESCRIBE keyword is more often used to obtain information about table\nstructure, whereas EXPLAIN is used to obtain a query execution plan\n(that is, an explanation of how MySQL would execute a query).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/explain.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (190,35,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ,). The number of bits examined is given by number_of_bits,\nwhich has a default of 64 if not specified. number_of_bits is silently\nclipped to 64 if larger than 64. It is treated as an unsigned integer,\nso a value of −1 is effectively the same as 64.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (191,32,'EXTERIORRING','ExteriorRing(poly)\n\nST_ExteriorRing() and ExteriorRing() are synonyms. For more\ninformation, see the description of ST_ExteriorRing().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (192,11,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic. For information on the unit argument, see\nhttp://dev.mysql.com/doc/refman/5.7/en/expressions.html#temporal-interv\nals.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2019-07-02\');\n -> 2019\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2019-07-02 01:02:03\');\n -> 201907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2019-07-02 01:02:03\');\n -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n -> FROM \'2003-01-02 10:30:00.000123\');\n -> 123\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (193,35,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe element or elements matched by the XPath expression.\n\nUsing this function is the equivalent of performing a match using the\nxpath_expr after appending /text(). In other words,\nExtractValue(\'Sakila\', \'/a/b\') and\nExtractValue(\'Sakila\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, the content of the first child text node\nof each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text())---for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed---an empty string is returned. No distinction is made between a\nmatch on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1 |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*:\n\nExtractValue() returns only CDATA, and does not return any tags that\nmight be contained within a matching tag, nor any of their content (see\nthe result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html\n\n','mysql> SELECT\n -> ExtractValue(\'cccddd\', \'/a\') AS val1,\n -> ExtractValue(\'cccddd\', \'/a/b\') AS val2,\n -> ExtractValue(\'cccddd\', \'//b\') AS val3,\n -> ExtractValue(\'cccddd\', \'/b\') AS val4,\n -> ExtractValue(\'cccdddeee\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (194,5,'FETCH','Syntax:\nFETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row for the SELECT statement associated\nwith the specified cursor (which must be open), and advances the cursor\npointer. If a row exists, the fetched columns are stored in the named\nvariables. The number of columns retrieved by the SELECT statement must\nmatch the number of output variables specified in the FETCH statement.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue \'02000\'. To detect this condition, you can set up a handler for\nit (or for a NOT FOUND condition). For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nBe aware that another operation, such as a SELECT or another FETCH, may\nalso cause the handler to execute by raising the same condition. If it\nis necessary to distinguish which operation raised the condition, place\nthe operation within its own BEGIN ... END block so that it can be\nassociated with its own handler.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/fetch.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (195,35,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT FIELD(\'Bb\', \'Aa\', \'Bb\', \'Cc\', \'Dd\', \'Ff\');\n -> 2\nmysql> SELECT FIELD(\'Gg\', \'Aa\', \'Bb\', \'Cc\', \'Dd\', \'Ff\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (196,35,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by , characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (,) character.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (197,10,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Permissible values\nare -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.7/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (198,29,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23), FLOOR(-1.23);\n -> 1, -2\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (199,2,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL] {\n flush_option [, flush_option] ...\n | tables_option\n}\n\nflush_option: {\n BINARY LOGS\n | DES_KEY_FILE\n | ENGINE LOGS\n | ERROR LOGS\n | GENERAL LOGS\n | HOSTS\n | LOGS\n | PRIVILEGES\n | OPTIMIZER_COSTS\n | QUERY CACHE\n | RELAY LOGS [FOR CHANNEL channel]\n | SLOW LOGS\n | STATUS\n | USER_RESOURCES\n}\n\ntables_option: {\n TABLES\n | TABLES tbl_name [, tbl_name] ...\n | TABLES WITH READ LOCK\n | TABLES tbl_name [, tbl_name] ... WITH READ LOCK\n | TABLES tbl_name [, tbl_name] ... FOR EXPORT\n}\n\nThe FLUSH statement has several variant forms that clear or reload\nvarious internal caches, flush tables, or acquire locks. To execute\nFLUSH, you must have the RELOAD privilege. Specific flush options might\nrequire additional privileges, as described later.\n\n*Note*:\n\nIt is not possible to issue FLUSH statements within stored functions or\ntriggers. However, you may use FLUSH in stored procedures, so long as\nthese are not called from stored functions or triggers. See\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html\n.\n\nBy default, the server writes FLUSH statements to the binary log so\nthat they replicate to replication slaves. To suppress logging, specify\nthe optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*:\n\nFLUSH LOGS, FLUSH TABLES WITH READ LOCK (with or without a table list),\nand FLUSH TABLES tbl_name ... FOR EXPORT are not written to the binary\nlog in any case because they would cause problems if replicated to a\nslave.\n\nThe FLUSH statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nThe mysqladmin utility provides a command-line interface to some flush\noperations, using commands such as flush-hosts, flush-logs,\nflush-privileges, flush-status, and flush-tables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html.\n\nSending a SIGHUP signal to the server causes several flush operations\nto occur that are similar to various forms of the FLUSH statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-signal-response.html.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/flush.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (200,2,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/query-cache-status-and-maintenance.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (201,35,'FORMAT','Syntax:\nFORMAT(X,D[,locale])\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nThe optional third parameter enables a locale to be specified to be\nused for the result number\'s decimal point, thousands separator, and\ngrouping between separators. Permissible locale values are the same as\nthe legal values for the lc_time_names system variable (see\nhttp://dev.mysql.com/doc/refman/5.7/en/locale-support.html). If no\nlocale is specified, the default is \'en_US\'.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n -> \'12,332\'\nmysql> SELECT FORMAT(12332.2,2,\'de_DE\');\n -> \'12.332,20\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (202,22,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include an SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (203,35,'FROM_BASE64','Syntax:\nFROM_BASE64(str)\n\nTakes a string encoded with the base-64 encoded rules used by\nTO_BASE64() and returns the decoded result as a binary string. The\nresult is NULL if the argument is NULL or not a valid base-64 string.\nSee the description of TO_BASE64() for details about the encoding and\ndecoding rules.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (204,11,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n -> \'2000-07-03\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (205,11,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether\nthe function is used in a string or numeric context. The value is\nexpressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1447430881);\n -> \'2015-11-13 10:08:01\'\nmysql> SELECT FROM_UNIXTIME(1447430881) + 0;\n -> 20151113100801\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2015 13th November 10:08:01 2015\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (206,41,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[, srid]), GeometryCollectionFromText(wkt[, srid])\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(),\nST_GeomCollFromTxt(), GeomCollFromText(), and\nGeometryCollectionFromText() are synonyms. For more information, see\nthe description of ST_GeomCollFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (207,40,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[, srid]), GeometryCollectionFromWKB(wkb[, srid])\n\nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(),\nGeomCollFromWKB(), and GeometryCollectionFromWKB() are synonyms. For\nmore information, see the description of ST_GeomCollFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (208,16,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Spatial columns\nare supported for MyISAM, InnoDB, NDB, and ARCHIVE tables. See also the\nnotes about spatial indexes under [HELP SPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-columns.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (209,16,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-geometry-class-hierarchy.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (210,17,'GEOMETRYCOLLECTION','GeometryCollection(g [, g] ...)\n\nConstructs a GeometryCollection value from the geometry arguments.\n\nGeometryCollection() returns all the proper geometries contained in the\narguments even if a nonsupported geometry is present.\n\nGeometryCollection() with no arguments is permitted as a way to create\nan empty geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (211,20,'GEOMETRYN','GeometryN(gc, N)\n\nST_GeometryN() and GeometryN() are synonyms. For more information, see\nthe description of ST_GeometryN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (212,18,'GEOMETRYTYPE','GeometryType(g)\n\nST_GeometryType() and GeometryType() are synonyms. For more\ninformation, see the description of ST_GeometryType().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (213,41,'GEOMFROMTEXT','GeomFromText(wkt[, srid]), GeometryFromText(wkt[, srid])\n\nST_GeomFromText(), ST_GeometryFromText(), GeomFromText(), and\nGeometryFromText() are synonyms. For more information, see the\ndescription of ST_GeomFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (214,40,'GEOMFROMWKB','GeomFromWKB(wkb[, srid]), GeometryFromWKB(wkb[, srid])\n\nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB(), and\nGeometryFromWKB() are synonyms. For more information, see the\ndescription of ST_GeomFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (215,5,'GET DIAGNOSTICS','Syntax:\nGET [CURRENT | STACKED] DIAGNOSTICS\n{\n statement_information_item\n [, statement_information_item] ...\n | CONDITION condition_number\n condition_information_item\n [, condition_information_item] ...\n}\n\nstatement_information_item:\n target = statement_information_item_name\n\ncondition_information_item:\n target = condition_information_item_name\n\nstatement_information_item_name:\n NUMBER\n | ROW_COUNT\n\ncondition_information_item_name: {\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | RETURNED_SQLSTATE\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n}\n\ncondition_number, target:\n (see following discussion)\n\nSQL statements produce diagnostic information that populates the\ndiagnostics area. The GET DIAGNOSTICS statement enables applications to\ninspect this information. (You can also use SHOW WARNINGS or SHOW\nERRORS to see conditions or errors.)\n\nNo special privileges are required to execute GET DIAGNOSTICS.\n\nThe keyword CURRENT means to retrieve information from the current\ndiagnostics area. The keyword STACKED means to retrieve information\nfrom the second diagnostics area, which is available only if the\ncurrent context is a condition handler. If neither keyword is given,\nthe default is to use the current diagnostics area.\n\nThe GET DIAGNOSTICS statement is typically used in a handler within a\nstored program. It is a MySQL extension that GET [CURRENT] DIAGNOSTICS\nis permitted outside handler context to check the execution of any SQL\nstatement. For example, if you invoke the mysql client program, you can\nenter these statements at the prompt:\n\nmysql> DROP TABLE test.no_such_table;\nERROR 1051 (42S02): Unknown table \'test.no_such_table\'\nmysql> GET DIAGNOSTICS CONDITION 1\n @p1 = RETURNED_SQLSTATE, @p2 = MESSAGE_TEXT;\nmysql> SELECT @p1, @p2;\n+-------+------------------------------------+\n| @p1 | @p2 |\n+-------+------------------------------------+\n| 42S02 | Unknown table \'test.no_such_table\' |\n+-------+------------------------------------+\n\nThis extension applies only to the current diagnostics area. It does\nnot apply to the second diagnostics area because GET STACKED\nDIAGNOSTICS is permitted only if the current context is a condition\nhandler. If that is not the case, a GET STACKED DIAGNOSTICS when\nhandler not active error occurs.\n\nFor a description of the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html. Briefly,\nit contains two kinds of information:\n\no Statement information, such as the number of conditions that occurred\n or the affected-rows count.\n\no Condition information, such as the error code and message. If a\n statement raises multiple conditions, this part of the diagnostics\n area has a condition area for each one. If a statement raises no\n conditions, this part of the diagnostics area is empty.\n\nFor a statement that produces three conditions, the diagnostics area\ncontains statement and condition information like this:\n\nStatement information:\n row count\n ... other statement information items ...\nCondition area list:\n Condition area 1:\n error code for condition 1\n error message for condition 1\n ... other condition information items ...\n Condition area 2:\n error code for condition 2:\n error message for condition 2\n ... other condition information items ...\n Condition area 3:\n error code for condition 3\n error message for condition 3\n ... other condition information items ...\n\nGET DIAGNOSTICS can obtain either statement or condition information,\nbut not both in the same statement:\n\no To obtain statement information, retrieve the desired statement items\n into target variables. This instance of GET DIAGNOSTICS assigns the\n number of available conditions and the rows-affected count to the\n user variables @p1 and @p2:\n\nGET DIAGNOSTICS @p1 = NUMBER, @p2 = ROW_COUNT;\n\no To obtain condition information, specify the condition number and\n retrieve the desired condition items into target variables. This\n instance of GET DIAGNOSTICS assigns the SQLSTATE value and error\n message to the user variables @p3 and @p4:\n\nGET DIAGNOSTICS CONDITION 1\n @p3 = RETURNED_SQLSTATE, @p4 = MESSAGE_TEXT;\n\nThe retrieval list specifies one or more target = item_name\nassignments, separated by commas. Each assignment names a target\nvariable and either a statement_information_item_name or\ncondition_information_item_name designator, depending on whether the\nstatement retrieves statement or condition information.\n\nValid target designators for storing item information can be stored\nprocedure or function parameters, stored program local variables\ndeclared with DECLARE, or user-defined variables.\n\nValid condition_number designators can be stored procedure or function\nparameters, stored program local variables declared with DECLARE,\nuser-defined variables, system variables, or literals. A character\nliteral may include a _charset introducer. A warning occurs if the\ncondition number is not in the range from 1 to the number of condition\nareas that have information. In this case, the warning is added to the\ndiagnostics area without clearing it.\n\nWhen a condition occurs, MySQL does not populate all condition items\nrecognized by GET DIAGNOSTICS. For example:\n\nmysql> GET DIAGNOSTICS CONDITION 1\n @p5 = SCHEMA_NAME, @p6 = TABLE_NAME;\nmysql> SELECT @p5, @p6;\n+------+------+\n| @p5 | @p6 |\n+------+------+\n| | |\n+------+------+\n\nIn standard SQL, if there are multiple conditions, the first condition\nrelates to the SQLSTATE value returned for the previous SQL statement.\nIn MySQL, this is not guaranteed. To get the main error, you cannot do\nthis:\n\nGET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;\n\nInstead, retrieve the condition count first, then use it to specify\nwhich condition number to inspect:\n\nGET DIAGNOSTICS @cno = NUMBER;\nGET DIAGNOSTICS CONDITION @cno @errno = MYSQL_ERRNO;\n\nFor information about permissible statement and condition information\nitems, and which ones are populated when a condition occurs, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html#diagnostic\ns-area-information-items.\n\nHere is an example that uses GET DIAGNOSTICS and an exception handler\nin stored procedure context to assess the outcome of an insert\noperation. If the insert was successful, the procedure uses GET\nDIAGNOSTICS to get the rows-affected count. This shows that you can use\nGET DIAGNOSTICS multiple times to retrieve information about a\nstatement as long as the current diagnostics area has not been cleared.\n\nCREATE PROCEDURE do_insert(value INT)\nBEGIN\n -- Declare variables to hold diagnostics area information\n DECLARE code CHAR(5) DEFAULT \'00000\';\n DECLARE msg TEXT;\n DECLARE rows INT;\n DECLARE result TEXT;\n -- Declare exception handler for failed insert\n DECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n GET DIAGNOSTICS CONDITION 1\n code = RETURNED_SQLSTATE, msg = MESSAGE_TEXT;\n END;\n\n -- Perform the insert\n INSERT INTO t1 (int_col) VALUES(value);\n -- Check whether the insert was successful\n IF code = \'00000\' THEN\n GET DIAGNOSTICS rows = ROW_COUNT;\n SET result = CONCAT(\'insert succeeded, row count = \',rows);\n ELSE\n SET result = CONCAT(\'insert failed, error = \',code,\', message = \',msg);\n END IF;\n -- Say what happened\n SELECT result;\nEND;\n\nSuppose that t1.int_col is an integer column that is declared as NOT\nNULL. The procedure produces these results when invoked to insert\nnon-NULL and NULL values, respectively:\n\nmysql> CALL do_insert(1);\n+---------------------------------+\n| result |\n+---------------------------------+\n| insert succeeded, row count = 1 |\n+---------------------------------+\n\nmysql> CALL do_insert(NULL);\n+-------------------------------------------------------------------------+\n| result |\n+-------------------------------------------------------------------------+\n| insert failed, error = 23000, message = Column \'int_col\' cannot be null |\n+-------------------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/get-diagnostics.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/get-diagnostics.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (216,11,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (217,25,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. A negative timeout value means infinite\ntimeout. The lock is exclusive. While held by one session, other\nsessions cannot obtain a lock of the same name.\n\nReturns 1 if the lock was obtained successfully, 0 if the attempt timed\nout (for example, because another client has previously locked the\nname), or NULL if an error occurred (such as running out of memory or\nthe thread was killed with mysqladmin kill).\n\nA lock obtained with GET_LOCK() is released explicitly by executing\nRELEASE_LOCK() or implicitly when your session terminates (either\nnormally or abnormally). Locks obtained with GET_LOCK() are not\nreleased when transactions commit or roll back.\n\nIn MySQL 5.7, GET_LOCK() was reimplemented using the metadata locking\n(MDL) subsystem and its capabilities were extended. Multiple\nsimultaneous locks can be acquired and GET_LOCK() does not release any\nexisting locks.\n\nIt is even possible for a given session to acquire multiple locks for\nthe same name. Other sessions cannot acquire a lock with that name\nuntil the acquiring session releases all its locks for the name.\n\nAs a result of the MDL reimplementation, uniquely named locks acquired\nwith GET_LOCK() appear in the Performance Schema metadata_locks table.\nThe OBJECT_TYPE column says USER LEVEL LOCK and the OBJECT_NAME column\nindicates the lock name. In the case that multiple locks are acquired\nfor the same name, only the first lock for the name registers a row in\nthe metadata_locks table. Subsequent locks for the name increment a\ncounter in the lock but do not acquire additional metadata locks. The\nmetadata_locks row for the lock is deleted when the last lock instance\non the name is released.\n\nThe capability of acquiring multiple locks means there is the\npossibility of deadlock among clients. When this happens, the server\nchooses a caller and terminates its lock-acquisition request with an\nER_USER_LOCK_DEADLOCK error. This error does not cause transactions to\nroll back.\n\nBefore MySQL 5.7, only a single simultaneous lock can be acquired and\nGET_LOCK() releases any existing lock. The difference in lock\nacquisition behavior as of MySQL 5.7 can be seen by the following\nexample. Suppose that you execute these statements:\n\nSELECT GET_LOCK(\'lock1\',10);\nSELECT GET_LOCK(\'lock2\',10);\nSELECT RELEASE_LOCK(\'lock2\');\nSELECT RELEASE_LOCK(\'lock1\');\n\nIn MySQL 5.7 or later, the second GET_LOCK() acquires a second lock and\nboth RELEASE_LOCK() calls return 1 (success). Before MySQL 5.7, the\nsecond GET_LOCK() releases the first lock (\'lock1\') and the second\nRELEASE_LOCK() returns NULL (failure) because there is no \'lock1\' to\nrelease.\n\nMySQL 5.7 and later enforces a maximum length on lock names of 64\ncharacters. Previously, no limit was enforced.\n\nGET_LOCK() can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked within one session, GET_LOCK() blocks any request by\nanother session for a lock with the same name. This enables clients\nthat agree on a given lock name to use the name to perform cooperative\nadvisory locking. But be aware that it also enables a client that is\nnot among the set of cooperating clients to lock a name, either\ninadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of\nthis is to use lock names that are database-specific or\napplication-specific. For example, use lock names of the form\ndb_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (218,24,'GLENGTH','GLength(ls)\n\nGLength() is a nonstandard name. It corresponds to the OpenGIS\nST_Length() function. (There is an existing SQL function Length() that\ncalculates the length of string values.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (219,1,'GRANT','Syntax:\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH {GRANT OPTION | resource_option} ...]\n\nGRANT PROXY ON user\n TO user [, user] ...\n [WITH GRANT OPTION]\n\nobject_type: {\n TABLE\n | FUNCTION\n | PROCEDURE\n}\n\npriv_level: {\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n}\n\nuser:\n (see http://dev.mysql.com/doc/refman/5.7/en/account-names.html)\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin BY \'auth_string\'\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n | IDENTIFIED BY PASSWORD \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n | MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\nThe GRANT statement grants privileges to MySQL user accounts.\n\nTo use GRANT, you must have the GRANT OPTION privilege, and you must\nhave the privileges that you are granting. When the read_only system\nvariable is enabled, GRANT additionally requires the SUPER privilege.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. See [HELP REVOKE].\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\n\nThe host name part of the account, if omitted, defaults to \'%\'.\n\nNormally, a database administrator first uses CREATE USER to create an\naccount and define its nonprivilege characteristics such as its\npassword, whether it uses secure connections, and limits on access to\nserver resources, then uses GRANT to define its privileges. ALTER USER\nmay be used to change the nonprivilege characteristics of existing\naccounts. For example:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'password\';\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\nGRANT SELECT ON db2.invoice TO \'jeffrey\'@\'localhost\';\nALTER USER \'jeffrey\'@\'localhost\' WITH MAX_QUERIES_PER_HOUR 90;\n\n*Note*:\n\nExamples shown here include no IDENTIFIED clause. It is assumed that\nyou establish passwords with CREATE USER at account-creation time to\navoid creating insecure accounts.\n\n*Note*:\n\nIf an account named in a GRANT statement does not already exist, GRANT\nmay create it under the conditions described later in the discussion of\nthe NO_AUTO_CREATE_USER SQL mode. It is also possible to use GRANT to\nspecify nonprivilege account characteristics such as whether it uses\nsecure connections and limits on access to server resources.\n\nHowever, use of GRANT to create accounts or define nonprivilege\ncharacteristics is deprecated as of MySQL 5.7.6. Instead, perform these\ntasks using CREATE USER or ALTER USER.\n\nFrom the mysql program, GRANT responds with Query OK, 0 rows affected\nwhen executed successfully. To determine what privileges result from\nthe operation, use SHOW GRANTS. See [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/grant.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (220,4,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n -> \'C\'\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (221,14,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n GROUP_CONCAT(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (222,27,'GTID_SUBSET','Syntax:\nGTID_SUBSET(set1,set2)\n\nGiven two sets of global transaction IDs set1 and set2, returns true if\nall GTIDs in set1 are also in set2. Returns false otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 0\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (223,27,'GTID_SUBTRACT','Syntax:\nGTID_SUBTRACT(set1,set2)\n\nGiven two sets of global transaction IDs set1 and set2, returns only\nthose GTIDs from set1 that are not in set2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:22-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:26-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:21-22:25-57\n1 row in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (224,9,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for InnoDB and MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/handler.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (225,2,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help \', where is one of the\nfollowing categories:\n Account Management\n Administration\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Storage Engines\n Stored Routines\n Table Maintenance\n Transactions\n Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following topics:\n SHOW\n SHOW BINARY LOGS\n SHOW ENGINE\n SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nThe search string can contain the wildcard characters % and _. These\nhave the same meaning as for pattern-matching operations performed with\nthe LIKE operator. For example, HELP rep% returns a list of topics that\nbegin with rep:\n\nmysql> HELP rep%\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following\ntopics:\n REPAIR TABLE\n REPEAT FUNCTION\n REPEAT LOOP\n REPLACE\n REPLACE FUNCTION\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/mysql-server-side-help.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (226,39,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not\ncase-sensitive.\n\nThe search string can contain the wildcard characters % and _. These\nhave the same meaning as for pattern-matching operations performed with\nthe LIKE operator. For example, HELP \'rep%\' returns a list of topics\nthat begin with rep.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/help.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (227,21,'HELP_DATE','This help information was generated from the MySQL 5.7 Reference Manual\non: 2018-12-20\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (228,21,'HELP_VERSION','This help information was generated from the MySQL 5.7 Reference Manual\non: 2018-12-20 (revision: 60441)\n\nThis information applies to MySQL 5.7 through 5.7.26.\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (229,35,'HEX','Syntax:\nHEX(str), HEX(N)\n\nFor a string argument str, HEX() returns a hexadecimal string\nrepresentation of str where each byte of each character in str is\nconverted to two hexadecimal digits. (Multibyte characters therefore\nbecome more than two digits.) The inverse of this operation is\nperformed by the UNHEX() function.\n\nFor a numeric argument N, HEX() returns a hexadecimal string\nrepresentation of the value of N treated as a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16). The inverse of this operation is\nperformed by CONV(HEX(N),16,10).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT X\'616263\', HEX(\'abc\'), UNHEX(HEX(\'abc\'));\n -> \'abc\', 616263, \'abc\'\nmysql> SELECT HEX(255), CONV(HEX(255),16,10);\n -> \'FF\', 255\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (230,11,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n -> 272\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (231,7,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL), IF() returns expr2.\nOtherwise, it returns expr3.\n\n*Note*:\n\nThere is also an IF statement, which differs from the IF() function\ndescribed here. See [HELP IF statement].\n\nIf only one of expr2 or expr3 is explicitly NULL, the result type of\nthe IF() function is the type of the non-NULL expression.\n\nThe default return type of IF() (which may matter when it is stored\ninto a temporary table) is calculated as follows:\n\no If expr2 or expr3 produce a string, the result is a string.\n\n If expr2 and expr3 are both strings, the result is case-sensitive if\n either string is case sensitive.\n\no If expr2 or expr3 produce a floating-point value, the result is a\n floating-point value.\n\no If expr2 or expr3 produce an integer, the result is an integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n -> \'no\'\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (232,5,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nThe IF statement for stored programs implements a basic conditional\nconstruct.\n\n*Note*:\n\nThere is also an IF() function, which differs from the IF statement\ndescribed here. See\nhttp://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html. The\nIF statement can have THEN, ELSE, and ELSEIF clauses, and it is\nterminated with END IF.\n\nIf the search_condition evaluates to true, the corresponding THEN or\nELSEIF clause statement_list executes. If no search_condition matches,\nthe ELSE clause statement_list executes.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/if.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/if.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (233,7,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n -> 1\nmysql> SELECT IFNULL(NULL,10);\n -> 10\nmysql> SELECT IFNULL(1/0,10);\n -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (234,4,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.7/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (235,28,'INET6_ATON','Syntax:\nINET6_ATON(expr)\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary\nstring that represents the numeric value of the address in network byte\norder (big endian). Because numeric-format IPv6 addresses require more\nbytes than the largest integer type, the representation returned by\nthis function has the VARBINARY data type: VARBINARY(16) for IPv6\naddresses and VARBINARY(4) for IPv4 addresses. If the argument is not a\nvalid address, INET6_ATON() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT HEX(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'FDFE0000000000005A55CAFFFEFA9089\'\nmysql> SELECT HEX(INET6_ATON(\'10.0.5.9\'));\n -> \'0A000509\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (236,28,'INET6_NTOA','Syntax:\nINET6_NTOA(expr)\n\nGiven an IPv6 or IPv4 network address represented in numeric form as a\nbinary string, returns the string representation of the address as a\nstring in the connection character set. If the argument is not a valid\naddress, INET6_NTOA() returns NULL.\n\nINET6_NTOA() has these properties:\n\no It does not use operating system functions to perform conversions,\n thus the output string is platform independent.\n\no The return string has a maximum length of 39 (4 x 8 + 7). Given this\n statement:\n\nCREATE TABLE t AS SELECT INET6_NTOA(expr) AS c1;\n\n The resulting table would have this definition:\n\nCREATE TABLE t (c1 VARCHAR(39) CHARACTER SET utf8 DEFAULT NULL);\n\no The return string uses lowercase letters for IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT INET6_NTOA(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(INET6_ATON(\'10.0.5.9\'));\n -> \'10.0.5.9\'\n\nmysql> SELECT INET6_NTOA(UNHEX(\'FDFE0000000000005A55CAFFFEFA9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(UNHEX(\'0A000509\'));\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (237,28,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n -> 167773449\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (238,28,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric IPv4 network address in network byte order, returns the\ndotted-quad string representation of the address as a string in the\nconnection character set. INET_NTOA() returns NULL if it does not\nunderstand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(167773449);\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (239,9,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n {VALUES | VALUE} (value_list) [, (value_list)] ...\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n SET assignment_list\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n SELECT ...\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nvalue:\n {expr | DEFAULT}\n\nvalue_list:\n value [, value] ...\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT with an ON DUPLICATE KEY\nUPDATE clause enables existing rows to be updated if a row to be\ninserted would cause a duplicate value in a UNIQUE index or PRIMARY\nKEY.\n\nFor additional information about INSERT ... SELECT and INSERT ... ON\nDUPLICATE KEY UPDATE, see [HELP INSERT SELECT], and\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html.\n\nIn MySQL 5.7, the DELAYED keyword is accepted but ignored by the\nserver. For the reasons for this, see [HELP INSERT DELAYED],\n\nInserting into a table requires the INSERT privilege for the table. If\nthe ON DUPLICATE KEY UPDATE clause is used and a duplicate key causes\nan UPDATE to be performed instead, the statement requires the UPDATE\nprivilege for the columns to be updated. For columns that are read but\nnot modified you need only the SELECT privilege (such as for a column\nreferenced only on the right hand side of an col_name=expr assignment\nin an ON DUPLICATE KEY UPDATE clause).\n\nWhen inserting into a partitioned table, you can control which\npartitions and subpartitions accept new rows. The PARTITION option\ntakes a list of the comma-separated names of one or more partitions or\nsubpartitions (or both) of the table. If any of the rows to be inserted\nby a given INSERT statement do not match one of the partitions listed,\nthe INSERT statement fails with the error Found a row not matching the\ngiven partition set. For more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/insert.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (240,9,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL. In previous versions of MySQL, it can be used for certain\nkinds of tables (such as MyISAM), such that when a client uses INSERT\nDELAYED, it gets an okay from the server at once, and the row is queued\nto be inserted when the table is not in use by any other thread.\n\nDELAYED inserts and replaces were deprecated in MySQL 5.6. In MySQL\n5.7, DELAYED is not supported. The server recognizes but ignores the\nDELAYED keyword, handles the insert as a nondelayed insert, and\ngenerates an ER_WARN_LEGACY_SYNTAX_CONVERTED warning ("INSERT DELAYED\nis no longer supported. The statement was converted to INSERT"). The\nDELAYED keyword is scheduled for removal in a future release.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/insert-delayed.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (241,35,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (242,9,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n SELECT ...\n [ON DUPLICATE KEY UPDATE assignment_list]\n\nvalue:\n {expr | DEFAULT}\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom the result of a SELECT statement, which can select from one or\nmany tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/insert-select.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (243,30,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin system table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.7/en/plugin-data-structures.html).\nPlugin names are not case-sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a chance to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\nsystem table. At server startup, the server loads and initializes any\nplugin that is listed in mysql.plugin. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/install-plugin.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (244,35,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (245,10,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (246,10,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (247,32,'INTERIORRINGN','InteriorRingN(poly, N)\n\nST_InteriorRingN() and InteriorRingN() are synonyms. For more\ninformation, see the description of ST_InteriorRingN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (248,27,'INTERSECTS','Intersects(g1, g2)\n\nMBRIntersects() and Intersects() are synonyms. For more information,\nsee the description of MBRIntersects().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (249,4,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (250,4,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (251,4,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (252,4,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (253,4,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (254,24,'ISCLOSED','IsClosed(ls)\n\nST_IsClosed() and IsClosed() are synonyms. For more information, see\nthe description of ST_IsClosed().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (255,18,'ISEMPTY','IsEmpty(g)\n\nST_IsEmpty() and IsEmpty() are synonyms. For more information, see the\ndescription of ST_IsEmpty().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (256,4,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n -> 0\nmysql> SELECT ISNULL(1/0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (257,37,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION\n transaction_characteristic [, transaction_characteristic] ...\n\ntransaction_characteristic: {\n ISOLATION LEVEL level\n | access_mode\n}\n\nlevel: {\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n}\n\naccess_mode: {\n READ WRITE\n | READ ONLY\n}\n\nThis statement specifies transaction characteristics. It takes a list\nof one or more characteristic values separated by commas. Each\ncharacteristic value sets the transaction isolation level or access\nmode. The isolation level is used for operations on InnoDB tables. The\naccess mode specifies whether transactions operate in read/write or\nread-only mode.\n\nIn addition, SET TRANSACTION can include an optional GLOBAL or SESSION\nkeyword to indicate the scope of the statement.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-transaction.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (258,18,'ISSIMPLE','IsSimple(g)\n\nST_IsSimple() and IsSimple() are synonyms. For more information, see\nthe description of ST_IsSimple().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (259,25,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (260,28,'IS_IPV4','Syntax:\nIS_IPV4(expr)\n\nReturns 1 if the argument is a valid IPv4 address specified as a\nstring, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4(\'10.0.5.9\'), IS_IPV4(\'10.0.5.256\');\n -> 1, 0\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (261,28,'IS_IPV4_COMPAT','Syntax:\nIS_IPV4_COMPAT(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-compatible IPv6 address, 0 otherwise.\nIPv4-compatible addresses have the form ::ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.5.9\'));\n -> 1\nmysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (262,28,'IS_IPV4_MAPPED','Syntax:\nIS_IPV4_MAPPED(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-mapped IPv6 address, 0 otherwise. IPv4-mapped\naddresses have the form ::ffff:ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.5.9\'));\n -> 0\nmysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (263,28,'IS_IPV6','Syntax:\nIS_IPV6(expr)\n\nReturns 1 if the argument is a valid IPv6 address specified as a\nstring, 0 otherwise. This function does not consider IPv4 addresses to\nbe valid IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV6(\'10.0.5.9\'), IS_IPV6(\'::1\');\n -> 0, 1\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (264,25,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client session that holds\nthe lock. Otherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (265,5,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "start the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/iterate.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/iterate.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (266,9,'JOIN','MySQL supports the following JOIN syntax for the table_references part\nof SELECT statements and multiple-table DELETE and UPDATE statements:\n\ntable_references:\n escaped_table_reference [, escaped_table_reference] ...\n\nescaped_table_reference:\n table_reference\n | { OJ table_reference }\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [PARTITION (partition_names)]\n [[AS] alias] [index_hint_list]\n | table_subquery [AS] alias\n | ( table_references )\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nA table reference (when it refers to a partitioned table) may contain a\nPARTITION option, including a list of comma-separated partitions,\nsubpartitions, or both. This option follows the name of the table and\nprecedes any alias declaration. The effect of this option is that rows\nare selected only from the listed partitions or subpartitions. Any\npartitions or subpartitions not named in the list are ignored. For more\ninformation and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nThe syntax of table_factor is extended in MySQL in comparison with\nstandard SQL. The standard accepts only table_reference, not a list of\nthem inside a pair of parentheses.\n\nThis is a conservative extension if each comma in a list of\ntable_reference items is considered as equivalent to an inner join. For\nexample:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)\n\nIn MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents\n(they can replace each other). In standard SQL, they are not\nequivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used\notherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins. See\nhttp://dev.mysql.com/doc/refman/5.7/en/nested-join-optimization.html.\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/index-hints.html. Optimizer\nhints and the optimizer_switch system variable are other ways to\ninfluence optimizer use of indexes. See\nhttp://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/switchable-optimizations.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/join.html\n\n','SELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.7/en/join.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (267,27,'JSON_APPEND','Syntax:\nJSON_APPEND(json_doc, path, val[, path, val] ...)\n\nAppends values to the end of the indicated arrays within a JSON\ndocument and returns the result. This function was renamed to\nJSON_ARRAY_APPEND() in MySQL 5.7.9; the alias JSON_APPEND() is now\ndeprecated in MySQL 5.7, and is removed in MySQL 8.0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (268,27,'JSON_ARRAY','Syntax:\nJSON_ARRAY([val[, val] ...])\n\nEvaluates a (possibly empty) list of values and returns a JSON array\ncontaining those values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html\n\n','mysql> SELECT JSON_ARRAY(1, "abc", NULL, TRUE, CURTIME());\n+---------------------------------------------+\n| JSON_ARRAY(1, "abc", NULL, TRUE, CURTIME()) |\n+---------------------------------------------+\n| [1, "abc", null, true, "11:30:24.000000"] |\n+---------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (269,14,'JSON_ARRAYAGG','Syntax:\nJSON_ARRAYAGG(col_or_expr)\n\nAggregates a result set as a single JSON array whose elements consist\nof the rows. The order of elements in this array is undefined. The\nfunction acts on a column or an expression that evaluates to a single\nvalue. Returns NULL if the result contains no rows, or in the event of\nan error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT o_id, attribute, value FROM t3;\n+------+-----------+-------+\n| o_id | attribute | value |\n+------+-----------+-------+\n| 2 | color | red |\n| 2 | fabric | silk |\n| 3 | color | green |\n| 3 | shape | square|\n+------+-----------+-------+\n4 rows in set (0.00 sec)\n\nmysql> SELECT o_id, JSON_ARRAYAGG(attribute) AS attributes \n > FROM t3 GROUP BY o_id;\n+------+---------------------+\n| o_id | attributes |\n+------+---------------------+\n| 2 | ["color", "fabric"] |\n| 3 | ["color", "shape"] |\n+------+---------------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (270,27,'JSON_ARRAY_APPEND','Syntax:\nJSON_ARRAY_APPEND(json_doc, path, val[, path, val] ...)\n\nAppends values to the end of the indicated arrays within a JSON\ndocument and returns the result. Returns NULL if any argument is NULL.\nAn error occurs if the json_doc argument is not a valid JSON document\nor any path argument is not a valid path expression or contains a * or\n** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nIf a path selects a scalar or object value, that value is autowrapped\nwithin an array and the new value is added to that array. Pairs for\nwhich the path does not identify any value in the JSON document are\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'["a", ["b", "c"], "d"]\';\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$[1]\', 1);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$[1]\', 1) |\n+----------------------------------+\n| ["a", ["b", "c", 1], "d"] |\n+----------------------------------+\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$[0]\', 2);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$[0]\', 2) |\n+----------------------------------+\n| [["a", 2], ["b", "c"], "d"] |\n+----------------------------------+\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$[1][0]\', 3);\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$[1][0]\', 3) |\n+-------------------------------------+\n| ["a", [["b", 3], "c"], "d"] |\n+-------------------------------------+\n\nmysql> SET @j = \'{"a": 1, "b": [2, 3], "c": 4}\';\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$.b\', \'x\');\n+------------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$.b\', \'x\') |\n+------------------------------------+\n| {"a": 1, "b": [2, 3, "x"], "c": 4} |\n+------------------------------------+\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$.c\', \'y\');\n+--------------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$.c\', \'y\') |\n+--------------------------------------+\n| {"a": 1, "b": [2, 3], "c": [4, "y"]} |\n+--------------------------------------+\n\nmysql> SET @j = \'{"a": 1}\';\nmysql> SELECT JSON_ARRAY_APPEND(@j, \'$\', \'z\');\n+---------------------------------+\n| JSON_ARRAY_APPEND(@j, \'$\', \'z\') |\n+---------------------------------+\n| [{"a": 1}, "z"] |\n+---------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (271,27,'JSON_ARRAY_INSERT','Syntax:\nJSON_ARRAY_INSERT(json_doc, path, val[, path, val] ...)\n\nUpdates a JSON document, inserting into an array within the document\nand returning the modified document. Returns NULL if any argument is\nNULL. An error occurs if the json_doc argument is not a valid JSON\ndocument or any path argument is not a valid path expression or\ncontains a * or ** wildcard or does not end with an array element\nidentifier.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nPairs for which the path does not identify any array in the JSON\ndocument are ignored. If a path identifies an array element, the\ncorresponding value is inserted at that element position, shifting any\nfollowing values to the right. If a path identifies an array position\npast the end of an array, the value is inserted at the end of the\narray.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'["a", {"b": [1, 2]}, [3, 4]]\';\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[1]\', \'x\');\n+------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[1]\', \'x\') |\n+------------------------------------+\n| ["a", "x", {"b": [1, 2]}, [3, 4]] |\n+------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[100]\', \'x\');\n+--------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[100]\', \'x\') |\n+--------------------------------------+\n| ["a", {"b": [1, 2]}, [3, 4], "x"] |\n+--------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[1].b[0]\', \'x\');\n+-----------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[1].b[0]\', \'x\') |\n+-----------------------------------------+\n| ["a", {"b": ["x", 1, 2]}, [3, 4]] |\n+-----------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[2][1]\', \'y\');\n+---------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[2][1]\', \'y\') |\n+---------------------------------------+\n| ["a", {"b": [1, 2]}, [3, "y", 4]] |\n+---------------------------------------+\nmysql> SELECT JSON_ARRAY_INSERT(@j, \'$[0]\', \'x\', \'$[2][1]\', \'y\');\n+----------------------------------------------------+\n| JSON_ARRAY_INSERT(@j, \'$[0]\', \'x\', \'$[2][1]\', \'y\') |\n+----------------------------------------------------+\n| ["x", "a", {"b": [1, 2]}, [3, 4]] |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (272,27,'JSON_CONTAINS','Syntax:\nJSON_CONTAINS(target, candidate[, path])\n\nIndicates by returning 1 or 0 whether a given candidate JSON document\nis contained within a target JSON document, or---if a path argument was\nsupplied---whether the candidate is found at a specific path within the\ntarget. Returns NULL if any argument is NULL, or if the path argument\ndoes not identify a section of the target document. An error occurs if\ntarget or candidate is not a valid JSON document, or if the path\nargument is not a valid path expression or contains a * or ** wildcard.\n\nTo check only whether any data exists at the path, use\nJSON_CONTAINS_PATH() instead.\n\nThe following rules define containment:\n\no A candidate scalar is contained in a target scalar if and only if\n they are comparable and are equal. Two scalar values are comparable\n if they have the same JSON_TYPE() types, with the exception that\n values of types INTEGER and DECIMAL are also comparable to each\n other.\n\no A candidate array is contained in a target array if and only if every\n element in the candidate is contained in some element of the target.\n\no A candidate nonarray is contained in a target array if and only if\n the candidate is contained in some element of the target.\n\no A candidate object is contained in a target object if and only if for\n each key in the candidate there is a key with the same name in the\n target and the value associated with the candidate key is contained\n in the value associated with the target key.\n\nOtherwise, the candidate value is not contained in the target document.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SET @j = \'{"a": 1, "b": 2, "c": {"d": 4}}\';\nmysql> SET @j2 = \'1\';\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.a\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.a\') |\n+-------------------------------+\n| 1 |\n+-------------------------------+\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.b\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.b\') |\n+-------------------------------+\n| 0 |\n+-------------------------------+\n\nmysql> SET @j2 = \'{"d": 4}\';\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.a\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.a\') |\n+-------------------------------+\n| 0 |\n+-------------------------------+\nmysql> SELECT JSON_CONTAINS(@j, @j2, \'$.c\');\n+-------------------------------+\n| JSON_CONTAINS(@j, @j2, \'$.c\') |\n+-------------------------------+\n| 1 |\n+-------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (273,27,'JSON_CONTAINS_PATH','Syntax:\nJSON_CONTAINS_PATH(json_doc, one_or_all, path[, path] ...)\n\nReturns 0 or 1 to indicate whether a JSON document contains data at a\ngiven path or paths. Returns NULL if any argument is NULL. An error\noccurs if the json_doc argument is not a valid JSON document, any path\nargument is not a valid path expression, or one_or_all is not \'one\' or\n\'all\'.\n\nTo check for a specific value at a path, use JSON_CONTAINS() instead.\n\nThe return value is 0 if no specified path exists within the document.\nOtherwise, the return value depends on the one_or_all argument:\n\no \'one\': 1 if at least one path exists within the document, 0\n otherwise.\n\no \'all\': 1 if all paths exist within the document, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SET @j = \'{"a": 1, "b": 2, "c": {"d": 4}}\';\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'one\', \'$.a\', \'$.e\');\n+---------------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'one\', \'$.a\', \'$.e\') |\n+---------------------------------------------+\n| 1 |\n+---------------------------------------------+\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'all\', \'$.a\', \'$.e\');\n+---------------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'all\', \'$.a\', \'$.e\') |\n+---------------------------------------------+\n| 0 |\n+---------------------------------------------+\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'one\', \'$.c.d\');\n+----------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'one\', \'$.c.d\') |\n+----------------------------------------+\n| 1 |\n+----------------------------------------+\nmysql> SELECT JSON_CONTAINS_PATH(@j, \'one\', \'$.a.d\');\n+----------------------------------------+\n| JSON_CONTAINS_PATH(@j, \'one\', \'$.a.d\') |\n+----------------------------------------+\n| 0 |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (274,27,'JSON_DEPTH','Syntax:\nJSON_DEPTH(json_doc)\n\nReturns the maximum depth of a JSON document. Returns NULL if the\nargument is NULL. An error occurs if the argument is not a valid JSON\ndocument.\n\nAn empty array, empty object, or scalar value has depth 1. A nonempty\narray containing only elements of depth 1 or nonempty object containing\nonly member values of depth 1 has depth 2. Otherwise, a JSON document\nhas depth greater than 2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','mysql> SELECT JSON_DEPTH(\'{}\'), JSON_DEPTH(\'[]\'), JSON_DEPTH(\'true\');\n+------------------+------------------+--------------------+\n| JSON_DEPTH(\'{}\') | JSON_DEPTH(\'[]\') | JSON_DEPTH(\'true\') |\n+------------------+------------------+--------------------+\n| 1 | 1 | 1 |\n+------------------+------------------+--------------------+\nmysql> SELECT JSON_DEPTH(\'[10, 20]\'), JSON_DEPTH(\'[[], {}]\');\n+------------------------+------------------------+\n| JSON_DEPTH(\'[10, 20]\') | JSON_DEPTH(\'[[], {}]\') |\n+------------------------+------------------------+\n| 2 | 2 |\n+------------------------+------------------------+\nmysql> SELECT JSON_DEPTH(\'[10, {"a": 20}]\');\n+-------------------------------+\n| JSON_DEPTH(\'[10, {"a": 20}]\') |\n+-------------------------------+\n| 3 |\n+-------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (275,27,'JSON_EXTRACT','Syntax:\nJSON_EXTRACT(json_doc, path[, path] ...)\n\nReturns data from a JSON document, selected from the parts of the\ndocument matched by the path arguments. Returns NULL if any argument is\nNULL or no paths locate a value in the document. An error occurs if the\njson_doc argument is not a valid JSON document or any path argument is\nnot a valid path expression.\n\nThe return value consists of all values matched by the path arguments.\nIf it is possible that those arguments could return multiple values,\nthe matched values are autowrapped as an array, in the order\ncorresponding to the paths that produced them. Otherwise, the return\nvalue is the single matched value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\');\n+--------------------------------------------+\n| JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\') |\n+--------------------------------------------+\n| 20 |\n+--------------------------------------------+\nmysql> SELECT JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\', \'$[0]\');\n+----------------------------------------------------+\n| JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[1]\', \'$[0]\') |\n+----------------------------------------------------+\n| [20, 10] |\n+----------------------------------------------------+\nmysql> SELECT JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[2][*]\');\n+-----------------------------------------------+\n| JSON_EXTRACT(\'[10, 20, [30, 40]]\', \'$[2][*]\') |\n+-----------------------------------------------+\n| [30, 40] |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (276,27,'JSON_INSERT','Syntax:\nJSON_INSERT(json_doc, path, val[, path, val] ...)\n\nInserts data into a JSON document and returns the result. Returns NULL\nif any argument is NULL. An error occurs if the json_doc argument is\nnot a valid JSON document or any path argument is not a valid path\nexpression or contains a * or ** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nA path-value pair for an existing path in the document is ignored and\ndoes not overwrite the existing document value. A path-value pair for a\nnonexisting path in the document adds the value to the document if the\npath identifies one of these types of values:\n\no A member not present in an existing object. The member is added to\n the object and associated with the new value.\n\no A position past the end of an existing array. The array is extended\n with the new value. If the existing value is not an array, it is\n autowrapped as an array, then extended with the new value.\n\nOtherwise, a path-value pair for a nonexisting path in the document is\nignored and has no effect.\n\nFor a comparison of JSON_INSERT(), JSON_REPLACE(), and JSON_SET(), see\nthe discussion of JSON_SET().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'{ "a": 1, "b": [2, 3]}\';\nmysql> SELECT JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+----------------------------------------------------+\n| JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+----------------------------------------------------+\n| {"a": 1, "b": [2, 3], "c": "[true, false]"} |\n+----------------------------------------------------+\n\nmysql> SELECT JSON_INSERT(@j, \'$.a\', 10, \'$.c\', CAST(\'[true, false]\' AS JSON));\n+------------------------------------------------------------------+\n| JSON_INSERT(@j, \'$.a\', 10, \'$.c\', CAST(\'[true, false]\' AS JSON)) |\n+------------------------------------------------------------------+\n| {"a": 1, "b": [2, 3], "c": [true, false]} |\n+------------------------------------------------------------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (277,27,'JSON_KEYS','Syntax:\nJSON_KEYS(json_doc[, path])\n\nReturns the keys from the top-level value of a JSON object as a JSON\narray, or, if a path argument is given, the top-level keys from the\nselected path. Returns NULL if any argument is NULL, the json_doc\nargument is not an object, or path, if given, does not locate an\nobject. An error occurs if the json_doc argument is not a valid JSON\ndocument or the path argument is not a valid path expression or\ncontains a * or ** wildcard.\n\nThe result array is empty if the selected object is empty. If the\ntop-level value has nested subobjects, the return value does not\ninclude keys from those subobjects.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SELECT JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\');\n+---------------------------------------+\n| JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\') |\n+---------------------------------------+\n| ["a", "b"] |\n+---------------------------------------+\nmysql> SELECT JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\', \'$.b\');\n+----------------------------------------------+\n| JSON_KEYS(\'{"a": 1, "b": {"c": 30}}\', \'$.b\') |\n+----------------------------------------------+\n| ["c"] |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (278,27,'JSON_LENGTH','Syntax:\nJSON_LENGTH(json_doc[, path])\n\nReturns the length of a JSON document, or, if a path argument is given,\nthe length of the value within the document identified by the path.\nReturns NULL if any argument is NULL or the path argument does not\nidentify a value in the document. An error occurs if the json_doc\nargument is not a valid JSON document or the path argument is not a\nvalid path expression or contains a * or ** wildcard.\n\nThe length of a document is determined as follows:\n\no The length of a scalar is 1.\n\no The length of an array is the number of array elements.\n\no The length of an object is the number of object members.\n\no The length does not count the length of nested arrays or objects.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','mysql> SELECT JSON_LENGTH(\'[1, 2, {"a": 3}]\');\n+---------------------------------+\n| JSON_LENGTH(\'[1, 2, {"a": 3}]\') |\n+---------------------------------+\n| 3 |\n+---------------------------------+\nmysql> SELECT JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\');\n+-----------------------------------------+\n| JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\') |\n+-----------------------------------------+\n| 2 |\n+-----------------------------------------+\nmysql> SELECT JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\', \'$.b\');\n+------------------------------------------------+\n| JSON_LENGTH(\'{"a": 1, "b": {"c": 30}}\', \'$.b\') |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (279,27,'JSON_MERGE','Syntax:\nJSON_MERGE(json_doc, json_doc[, json_doc] ...)\n\nMerges two or more JSON documents. Synonym for JSON_MERGE_PRESERVE();\ndeprecated in MySQL 5.7.22 and subject to removal in a future release.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SELECT JSON_MERGE(\'[1, 2]\', \'[true, false]\');\n+---------------------------------------+\n| JSON_MERGE(\'[1, 2]\', \'[true, false]\') |\n+---------------------------------------+\n| [1, 2, true, false] |\n+---------------------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS\\G\n*************************** 1. row ***************************\n Level: Warning\n Code: 1287\nMessage: \'JSON_MERGE\' is deprecated and will be removed in a future release. \\\n Please use JSON_MERGE_PRESERVE/JSON_MERGE_PATCH instead\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (280,27,'JSON_MERGE_PATCH()','Syntax:\nJSON_MERGE_PATCH(json_doc, json_doc[, json_doc] ...)\n\nPerforms an RFC 7396 (https://tools.ietf.org/html/rfc7396) compliant\nmerge of two or more JSON documents and returns the merged result,\nwithout preserving members having duplicate keys. Raises an error if at\nleast one of the documents passed as arguments to this function is not\nvalid.\n\n*Note*:\n\nFor an explanation and example of the differences between this function\nand JSON_MERGE_PRESERVE(), see\nhttp://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n#json-merge-patch-json-merge-preserve-compared.\n\nJSON_MERGE_PATCH() performs a merge as follows:\n\n1. If the first argument is not an object, the result of the merge is\n the same as if an empty object had been merged with the second\n argument.\n\n2. If the second argument is not an object, the result of the merge is\n the second argument.\n\n3. If both arguments are objects, the result of the merge is an object\n with the following members:\n\n o All members of the first object which do not have a corresponding\n member with the same key in the second object.\n\n o All members of the second object which do not have a corresponding\n key in the first object, and whose value is not the JSON null\n literal.\n\n o All members with a key that exists in both the first and the second\n object, and whose value in the second object is not the JSON null\n literal. The values of these members are the results of recursively\n merging the value in the first object with the value in the second\n object.\n\nFor additional information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/json.html#json-normalization.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SELECT JSON_MERGE_PATCH(\'[1, 2]\', \'[true, false]\');\n+---------------------------------------------+\n| JSON_MERGE_PATCH(\'[1, 2]\', \'[true, false]\') |\n+---------------------------------------------+\n| [true, false] |\n+---------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{"name": "x"}\', \'{"id": 47}\');\n+-------------------------------------------------+\n| JSON_MERGE_PATCH(\'{"name": "x"}\', \'{"id": 47}\') |\n+-------------------------------------------------+\n| {"id": 47, "name": "x"} |\n+-------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'1\', \'true\');\n+-------------------------------+\n| JSON_MERGE_PATCH(\'1\', \'true\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'[1, 2]\', \'{"id": 47}\');\n+------------------------------------------+\n| JSON_MERGE_PATCH(\'[1, 2]\', \'{"id": 47}\') |\n+------------------------------------------+\n| {"id": 47} |\n+------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\n > \'{ "a": 3, "c":4 }\');\n+-----------------------------------------------------------+\n| JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\'{ "a": 3, "c":4 }\') |\n+-----------------------------------------------------------+\n| {"a": 3, "b": 2, "c": 4} |\n+-----------------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\'{ "a": 3, "c":4 }\',\n > \'{ "a": 5, "d":6 }\');\n+-------------------------------------------------------------------------------+\n| JSON_MERGE_PATCH(\'{ "a": 1, "b":2 }\',\'{ "a": 3, "c":4 }\',\'{ "a": 5, "d":6 }\') |\n+-------------------------------------------------------------------------------+\n| {"a": 5, "b": 2, "c": 4, "d": 6} |\n+-------------------------------------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{"a":1, "b":2}\', \'{"b":null}\');\n+--------------------------------------------------+\n| JSON_MERGE_PATCH(\'{"a":1, "b":2}\', \'{"b":null}\') |\n+--------------------------------------------------+\n| {"a": 1} |\n+--------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PATCH(\'{"a":{"x":1}}\', \'{"a":{"y":2}}\');\n+----------------------------------------------------+\n| JSON_MERGE_PATCH(\'{"a":{"x":1}}\', \'{"a":{"y":2}}\') |\n+----------------------------------------------------+\n| {"a": {"x": 1, "y": 2}} |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (281,27,'JSON_MERGE_PRESERVE()','Syntax:\nJSON_MERGE_PRESERVE(json_doc, json_doc[, json_doc] ...)\n\nMerges two or more JSON documents and returns the merged result.\nReturns NULL if any argument is NULL. An error occurs if any argument\nis not a valid JSON document.\n\nMerging takes place according to the following rules. For additional\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.7/en/json.html#json-normalization.\n\no Adjacent arrays are merged to a single array.\n\no Adjacent objects are merged to a single object.\n\no A scalar value is autowrapped as an array and merged as an array.\n\no An adjacent array and object are merged by autowrapping the object as\n an array and merging the two arrays.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SELECT JSON_MERGE_PRESERVE(\'[1, 2]\', \'[true, false]\');\n+------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'[1, 2]\', \'[true, false]\') |\n+------------------------------------------------+\n| [1, 2, true, false] |\n+------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'{"name": "x"}\', \'{"id": 47}\');\n+----------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'{"name": "x"}\', \'{"id": 47}\') |\n+----------------------------------------------------+\n| {"id": 47, "name": "x"} |\n+----------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'1\', \'true\');\n+----------------------------------+\n| JSON_MERGE_PRESERVE(\'1\', \'true\') |\n+----------------------------------+\n| [1, true] |\n+----------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'[1, 2]\', \'{"id": 47}\');\n+---------------------------------------------+\n| JSON_MERGE_PRESERVE(\'[1, 2]\', \'{"id": 47}\') |\n+---------------------------------------------+\n| [1, 2, {"id": 47}] |\n+---------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\n > \'{ "a": 3, "c": 4 }\');\n+--------------------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\'{ "a": 3, "c":4 }\') |\n+--------------------------------------------------------------+\n| {"a": [1, 3], "b": 2, "c": 4} |\n+--------------------------------------------------------------+\n\nmysql> SELECT JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\'{ "a": 3, "c": 4 }\',\n > \'{ "a": 5, "d": 6 }\');\n+----------------------------------------------------------------------------------+\n| JSON_MERGE_PRESERVE(\'{ "a": 1, "b": 2 }\',\'{ "a": 3, "c": 4 }\',\'{ "a": 5, "d": 6 }\') |\n+----------------------------------------------------------------------------------+\n| {"a": [1, 3, 5], "b": 2, "c": 4, "d": 6} |\n+----------------------------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (282,27,'JSON_OBJECT','Syntax:\nJSON_OBJECT([key, val[, key, val] ...])\n\nEvaluates a (possibly empty) list of key-value pairs and returns a JSON\nobject containing those pairs. An error occurs if any key name is NULL\nor the number of arguments is odd.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html\n\n','mysql> SELECT JSON_OBJECT(\'id\', 87, \'name\', \'carrot\');\n+-----------------------------------------+\n| JSON_OBJECT(\'id\', 87, \'name\', \'carrot\') |\n+-----------------------------------------+\n| {"id": 87, "name": "carrot"} |\n+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (283,14,'JSON_OBJECTAGG','Syntax:\nJSON_OBJECTAGG(key, value)\n\nTakes two column names or expressions as arguments, the first of these\nbeing used as a key and the second as a value, and returns a JSON\nobject containing key-value pairs. Returns NULL if the result contains\nno rows, or in the event of an error. An error occurs if any key name\nis NULL or the number of arguments is not equal to 2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT o_id, attribute, value FROM t3;\n+------+-----------+-------+\n| o_id | attribute | value |\n+------+-----------+-------+\n| 2 | color | red |\n| 2 | fabric | silk |\n| 3 | color | green |\n| 3 | shape | square|\n+------+-----------+-------+\n4 rows in set (0.00 sec)\n\nmysql> SELECT o_id, JSON_OBJECTAGG(attribute, value) FROM t3 GROUP BY o_id;\n+------+----------------------------------------+\n| o_id | JSON_OBJECTAGG(attribute, name) |\n+------+----------------------------------------+\n| 2 | {"color": "red", "fabric": "silk"} |\n| 3 | {"color": "green", "shape": "square"} |\n+------+----------------------------------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (284,27,'JSON_PRETTY','JSON_PRETTY(json_val)\n\nProvides pretty-printing of JSON values similar to that implemented in\nPHP and by other languages and database systems. The value supplied\nmust be a JSON value or a valid string representation of a JSON value.\nExtraneous whitespaces and newlines present in this value have no\neffect on the output. For a NULL value, the function returns NULL. If\nthe value is not a JSON document, or if it cannot cannot be parsed as\none, the function fails with an error.\n\nFormatting of the output from this function adheres to the following\nrules:\n\no Each array element or object member appears on a separate line,\n indented by one additional level as compared to its parent.\n\no Each level of indentation adds two leading spaces.\n\no A comma separating individual array elements or object members is\n printed before the newline that separates the two elements or\n members.\n\no The key and the value of an object member are separated by a colon\n followed by a space (\': \').\n\no An empty object or array is printed on a single line. No space is\n printed between the opening and closing brace.\n\no Special characters in string scalars and key names are escaped\n employing the same rules used by the JSON_QUOTE() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html\n\n','mysql> SELECT JSON_PRETTY(\'123\'); # scalar\n+--------------------+\n| JSON_PRETTY(\'123\') |\n+--------------------+\n| 123 |\n+--------------------+\n\nmysql> SELECT JSON_PRETTY("[1,3,5]"); # array\n+------------------------+\n| JSON_PRETTY("[1,3,5]") |\n+------------------------+\n| [\n 1,\n 3,\n 5\n] |\n+------------------------+\n\nmysql> SELECT JSON_PRETTY(\'{"a":"10","b":"15","x":"25"}\'); # object\n+---------------------------------------------+\n| JSON_PRETTY(\'{"a":"10","b":"15","x":"25"}\') |\n+---------------------------------------------+\n| {\n "a": "10",\n "b": "15",\n "x": "25"\n} |\n+---------------------------------------------+\n\nmysql> SELECT JSON_PRETTY(\'["a",1,{"key1":\n > "value1"},"5", "77" ,\n > {"key2":["value3","valueX",\n > "valueY"]},"j", "2" ]\')\\G # nested arrays and objects\n*************************** 1. row ***************************\nJSON_PRETTY(\'["a",1,{"key1":\n "value1"},"5", "77" ,\n {"key2":["value3","valuex",\n "valuey"]},"j", "2" ]\'): [\n "a",\n 1,\n {\n "key1": "value1"\n },\n "5",\n "77",\n {\n "key2": [\n "value3",\n "valuex",\n "valuey"\n ]\n },\n "j",\n "2"\n]\n','http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (285,27,'JSON_QUOTE','Syntax:\nJSON_QUOTE(string)\n\nQuotes a string as a JSON value by wrapping it with double quote\ncharacters and escaping interior quote and other characters, then\nreturning the result as a utf8mb4 string. Returns NULL if the argument\nis NULL.\n\nThis function is typically used to produce a valid JSON string literal\nfor inclusion within a JSON document.\n\nCertain special characters are escaped with backslashes per the escape\nsequences shown in\nhttp://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n#json-unquote-character-escape-sequences.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html\n\n','mysql> SELECT JSON_QUOTE(\'null\'), JSON_QUOTE(\'"null"\');\n+--------------------+----------------------+\n| JSON_QUOTE(\'null\') | JSON_QUOTE(\'"null"\') |\n+--------------------+----------------------+\n| "null" | "\\"null\\"" |\n+--------------------+----------------------+\nmysql> SELECT JSON_QUOTE(\'[1, 2, 3]\');\n+-------------------------+\n| JSON_QUOTE(\'[1, 2, 3]\') |\n+-------------------------+\n| "[1, 2, 3]" |\n+-------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-creation-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (286,27,'JSON_REMOVE','Syntax:\nJSON_REMOVE(json_doc, path[, path] ...)\n\nRemoves data from a JSON document and returns the result. Returns NULL\nif any argument is NULL. An error occurs if the json_doc argument is\nnot a valid JSON document or any path argument is not a valid path\nexpression or is $ or contains a * or ** wildcard.\n\nThe path arguments are evaluated left to right. The document produced\nby evaluating one path becomes the new value against which the next\npath is evaluated.\n\nIt is not an error if the element to be removed does not exist in the\ndocument; in that case, the path does not affect the document.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'["a", ["b", "c"], "d"]\';\nmysql> SELECT JSON_REMOVE(@j, \'$[1]\');\n+-------------------------+\n| JSON_REMOVE(@j, \'$[1]\') |\n+-------------------------+\n| ["a", "d"] |\n+-------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (287,27,'JSON_REPLACE','Syntax:\nJSON_REPLACE(json_doc, path, val[, path, val] ...)\n\nReplaces existing values in a JSON document and returns the result.\nReturns NULL if any argument is NULL. An error occurs if the json_doc\nargument is not a valid JSON document or any path argument is not a\nvalid path expression or contains a * or ** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nA path-value pair for an existing path in the document overwrites the\nexisting document value with the new value. A path-value pair for a\nnonexisting path in the document is ignored and has no effect.\n\nFor a comparison of JSON_INSERT(), JSON_REPLACE(), and JSON_SET(), see\nthe discussion of JSON_SET().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'{ "a": 1, "b": [2, 3]}\';\nmysql> SELECT JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+-----------------------------------------------------+\n| JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+-----------------------------------------------------+\n| {"a": 10, "b": [2, 3]} |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (288,27,'JSON_SEARCH','Syntax:\nJSON_SEARCH(json_doc, one_or_all, search_str[, escape_char[, path]\n...])\n\nReturns the path to the given string within a JSON document. Returns\nNULL if any of the json_doc, search_str, or path arguments are NULL; no\npath exists within the document; or search_str is not found. An error\noccurs if the json_doc argument is not a valid JSON document, any path\nargument is not a valid path expression, one_or_all is not \'one\' or\n\'all\', or escape_char is not a constant expression.\n\nThe one_or_all argument affects the search as follows:\n\no \'one\': The search terminates after the first match and returns one\n path string. It is undefined which match is considered first.\n\no \'all\': The search returns all matching path strings such that no\n duplicate paths are included. If there are multiple strings, they are\n autowrapped as an array. The order of the array elements is\n undefined.\n\nWithin the search_str search string argument, the % and _ characters\nwork as for the LIKE operator: % matches any number of characters\n(including zero characters), and _ matches exactly one character.\n\nTo specify a literal % or _ character in the search string, precede it\nby the escape character. The default is \\ if the escape_char argument\nis missing or NULL. Otherwise, escape_char must be a constant that is\nempty or one character.\n\nFor more information about matching and escape character behavior, see\nthe description of LIKE in\nhttp://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n. For escape character handling, a difference from the LIKE behavior is\nthat the escape character for JSON_SEARCH() must evaluate to a constant\nat compile time, not just at execution time. For example, if\nJSON_SEARCH() is used in a prepared statement and the escape_char\nargument is supplied using a ? parameter, the parameter value might be\nconstant at execution time, but is not at compile time.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html\n\n','mysql> SET @j = \'["abc", [{"k": "10"}, "def"], {"x":"abc"}, {"y":"bcd"}]\';\n\nmysql> SELECT JSON_SEARCH(@j, \'one\', \'abc\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'one\', \'abc\') |\n+-------------------------------+\n| "$[0]" |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'abc\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'abc\') |\n+-------------------------------+\n| ["$[0]", "$[2].x"] |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'ghi\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'ghi\') |\n+-------------------------------+\n| NULL |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\');\n+------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\') |\n+------------------------------+\n| "$[1][0].k" |\n+------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$\');\n+-----------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$\') |\n+-----------------------------------------+\n| "$[1][0].k" |\n+-----------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*]\');\n+--------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*]\') |\n+--------------------------------------------+\n| "$[1][0].k" |\n+--------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$**.k\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$**.k\') |\n+---------------------------------------------+\n| "$[1][0].k" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*][0].k\');\n+-------------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[*][0].k\') |\n+-------------------------------------------------+\n| "$[1][0].k" |\n+-------------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1]\');\n+--------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1]\') |\n+--------------------------------------------+\n| "$[1][0].k" |\n+--------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1][0]\');\n+-----------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'10\', NULL, \'$[1][0]\') |\n+-----------------------------------------------+\n| "$[1][0].k" |\n+-----------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'abc\', NULL, \'$[2]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'abc\', NULL, \'$[2]\') |\n+---------------------------------------------+\n| "$[2].x" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%a%\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%a%\') |\n+-------------------------------+\n| ["$[0]", "$[2].x"] |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\');\n+-------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\') |\n+-------------------------------+\n| ["$[0]", "$[2].x", "$[3].y"] |\n+-------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[0]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[0]\') |\n+---------------------------------------------+\n| "$[0]" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[2]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[2]\') |\n+---------------------------------------------+\n| "$[2].x" |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[1]\');\n+---------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', NULL, \'$[1]\') |\n+---------------------------------------------+\n| NULL |\n+---------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[1]\');\n+-------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[1]\') |\n+-------------------------------------------+\n| NULL |\n+-------------------------------------------+\n\nmysql> SELECT JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[3]\');\n+-------------------------------------------+\n| JSON_SEARCH(@j, \'all\', \'%b%\', \'\', \'$[3]\') |\n+-------------------------------------------+\n| "$[3].y" |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (289,27,'JSON_SET','Syntax:\nJSON_SET(json_doc, path, val[, path, val] ...)\n\nInserts or updates data in a JSON document and returns the result.\nReturns NULL if any argument is NULL or path, if given, does not locate\nan object. An error occurs if the json_doc argument is not a valid JSON\ndocument or any path argument is not a valid path expression or\ncontains a * or ** wildcard.\n\nThe path-value pairs are evaluated left to right. The document produced\nby evaluating one pair becomes the new value against which the next\npair is evaluated.\n\nA path-value pair for an existing path in the document overwrites the\nexisting document value with the new value. A path-value pair for a\nnonexisting path in the document adds the value to the document if the\npath identifies one of these types of values:\n\no A member not present in an existing object. The member is added to\n the object and associated with the new value.\n\no A position past the end of an existing array. The array is extended\n with the new value. If the existing value is not an array, it is\n autowrapped as an array, then extended with the new value.\n\nOtherwise, a path-value pair for a nonexisting path in the document is\nignored and has no effect.\n\nThe JSON_SET(), JSON_INSERT(), and JSON_REPLACE() functions are\nrelated:\n\no JSON_SET() replaces existing values and adds nonexisting values.\n\no JSON_INSERT() inserts values without replacing existing values.\n\no JSON_REPLACE() replaces only existing values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'{ "a": 1, "b": [2, 3]}\';\nmysql> SELECT JSON_SET(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+-------------------------------------------------+\n| JSON_SET(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+-------------------------------------------------+\n| {"a": 10, "b": [2, 3], "c": "[true, false]"} |\n+-------------------------------------------------+\nmysql> SELECT JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+----------------------------------------------------+\n| JSON_INSERT(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+----------------------------------------------------+\n| {"a": 1, "b": [2, 3], "c": "[true, false]"} |\n+----------------------------------------------------+\nmysql> SELECT JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\');\n+-----------------------------------------------------+\n| JSON_REPLACE(@j, \'$.a\', 10, \'$.c\', \'[true, false]\') |\n+-----------------------------------------------------+\n| {"a": 10, "b": [2, 3]} |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (290,27,'JSON_STORAGE_SIZE','JSON_STORAGE_SIZE(json_val)\n\nThis function returns the number of bytes used to store the binary\nrepresentation of a JSON document. When the argument is a JSON column,\nthis is the space used to store the JSON document. json_val must be a\nvalid JSON document or a string which can be parsed as one. In the case\nwhere it is string, the function returns the amount of storage space in\nthe JSON binary representation that is created by parsing the string as\nJSON and converting it to binary. It returns NULL if the argument is\nNULL.\n\nAn error results when json_val is not NULL, and is not---or cannot be\nsuccessfully parsed as---a JSON document.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html\n\n','mysql> CREATE TABLE jtable (jcol JSON);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO jtable VALUES\n -> (\'{"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"}\');\nQuery OK, 1 row affected (0.04 sec)\n\nmysql> SELECT\n -> jcol,\n -> JSON_STORAGE_SIZE(jcol) AS Size\n -> FROM jtable;\n+-----------------------------------------------+------+\n| jcol | Size |\n+-----------------------------------------------+------+\n| {"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"} | 47 |\n+-----------------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> UPDATE jtable\nmysql> SET jcol = \'{"a": 4.55, "b": "wxyz", "c": "[true, false]"}\';\nQuery OK, 1 row affected (0.04 sec)\nRows matched: 1 Changed: 1 Warnings: 0\n\nmysql> SELECT\n -> jcol,\n -> JSON_STORAGE_SIZE(jcol) AS Size\n -> FROM jtable;\n+------------------------------------------------+------+\n| jcol | Size |\n+------------------------------------------------+------+\n| {"a": 4.55, "b": "wxyz", "c": "[true, false]"} | 56 |\n+------------------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SET @j = \'[100, "sakila", [1, 3, 5], 425.05]\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @j, JSON_STORAGE_SIZE(@j) AS Size;\n+------------------------------------+------+\n| @j | Size |\n+------------------------------------+------+\n| [100, "sakila", [1, 3, 5], 425.05] | 45 |\n+------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SET @j = JSON_SET(@j, \'$[1]\', "json");\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @j, JSON_STORAGE_SIZE(@j) AS Size;\n+----------------------------------+------+\n| @j | Size |\n+----------------------------------+------+\n| [100, "json", [1, 3, 5], 425.05] | 43 |\n+----------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SET @j = JSON_SET(@j, \'$[2][0]\', JSON_ARRAY(10, 20, 30));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @j, JSON_STORAGE_SIZE(@j) AS Size;\n+---------------------------------------------+------+\n| @j | Size |\n+---------------------------------------------+------+\n| [100, "json", [[10, 20, 30], 3, 5], 425.05] | 56 |\n+---------------------------------------------+------+\n1 row in set (0.00 sec)\n\nmysql> SELECT\n -> JSON_STORAGE_SIZE(\'[100, "sakila", [1, 3, 5], 425.05]\') AS A,\n -> JSON_STORAGE_SIZE(\'{"a": 1000, "b": "a", "c": "[1, 3, 5, 7]"}\') AS B,\n -> JSON_STORAGE_SIZE(\'{"a": 1000, "b": "wxyz", "c": "[1, 3, 5, 7]"}\') AS C,\n -> JSON_STORAGE_SIZE(\'[100, "json", [[10, 20, 30], 3, 5], 425.05]\') AS D;\n+----+----+----+----+\n| A | B | C | D |\n+----+----+----+----+\n| 45 | 44 | 47 | 56 |\n+----+----+----+----+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/json-utility-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (291,27,'JSON_TYPE','Syntax:\nJSON_TYPE(json_val)\n\nReturns a utf8mb4 string indicating the type of a JSON value. This can\nbe an object, an array, or a scalar type, as shown here:\n\nmysql> SET @j = \'{"a": [10, true]}\';\nmysql> SELECT JSON_TYPE(@j);\n+---------------+\n| JSON_TYPE(@j) |\n+---------------+\n| OBJECT |\n+---------------+\nmysql> SELECT JSON_TYPE(JSON_EXTRACT(@j, \'$.a\'));\n+------------------------------------+\n| JSON_TYPE(JSON_EXTRACT(@j, \'$.a\')) |\n+------------------------------------+\n| ARRAY |\n+------------------------------------+\nmysql> SELECT JSON_TYPE(JSON_EXTRACT(@j, \'$.a[0]\'));\n+---------------------------------------+\n| JSON_TYPE(JSON_EXTRACT(@j, \'$.a[0]\')) |\n+---------------------------------------+\n| INTEGER |\n+---------------------------------------+\nmysql> SELECT JSON_TYPE(JSON_EXTRACT(@j, \'$.a[1]\'));\n+---------------------------------------+\n| JSON_TYPE(JSON_EXTRACT(@j, \'$.a[1]\')) |\n+---------------------------------------+\n| BOOLEAN |\n+---------------------------------------+\n\nJSON_TYPE() returns NULL if the argument is NULL:\n\nmysql> SELECT JSON_TYPE(NULL);\n+-----------------+\n| JSON_TYPE(NULL) |\n+-----------------+\n| NULL |\n+-----------------+\n\nAn error occurs if the argument is not a valid JSON value:\n\nmysql> SELECT JSON_TYPE(1);\nERROR 3146 (22032): Invalid data type for JSON data in argument 1\nto function json_type; a JSON string or JSON type is required.\n\nFor a non-NULL, non-error result, the following list describes the\npossible JSON_TYPE() return values:\n\no Purely JSON types:\n\n o OBJECT: JSON objects\n\n o ARRAY: JSON arrays\n\n o BOOLEAN: The JSON true and false literals\n\n o NULL: The JSON null literal\n\no Numeric types:\n\n o INTEGER: MySQL TINYINT, SMALLINT, MEDIUMINT and INT and BIGINT\n scalars\n\n o DOUBLE: MySQL DOUBLE FLOAT scalars\n\n o DECIMAL: MySQL DECIMAL and NUMERIC scalars\n\no Temporal types:\n\n o DATETIME: MySQL DATETIME and TIMESTAMP scalars\n\n o DATE: MySQL DATE scalars\n\n o TIME: MySQL TIME scalars\n\no String types:\n\n o STRING: MySQL utf8 character type scalars: CHAR, VARCHAR, TEXT,\n ENUM, and SET\n\no Binary types:\n\n o BLOB: MySQL binary type scalars: BINARY, VARBINARY, BLOB\n\n o BIT: MySQL BIT scalars\n\no All other types:\n\n o OPAQUE (raw bits)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (292,27,'JSON_UNQUOTE','Syntax:\nJSON_UNQUOTE(json_val)\n\nUnquotes JSON value and returns the result as a utf8mb4 string. Returns\nNULL if the argument is NULL. An error occurs if the value starts and\nends with double quotes but is not a valid JSON string literal.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html\n\n','mysql> SET @j = \'"abc"\';\nmysql> SELECT @j, JSON_UNQUOTE(@j);\n+-------+------------------+\n| @j | JSON_UNQUOTE(@j) |\n+-------+------------------+\n| "abc" | abc |\n+-------+------------------+\nmysql> SET @j = \'[1, 2, 3]\';\nmysql> SELECT @j, JSON_UNQUOTE(@j);\n+-----------+------------------+\n| @j | JSON_UNQUOTE(@j) |\n+-----------+------------------+\n| [1, 2, 3] | [1, 2, 3] |\n+-----------+------------------+\n\nmysql> SELECT @@sql_mode;\n+------------+\n| @@sql_mode |\n+------------+\n| |\n+------------+\n\nmysql> SELECT JSON_UNQUOTE(\'"\\\\t\\\\u0032"\');\n+------------------------------+\n| JSON_UNQUOTE(\'"\\\\t\\\\u0032"\') |\n+------------------------------+\n| 2 |\n+------------------------------+\n\nmysql> SET @@sql_mode = \'NO_BACKSLASH_ESCAPES\';\nmysql> SELECT JSON_UNQUOTE(\'"\\\\t\\\\u0032"\');\n+------------------------------+\n| JSON_UNQUOTE(\'"\\\\t\\\\u0032"\') |\n+------------------------------+\n| \\t\\u0032 |\n+------------------------------+\n\nmysql> SELECT JSON_UNQUOTE(\'"\\t\\u0032"\');\n+----------------------------+\n| JSON_UNQUOTE(\'"\\t\\u0032"\') |\n+----------------------------+\n| 2 |\n+----------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (293,27,'JSON_VALID','Syntax:\nJSON_VALID(val)\n\nReturns 0 or 1 to indicate whether a value is valid JSON. Returns NULL\nif the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html\n\n','mysql> SELECT JSON_VALID(\'{"a": 1}\');\n+------------------------+\n| JSON_VALID(\'{"a": 1}\') |\n+------------------------+\n| 1 |\n+------------------------+\nmysql> SELECT JSON_VALID(\'hello\'), JSON_VALID(\'"hello"\');\n+---------------------+-----------------------+\n| JSON_VALID(\'hello\') | JSON_VALID(\'"hello"\') |\n+---------------------+-----------------------+\n| 0 | 1 |\n+---------------------+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (294,2,'KILL','Syntax:\nKILL [CONNECTION | QUERY] processlist_id\n\nEach connection to mysqld runs in a separate thread. You can kill a\nthread with the KILL processlist_id statement.\n\nThread processlist identifiers can be determined from the ID column of\nthe INFORMATION_SCHEMA PROCESSLIST table, the Id column of SHOW\nPROCESSLIST output, and the PROCESSLIST_ID column of the Performance\nSchema threads table. The value for the current thread is returned by\nthe CONNECTION_ID() function.\n\nKILL permits an optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n the connection associated with the given processlist_id, after\n terminating any statement the connection is executing.\n\no KILL QUERY terminates the statement the connection is currently\n executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*:\n\nYou cannot use KILL with the Embedded MySQL Server library because the\nembedded server merely runs inside the threads of the host application.\nIt does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/kill.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (295,5,'LABELS','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nLabels are permitted for BEGIN ... END blocks and for the LOOP, REPEAT,\nand WHILE statements. Label use for those statements follows these\nrules:\n\no begin_label must be followed by a colon.\n\no begin_label can be given without end_label. If end_label is present,\n it must be the same as begin_label.\n\no end_label cannot be given without begin_label.\n\no Labels at the same nesting level must be distinct.\n\no Labels can be up to 16 characters long.\n\nTo refer to a label within the labeled construct, use an ITERATE or\nLEAVE statement. The following example uses those statements to\ncontinue iterating or terminate the loop:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\nEND;\n\nThe scope of a block label does not include the code for handlers\ndeclared within the block. For details, see [HELP DECLARE HANDLER].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/statement-labels.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/statement-labels.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (296,11,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (297,22,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nWith no argument, LAST_INSERT_ID() returns a BIGINT UNSIGNED (64-bit)\nvalue representing the first automatically generated value successfully\ninserted for an AUTO_INCREMENT column as a result of the most recently\nexecuted INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nWith an argument, LAST_INSERT_ID() returns an unsigned integer.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n -> 195\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nPrior to MySQL 5.7.3, this function was not replicated correctly if\nreplication filtering rules were in use. (Bug #17234370, Bug #69861)\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n LAST_INSERT_ID(), the changed value is seen by statements that follow\n the procedure call.\n\no For stored functions and triggers that change the value, the value is\n restored when the function or trigger ends, so following statements\n will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (298,35,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (299,4,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If any argument is NULL, the result is NULL. No comparison is needed.\n\no If all arguments are integer-valued, they are compared as integers.\n\no If at least one argument is double precision, they are compared as\n double-precision values. Otherwise, if at least one argument is a\n DECIMAL value, they are compared as DECIMAL values.\n\no If the arguments comprise a mix of numbers and strings, they are\n compared as numbers.\n\no If any argument is a nonbinary (character) string, the arguments are\n compared as nonbinary strings.\n\no In all other cases, the arguments are compared as binary strings.\n\nThe return type of LEAST() is the aggregated type of the comparison\nargument types.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n -> \'A\'\n','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (300,5,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. If the label is for the outermost stored program block,\nLEAVE exits the program.\n\nLEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/leave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/leave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (301,35,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (302,35,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multibyte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (303,35,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using an SQL pattern. Returns 1 (TRUE) or 0 (FALSE).\nIf either expr or pat is NULL, the result is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (304,41,'LINEFROMTEXT','LineFromText(wkt[, srid]), LineStringFromText(wkt[, srid])\n\nST_LineFromText(), ST_LineStringFromText(), LineFromText(), and\nLineStringFromText() are synonyms. For more information, see the\ndescription of ST_LineFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (305,40,'LINEFROMWKB','LineFromWKB(wkb[, srid]), LineStringFromWKB(wkb[, srid])\n\nST_LineFromWKB(), ST_LineStringFromWKB(), LineFromWKB(), and\nLineStringFromWKB() are synonyms. For more information, see the\ndescription of ST_LineFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (306,17,'LINESTRING','LineString(pt [, pt] ...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (307,29,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0.0E0, the function returns NULL and (as\nof MySQL 5.7.4) a warning "Invalid argument for logarithm" is reported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n -> 0.69314718055995\nmysql> SELECT LN(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (308,9,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number {LINES | ROWS}]\n [(col_name_or_user_var\n [, col_name_or_user_var] ...)]\n [SET col_name={expr | DEFAULT},\n [, col_name={expr | DEFAULT}] ...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. LOAD DATA INFILE is the complement of SELECT ...\nINTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.7/en/select-into.html.) To write data\nfrom a table to a file, use SELECT ... INTO OUTFILE. To read the file\nback into a table, use LOAD DATA INFILE. The syntax of the FIELDS and\nLINES clauses is the same for both statements.\n\nYou can also load data files by using the mysqlimport utility; see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysqlimport.html. mysqlimport\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-optimization.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/load-data.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (309,2,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [PARTITION (partition_list | ALL)]\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise.\n\nLOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.7, it\nis also supported for partitioned MyISAM tables; in addition, indexes\non partitioned tables can be preloaded for one, several, or all\npartitions.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nIGNORE LEAVES is also supported for partitioned MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/load-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (310,9,'LOAD XML','Syntax:\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'\']\n [IGNORE number {LINES | ROWS}]\n [(field_name_or_user_var\n [, field_name_or_user_var] ...)]\n [SET col_name={expr | DEFAULT},\n [, col_name={expr | DEFAULT}] ...]\n\nThe LOAD XML statement reads data from an XML file into a table. The\nfile_name must be given as a literal string. The tagname in the\noptional ROWS IDENTIFIED BY clause must also be given as a literal\nstring, and must be surrounded by angle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML\noutput mode (that is, starting the client with the --xml option). To\nwrite data from a table to an XML file, you can invoke the mysql client\nwith the --xml and -e options from the system shell, as shown here:\n\nshell> mysql --xml -e \'SELECT * FROM mydb.mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default,\nthe element is considered to be the equivalent of a database\ntable row; this can be changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\no Column names as attributes and column values as attribute values:\n\n\n\no Column names as tags and column values as the content of these tags:\n\n\n value1\n value2\n\n\no Column names are the name attributes of tags, and values are\n the contents of these tags:\n\n\n value1\n value2\n\n\n This is the format used by other MySQL tools, such as mysqldump.\n\nAll three formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it\ncorrectly. Tags are matched based on the tag or attribute name and the\ncolumn name.\n\nThe following clauses work essentially the same way for LOAD XML as\nthey do for LOAD DATA:\n\no LOW_PRIORITY or CONCURRENT\n\no LOCAL\n\no REPLACE or IGNORE\n\no CHARACTER SET\n\no SET\n\nSee [HELP LOAD DATA], for more information about these clauses.\n\n(field_name_or_user_var, ...) is a list of one or more comma-separated\nXML fields or user variables. The name of a user variable used for this\npurpose must match the name of a field from the XML file, prefixed with\n@. You can use field names to select only desired fields. User\nvariables can be employed to store the corresponding field values for\nsubsequent re-use.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first\nnumber rows in the XML file to be skipped. It is analogous to the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/load-xml.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/load-xml.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (311,35,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nThe character_set_filesystem system variable controls interpretation of\nfile names that are given as literal strings.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> UPDATE t\n SET blob_col=LOAD_FILE(\'/tmp/picture\')\n WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (312,11,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME([fsp])\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (313,11,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP([fsp])\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (314,35,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str. Returns NULL if substr\nor str is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n -> 7\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (315,37,'LOCK','Syntax:\nLOCK TABLES\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type: {\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n}\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail in\nhttp://dev.mysql.com/doc/refman/5.7/en/lock-tables.html#lock-tables-res\ntrictions.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/lock-tables.html#lock-tables-and\n-triggers.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession. LOCK TABLES implicitly releases any table locks held by the\ncurrent session before acquiring new locks.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/lock-tables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (316,29,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0.0E0, the function\nreturns NULL and (as of MySQL 5.7.4) a warning "Invalid argument for\nlogarithm" is reported.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n -> 0.69314718055995\nmysql> SELECT LOG(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (317,29,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X. If X is less than or equal to\n0.0E0, the function returns NULL and (as of MySQL 5.7.4) a warning\n"Invalid argument for logarithm" is reported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n -> 0.30102999566398\nmysql> SELECT LOG10(100);\n -> 2\nmysql> SELECT LOG10(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (318,29,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X. If X is less than or equal to 0.0E0,\nthe function returns NULL and (as of MySQL 5.7.4) a warning "Invalid\nargument for logarithm" is reported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n -> 16\nmysql> SELECT LOG2(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (319,10,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 − 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a 4-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (320,10,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 − 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\n4-byte length prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (321,5,'LOOP','Syntax:\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is terminated. Usually,\nthis is accomplished with a LEAVE statement. Within a stored function,\nRETURN can also be used, which exits the function entirely.\n\nNeglecting to include a loop-termination statement results in an\ninfinite loop.\n\nA LOOP statement can be labeled. For the rules regarding label use, see\n[HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/loop.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND;\n','http://dev.mysql.com/doc/refman/5.7/en/loop.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (322,35,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York | new york |\n+-------------+-----------------------------------+\n\nFor collations of Unicode character sets, LOWER() and UPPER() work\naccording to the Unicode Collation Algorithm (UCA) version in the\ncollation name, if there is one, and UCA 4.0.0 if no version is\nspecified. For example, utf8_unicode_520_ci works according to UCA\n5.2.0, whereas utf8_unicode_ci works according to UCA 4.0.0. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-unicode-sets.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (323,35,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (324,35,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT LTRIM(\' barbar\');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (325,11,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (326,11,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nThe second argument can have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (327,35,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ,\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n -> \'\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (328,28,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout][,channel])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nOn a multithreaded slave, the function waits until expiry of the limit\nset by the slave_checkpoint_group or slave_checkpoint_period system\nvariable, when the checkpoint operation is called to update the status\nof the slave. Depending on the setting for the system variables, the\nfunction might therefore return some time after the specified position\nwas reached.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nThe optional channel value enables you to name which replication\nchannel the function applies to. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (329,35,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with InnoDB or MyISAM tables, and\n can be created only for CHAR, VARCHAR, or TEXT columns.\n\no As of MySQL 5.7.6, MySQL provides a built-in full-text ngram parser\n that supports Chinese, Japanese, and Korean (CJK), and an installable\n MeCab full-text parser plugin for Japanese. Parsing differences are\n outlined in\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-search-ngram.html,\n and\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-search-mecab.html.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n statement when a table is created, or added later using ALTER TABLE\n or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n that has no FULLTEXT index and then create the index after that, than\n to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a string value that is constant during query evaluation.\nThis rules out, for example, a table column because that can differ for\neach row.\n\nThere are three types of full-text searches:\n\no A natural language search interprets the search string as a phrase in\n natural human language (a phrase in free text). There are no special\n operators, with the exception of double quote (") characters. The\n stopword list applies. For more information about stopword lists, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-stopwords.html.\n\n Full-text searches are natural language searches if the IN NATURAL\n LANGUAGE MODE modifier is given or if no modifier is given. For more\n information, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-natural-language.html\n .\n\no A boolean search interprets the search string using the rules of a\n special query language. The string contains the words to search for.\n It can also contain operators that specify requirements such that a\n word must be present or absent in matching rows, or that it should be\n weighted higher or lower than usual. Certain common words (stopwords)\n are omitted from the search index and do not match if present in the\n search string. The IN BOOLEAN MODE modifier specifies a boolean\n search. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html.\n\no A query expansion search is a modification of a natural language\n search. The search string is used to perform a natural language\n search. Then words from the most relevant rows returned by the search\n are added to the search string and the search is done again. The\n query returns the rows from the second search. The IN NATURAL\n LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n specifies a query expansion search. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE) AS score\n FROM articles WHERE MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n| 6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (330,14,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nIf there are no matching rows, MAX() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (331,27,'MBR DEFINITION','Its MBR (minimum bounding rectangle), or envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.7/en/gis-class-geometry.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (332,27,'MBRCONTAINS','MBRContains(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\ncontains the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRWithin(@g2,@g1);\n+----------------------+--------------------+\n| MBRContains(@g1,@g2) | MBRWithin(@g2,@g1) |\n+----------------------+--------------------+\n| 1 | 1 |\n+----------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (333,27,'MBRCOVEREDBY','MBRCoveredBy(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\nis covered by the minimum bounding rectangle of g2. This tests the\nopposite relationship as MBRCovers().\n\nMBRCoveredBy() handles its arguments as follows:\n\no If either argument is NULL or an empty geometry, the return value is\n NULL.\n\no If either argument is not a syntactically well-formed geometry byte\n string, an ER_GIS_INVALID_DATA error occurs.\n\no Otherwise, the return value is non-NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRCovers(@g1,@g2), MBRCoveredby(@g1,@g2);\n+--------------------+-----------------------+\n| MBRCovers(@g1,@g2) | MBRCoveredby(@g1,@g2) |\n+--------------------+-----------------------+\n| 1 | 0 |\n+--------------------+-----------------------+\nmysql> SELECT MBRCovers(@g2,@g1), MBRCoveredby(@g2,@g1);\n+--------------------+-----------------------+\n| MBRCovers(@g2,@g1) | MBRCoveredby(@g2,@g1) |\n+--------------------+-----------------------+\n| 0 | 1 |\n+--------------------+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (334,27,'MBRCOVERS','MBRCovers(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\ncovers the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRCoveredBy(). See the description of MBRCoveredBy()\nfor examples.\n\nMBRCovers() handles its arguments as follows:\n\no If either argument is NULL or an empty geometry, the return value is\n NULL.\n\no If either argument is not a syntactically well-formed geometry byte\n string, an ER_GIS_INVALID_DATA error occurs.\n\no Otherwise, the return value is non-NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (335,27,'MBRDISJOINT','MBRDisjoint(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (336,27,'MBREQUAL','MBREqual(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (337,27,'MBREQUALS','MBREquals(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (338,27,'MBRINTERSECTS','MBRIntersects(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (339,27,'MBROVERLAPS','MBROverlaps(g1, g2)\n\nTwo geometries spatially overlap if they intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nThis function returns 1 or 0 to indicate whether the minimum bounding\nrectangles of the two geometries g1 and g2 overlap.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (340,27,'MBRTOUCHES','MBRTouches(g1, g2)\n\nTwo geometries spatially touch if their interiors do not intersect, but\nthe boundary of one of the geometries intersects either the boundary or\nthe interior of the other.\n\nThis function returns 1 or 0 to indicate whether the minimum bounding\nrectangles of the two geometries g1 and g2 touch.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (341,27,'MBRWITHIN','MBRWithin(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\nis within the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (342,12,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a string of 32 hexadecimal digits, or NULL if the argument\nwas NULL. The return value can, for example, be used as a hash key. See\nthe notes at the beginning of this section about storing hash values\nefficiently.\n\nThe return value is a string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (343,10,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 − 1) bytes.\nEach MEDIUMBLOB value is stored using a 3-byte length prefix that\nindicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (344,10,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (345,10,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 − 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. Each MEDIUMTEXT value is stored using a 3-byte\nlength prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (346,34,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column data types and\nindex information. You cannot merge MyISAM tables in which the columns\nare listed in a different order, do not have exactly the same data\ntypes in corresponding columns, or have the indexes in different order.\nHowever, any or all of the MyISAM tables can be compressed with\nmyisampack. See http://dev.mysql.com/doc/refman/5.7/en/myisampack.html.\nDifferences between tables such as these do not matter:\n\no Names of corresponding columns and indexes can differ.\n\no Comments for tables, columns, and indexes can differ.\n\no Table options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS can\n differ.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n -> a INT NOT NULL AUTO_INCREMENT,\n -> message CHAR(20), INDEX(a))\n -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.7/en/merge-storage-engine.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (347,11,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n -> 123456\nmysql> SELECT MICROSECOND(\'2019-12-31 23:59:59.000010\');\n -> 10\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (348,35,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (349,14,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nIf there are no matching rows, MIN() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n FROM student\n GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (350,11,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (351,41,'MLINEFROMTEXT','MLineFromText(wkt[, srid]), MultiLineStringFromText(wkt[, srid])\n\nST_MLineFromText(), ST_MultiLineStringFromText(), MLineFromText(), and\nMultiLineStringFromText() are synonyms. For more information, see the\ndescription of ST_MLineFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (352,40,'MLINEFROMWKB','MLineFromWKB(wkb[, srid]), MultiLineStringFromWKB(wkb[, srid])\n\nST_MLineFromWKB(), ST_MultiLineStringFromWKB(), MLineFromWKB(), and\nMultiLineStringFromWKB() are synonyms. For more information, see the\ndescription of ST_MLineFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (353,29,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (354,11,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (355,11,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.7/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n -> \'February\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (356,41,'MPOINTFROMTEXT','MPointFromText(wkt[, srid]), MultiPointFromText(wkt[, srid])\n\nST_MPointFromText(), ST_MultiPointFromText(), MPointFromText(), and\nMultiPointFromText() are synonyms. For more information, see the\ndescription of ST_MPointFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (357,40,'MPOINTFROMWKB','MPointFromWKB(wkb[, srid]), MultiPointFromWKB(wkb[, srid])\n\nST_MPointFromWKB(), ST_MultiPointFromWKB(), MPointFromWKB(), and\nMultiPointFromWKB() are synonyms. For more information, see the\ndescription of ST_MPointFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (358,41,'MPOLYFROMTEXT','MPolyFromText(wkt[, srid]), MultiPolygonFromText(wkt[, srid])\n\nST_MPolyFromText(), ST_MultiPolygonFromText(), MPolyFromText(), and\nMultiPolygonFromText() are synonyms. For more information, see the\ndescription of ST_MPolyFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (359,40,'MPOLYFROMWKB','MPolyFromWKB(wkb[, srid]), MultiPolygonFromWKB(wkb[, srid])\n\nST_MPolyFromWKB(), ST_MultiPolygonFromWKB(), MPolyFromWKB(), and\nMultiPolygonFromWKB() are synonyms. For more information, see the\ndescription of ST_MPolyFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (360,17,'MULTILINESTRING','MultiLineString(ls [, ls] ...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (361,17,'MULTIPOINT','MultiPoint(pt [, pt2] ...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (362,17,'MULTIPOLYGON','MultiPolygon(poly [, poly] ...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (363,28,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (364,4,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (365,4,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (366,35,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (367,35,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/regexp.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (368,11,'NOW','Syntax:\nNOW([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context. The value is expressed in the current time\nzone.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (369,7,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nThe return value has the same type as the first argument.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (370,20,'NUMGEOMETRIES','NumGeometries(gc)\n\nST_NumGeometries() and NumGeometries() are synonyms. For more\ninformation, see the description of ST_NumGeometries().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (371,32,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nST_NumInteriorRings() and NumInteriorRings() are synonyms. For more\ninformation, see the description of ST_NumInteriorRings().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (372,24,'NUMPOINTS','NumPoints(ls)\n\nST_NumPoints() and NumPoints() are synonyms. For more information, see\nthe description of ST_NumPoints().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (373,35,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT OCT(12);\n -> \'14\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (374,35,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (375,12,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added when the implementation of PASSWORD() was\nchanged in MySQL 4.1 to improve security. OLD_PASSWORD() returned the\nvalue of the pre-4.1 implementation of PASSWORD() as a string, and was\nintended to permit you to reset passwords for any pre-4.1 clients that\nneed to connect to your MySQL server without locking them out. See\nhttp://dev.mysql.com/doc/refman/5.7/en/password-hashing.html.\n\nPasswords that use the pre-4.1 hashing method are less secure than\npasswords that use the native password hashing method. Support for\npre-4.1 passwords was removed in MySQL 5.7.5, as was OLD_PASSWORD().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (376,5,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.7/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/open.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (377,36,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n\nOPTIMIZE TABLE reorganizes the physical storage of table data and\nassociated index data, to reduce storage space and improve I/O\nefficiency when accessing the table. The exact changes made to each\ntable depend on the storage engine used by that table.\n\nUse OPTIMIZE TABLE in these cases, depending on the type of table:\n\no After doing substantial insert, update, or delete operations on an\n InnoDB table that has its own .ibd file because it was created with\n the innodb_file_per_table option enabled. The table and indexes are\n reorganized, and disk space can be reclaimed for use by the operating\n system.\n\no After doing substantial insert, update, or delete operations on\n columns that are part of a FULLTEXT index in an InnoDB table. Set the\n configuration option innodb_optimize_fulltext_only=1 first. To keep\n the index maintenance period to a reasonable time, set the\n innodb_ft_num_word_optimize option to specify how many words to\n update in the search index, and run a sequence of OPTIMIZE TABLE\n statements until the search index is fully updated.\n\no After deleting a large part of a MyISAM or ARCHIVE table, or making\n many changes to a MyISAM or ARCHIVE table with variable-length rows\n (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted\n rows are maintained in a linked list and subsequent INSERT operations\n reuse old row positions. You can use OPTIMIZE TABLE to reclaim the\n unused space and to defragment the data file. After extensive changes\n to a table, this statement may also improve performance of statements\n that use the table, sometimes significantly.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nOPTIMIZE TABLE works for InnoDB, MyISAM, and ARCHIVE tables. OPTIMIZE\nTABLE is also supported for dynamic columns of in-memory NDB tables. It\ndoes not work for fixed-width columns of in-memory tables, nor does it\nwork for Disk Data tables. The performance of OPTIMIZE on NDB Cluster\ntables can be tuned using --ndb_optimization_delay, which controls the\nlength of time to wait between processing batches of rows by OPTIMIZE\nTABLE. For more information, see Previous NDB Cluster Issues Resolved\nin NDB Cluster 7.3\n(http://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-limitations-resol\nved.html).\n\nFor NDB Cluster tables, OPTIMIZE TABLE can be interrupted by (for\nexample) killing the SQL thread performing the OPTIMIZE operation.\n\nBy default, OPTIMIZE TABLE does not work for tables created using any\nother storage engine and returns a result indicating this lack of\nsupport. You can make OPTIMIZE TABLE work for other storage engines by\nstarting mysqld with the --skip-new option. In this case, OPTIMIZE\nTABLE is just mapped to ALTER TABLE.\n\nThis statement does not work with views.\n\nOPTIMIZE TABLE is supported for partitioned tables. For information\nabout using this statement with partitioned tables and table\npartitions, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-maintenance.html.\n\nBy default, the server writes OPTIMIZE TABLE statements to the binary\nlog so that they replicate to replication slaves. To suppress logging,\nspecify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/optimize-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (378,26,'OR','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT 1 OR 1;\n -> 1\nmysql> SELECT 1 OR 0;\n -> 1\nmysql> SELECT 0 OR 0;\n -> 0\nmysql> SELECT 0 OR NULL;\n -> NULL\nmysql> SELECT 1 OR NULL;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (379,35,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multibyte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 256^2) ...\n\nIf the leftmost character is not a multibyte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (380,27,'OVERLAPS','Overlaps(g1, g2)\n\nMBROverlaps() and Overlaps() are synonyms. For more information, see\nthe description of MBROverlaps().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (381,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\n*Note*:\n\nThis function is deprecated as of MySQL 5.7.6 and will be removed in a\nfuture MySQL release.\n\nReturns a hashed password string calculated from the cleartext password\nstr. The return value is a string in the connection character set, or\nNULL if the argument is NULL. This function is the SQL interface to the\nalgorithm used by the server to encrypt MySQL passwords for storage in\nthe mysql.user grant table.\n\nThe old_passwords system variable controls the password hashing method\nused by the PASSWORD() function. It also influences password hashing\nperformed by CREATE USER and GRANT statements that specify a password\nusing an IDENTIFIED BY clause.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (382,11,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM. Note that the period argument P is not a\ndate value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n -> 200803\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (383,11,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n -> 11\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (384,29,'PI','Syntax:\nPI()\n\nReturns the value of π (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (385,17,'POINT','Point(x, y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (386,41,'POINTFROMTEXT','PointFromText(wkt[, srid])\n\nST_PointFromText() and PointFromText() are synonyms. For more\ninformation, see the description of ST_PointFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (387,40,'POINTFROMWKB','PointFromWKB(wkb[, srid])\n\nST_PointFromWKB() and PointFromWKB() are synonyms. For more\ninformation, see the description of ST_PointFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (388,24,'POINTN','PointN(ls, N)\n\nST_PointN() and PointN() are synonyms. For more information, see the\ndescription of ST_PointN().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (389,41,'POLYFROMTEXT','PolyFromText(wkt[, srid]), PolygonFromText(wkt[, srid])\n\nST_PolyFromText(), ST_PolygonFromText(), PolyFromText(), and\nPolygonFromText() are synonyms. For more information, see the\ndescription of ST_PolyFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (390,40,'POLYFROMWKB','PolyFromWKB(wkb[, srid]), PolygonFromWKB(wkb[, srid])\n\nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB(), and\nPolygonFromWKB() are synonyms. For more information, see the\ndescription of ST_PolyFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (391,17,'POLYGON','Polygon(ls [, ls] ...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (392,35,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (393,29,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n -> 4\nmysql> SELECT POW(2,-2);\n -> 0.25\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (394,29,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (395,37,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a SQL statement and assigns it a name,\nstmt_name, by which to refer to the statement later. The prepared\nstatement is executed with EXECUTE and released with DEALLOCATE\nPREPARE. For examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.h\ntml.\n\nStatement names are not case-sensitive. preparable_stmt is either a\nstring literal or a user variable that contains the text of the SQL\nstatement. The text must represent a single statement, not multiple\nstatements. Within the statement, ? characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query\nlater when you execute it. The ? characters should not be enclosed\nwithin quotation marks, even if you intend to bind them to string\nvalues. Parameter markers can be used only where data values should\nappear, not for SQL keywords, identifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nThe scope of a prepared statement is the session within which it is\ncreated, which as several implications:\n\no A prepared statement created in one session is not available to other\n sessions.\n\no When a session ends, whether normally or abnormally, its prepared\n statements no longer exist. If auto-reconnect is enabled, the client\n is not notified that the connection was lost. For this reason,\n clients may wish to disable auto-reconnect. See\n http://dev.mysql.com/doc/refman/5.7/en/c-api-auto-reconnect.html.\n\no A prepared statement created within a stored program continues to\n exist after the program finishes executing and can be executed\n outside the program later.\n\no A statement prepared in stored program context cannot refer to stored\n procedure or function parameters or local variables because they go\n out of scope when the program ends and would be unavailable were the\n statement to be executed later outside the program. As a workaround,\n refer instead to user-defined variables, which also have session\n scope; see\n http://dev.mysql.com/doc/refman/5.7/en/user-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/prepare.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (396,33,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\n*Note*:\n\nPROCEDURE ANALYSE() is deprecated as of MySQL 5.7.18, and is removed in\nMySQL 8.0.\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nA PROCEDURE clause is not permitted in a UNION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/procedure-analyse.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (397,37,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.7/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.7/en/purge-binary-logs.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (398,11,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (399,35,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotation marks and with each instance of backslash (\\),\nsingle quote (\'), ASCII NUL, and Control+Z preceded by a backslash. If\nthe argument is NULL, the return value is the word "NULL" without\nenclosing single quotation marks.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (400,29,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians. (Note that\nπ radians equals 180 degrees.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (401,29,'RAND','Syntax:\nRAND([N])\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. To\nobtain a random integer R in the range i <= R < j, use the expression\nFLOOR(i + RAND() * (j − i)). For example, to obtain a random integer\nin the range the range 7 <= R < 12, use the following statement:\n\nSELECT FLOOR(7 + (RAND() * 5));\n\nIf an integer argument N is specified, it is used as the seed value:\n\no With a constant initializer argument, the seed is initialized once\n when the statement is prepared, prior to execution.\n\no With a nonconstant initializer argument (such as a column name), the\n seed is initialized with the value for each invocation of RAND().\n\nOne implication of this behavior is that for equal argument values,\nRAND(N) returns the same value each time, and thus produces a\nrepeatable sequence of column values. In the following example, the\nsequence of values produced by RAND(3) is the same both places it\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (402,12,'RANDOM_BYTES','Syntax:\nRANDOM_BYTES(len)\n\nThis function returns a binary string of len random bytes generated\nusing the random number generator of the SSL library. Permitted values\nof len range from 1 to 1024. For values outside that range,\nRANDOM_BYTES() generates a warning and returns NULL.\n\nRANDOM_BYTES() can be used to provide the initialization vector for the\nAES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len\nmust be at least 16. Larger values are permitted, but bytes in excess\nof 16 are ignored.\n\nRANDOM_BYTES() generates a random value, which makes its result\nnondeterministic. Consequently, statements that use this function are\nunsafe for statement-based replication and cannot be stored in the\nquery cache.\n\nThis function is available as of MySQL 5.7.4.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (403,35,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nReturns 1 if the string expr matches the regular expression specified\nby the pattern pat, 0 otherwise. If either expr or pat is NULL, the\nreturn value is NULL.\n\nRLIKE is a synonym for REGEXP.\n\nThe pattern can be an extended regular expression, the syntax for which\nis discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/regexp.html#regexp-syntax. The\npattern need not be a literal string. For example, it can be specified\nas a string expression or table column.\n\n*Note*:\n\nBecause MySQL uses the C escape syntax in strings (for example, \\n to\nrepresent the newline character), you must double any \\ that you use in\nyour REGEXP arguments.\n\nRegular expression operations use the character set and collation of\nthe string expression and pattern arguments when deciding the type of a\ncharacter and performing the comparison. If the arguments have\ndifferent character sets or collations, coercibility rules apply as\ndescribed in\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-collation-coercibility.h\ntml. If either argument is a binary string, the arguments are handled\nin case-sensitive fashion as binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/regexp.html\n\n','mysql> SELECT \'Michael!\' REGEXP \'.*\';\n+------------------------+\n| \'Michael!\' REGEXP \'.*\' |\n+------------------------+\n| 1 |\n+------------------------+\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n+---------------------------------------+\n| \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\' |\n+---------------------------------------+\n| 0 |\n+---------------------------------------+\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n+---------------------+\n| \'a\' REGEXP \'^[a-d]\' |\n+---------------------+\n| 1 |\n+---------------------+\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n+----------------+-----------------------+\n| \'a\' REGEXP \'A\' | \'a\' REGEXP BINARY \'A\' |\n+----------------+-----------------------+\n| 1 | 0 |\n+----------------+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/regexp.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (404,25,'RELEASE_ALL_LOCKS','Syntax:\nRELEASE_ALL_LOCKS()\n\nReleases all named locks held by the current session and returns the\nnumber of locks released (0 if there were none)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (405,25,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/locking-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (406,8,'RENAME TABLE','Syntax:\nRENAME TABLE\n tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nRENAME TABLE renames one or more tables. You must have ALTER and DROP\nprivileges for the original table, and CREATE and INSERT privileges for\nthe new table.\n\nFor example, to rename a table named old_table to to new_table, use\nthis statement:\n\nRENAME TABLE old_table TO new_table;\n\nThat statement is equivalent to the following ALTER TABLE statement:\n\nALTER TABLE old_table RENAME new_table;\n\nRENAME TABLE, unlike ALTER TABLE, can rename multiple tables within a\nsingle statement:\n\nRENAME TABLE old_table1 TO new_table1,\n old_table2 TO new_table2,\n old_table3 TO new_table3;\n\nRenaming operations are performed left to right. Thus, to swap two\ntable names, do this (assuming that a table with the intermediary name\ntmp_table does not already exist):\n\nRENAME TABLE old_table TO tmp_table,\n new_table TO old_table,\n tmp_table TO new_table;\n\nMetadata locks on tables are acquired in name order, which in some\ncases can make a difference in operation outcome when multiple\ntransactions execute concurrently. See\nhttp://dev.mysql.com/doc/refman/5.7/en/metadata-locking.html.\n\nTo execute RENAME TABLE, there must be no active transactions or tables\nlocked with LOCK TABLES. With the transaction table locking conditions\nsatisfied, the rename operation is done atomically; no other session\ncan access any of the tables while the rename is in progress.\n\nIf any errors occur during a RENAME TABLE, the statement fails and no\nchanges are made.\n\nYou can use RENAME TABLE to move a table from one database to another:\n\nRENAME TABLE current_db.tbl_name TO other_db.tbl_name;\n\nUsing this method to move all tables from one database to a different\none in effect renames the database (an operation for which MySQL has no\nsingle statement), except that the original database continues to\nexist, albeit with no tables.\n\nLike RENAME TABLE, ALTER TABLE ... RENAME can also be used to move a\ntable to a different database. Regardless of the statement used, if the\nrename operation would move the table to a database located on a\ndifferent file system, the success of the outcome is platform specific\nand depends on the underlying operating system calls used to move table\nfiles.\n\nIf a table has triggers, attempts to rename the table into a different\ndatabase fail with a Trigger in wrong schema (ER_TRG_IN_WRONG_SCHEMA)\nerror.\n\nTo rename TEMPORARY tables, RENAME TABLE does not work. Use ALTER TABLE\ninstead.\n\nRENAME TABLE works for views, except that views cannot be renamed into\na different database.\n\nAny privileges granted specifically for a renamed table or view are not\nmigrated to the new name. They must be changed manually.\n\nRENAME TABLE changes internally generated foreign key constraint names\nand user-defined foreign key constraint names that contain the string\n"tbl_name_ibfk_" to reflect the new table name. InnoDB interprets\nforeign key constraint names that contain the string "tbl_name_ibfk_"\nas internally generated names.\n\nForeign key constraint names that point to the renamed table are\nautomatically updated unless there is a conflict, in which case the\nstatement fails with an error. A conflict occurs if the renamed\nconstraint name already exists. In such cases, you must drop and\nre-create the foreign keys for them to function properly.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/rename-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/rename-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (407,1,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. An error\noccurs for old accounts that do not exist or new accounts that already\nexist.\n\nTo use RENAME USER, you must have the global CREATE USER privilege, or\nthe UPDATE privilege for the mysql system database. When the read_only\nsystem variable is enabled, RENAME USER additionally requires the SUPER\nprivilege.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nRENAME USER \'jeffrey\'@\'localhost\' TO \'jeff\'@\'127.0.0.1\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nRENAME USER causes the privileges held by the old user to be those held\nby the new user. However, RENAME USER does not automatically drop or\ninvalidate databases or objects within them that the old user created.\nThis includes stored programs or views for which the DEFINER attribute\nnames the old user. Attempts to access such objects may produce an\nerror if they execute in definer security context. (For information\nabout security context, see\nhttp://dev.mysql.com/doc/refman/5.7/en/stored-programs-security.html.)\n\nThe privilege changes take effect as indicated in\nhttp://dev.mysql.com/doc/refman/5.7/en/privilege-changes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/rename-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (408,36,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL]\n TABLE tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table, for certain storage\nengines only.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nAlthough normally you should never have to run REPAIR TABLE, if\ndisaster strikes, this statement is very likely to get back all your\ndata from a MyISAM table. If your tables become corrupted often, try to\nfind the reason for it, to eliminate the need to use REPAIR TABLE. See\nhttp://dev.mysql.com/doc/refman/5.7/en/crashing.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/myisam-table-problems.html.\n\nREPAIR TABLE checks the table to see whether an upgrade is required. If\nso, it performs the upgrade, following the same rules as CHECK TABLE\n... FOR UPGRADE. See [HELP CHECK TABLE], for more information.\n\n*Important*:\n\no Make a backup of a table before performing a table repair operation;\n under some circumstances the operation might cause data loss.\n Possible causes include but are not limited to file system errors.\n See http://dev.mysql.com/doc/refman/5.7/en/backup-and-recovery.html.\n\no If the server crashes during a REPAIR TABLE operation, it is\n essential after restarting it that you immediately execute another\n REPAIR TABLE statement for the table before performing any other\n operations on it. In the worst case, you might have a new clean index\n file without information about the data file, and then the next\n operation you perform could overwrite the data file. This is an\n unlikely but possible scenario that underscores the value of making a\n backup first.\n\no In the event that a table on the master becomes corrupted and you run\n REPAIR TABLE on it, any resulting changes to the original table are\n not propagated to slaves.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/repair-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (409,35,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (410,5,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n BEGIN\n SET @x = 0;\n REPEAT\n SET @x = @x + 1;\n UNTIL @x > p1 END REPEAT;\n END\n //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/repeat.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (411,9,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n {VALUES | VALUE} (value_list) [, (value_list)] ...\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n SET assignment_list\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name [, partition_name] ...)]\n [(col_name [, col_name] ...)]\n SELECT ...\n\nvalue:\n {expr | DEFAULT}\n\nvalue_list:\n value [, value] ...\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL---that\neither inserts or updates---see\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html.\n\nDELAYED inserts and replaces were deprecated in MySQL 5.6. In MySQL\n5.7, DELAYED is not supported. The server recognizes but ignores the\nDELAYED keyword, handles the replace as a nondelayed replace, and\ngenerates an ER_WARN_LEGACY_SYNTAX_CONVERTED warning. ("REPLACE DELAYED\nis no longer supported. The statement was converted to REPLACE.") The\nDELAYED keyword will be removed in a future release.\n\n*Note*:\n\nREPLACE makes sense only if a table has a PRIMARY KEY or UNIQUE index.\nOtherwise, it becomes equivalent to INSERT, because there is no index\nto be used to determine whether a new row duplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nIf a generated column is replaced explicitly, the only permitted value\nis DEFAULT. For information about generated columns, see\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.h\ntml.\n\nREPLACE supports explicit partition selection using the PARTITION\nkeyword with a list of comma-separated names of partitions,\nsubpartitions, or both. As with INSERT, if it is not possible to insert\nthe new row into any of these partitions or subpartitions, the REPLACE\nstatement fails with the error Found a row not matching the given\npartition set. For more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/replace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (412,35,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (413,2,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nreset_option: {\n MASTER\n | QUERY CACHE\n | SLAVE\n}\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nThe RESET statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nThe following list describes the permitted RESET statement reset_option\nvalues:\n\no RESET MASTER\n\n Deletes all binary logs listed in the index file, resets the binary\n log index file to be empty, and creates a new binary log file.\n\no RESET QUERY CACHE\n\n Removes all query results from the query cache.\n\n *Note*:\n\n The query cache is deprecated as of MySQL 5.7.20, and is removed in\n MySQL 8.0. Deprecation includes RESET QUERY CACHE.\n\no RESET SLAVE\n\n Makes the slave forget its replication position in the master binary\n logs. Also resets the relay log by deleting any existing relay log\n files and beginning a new one.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/reset.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (414,37,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\n\n*Warning*:\n\nUse this statement with caution to ensure you do not lose binary log\nfile data.\n\nRESET MASTER also clears the values of the gtid_purged system variable\nas well as the global value of the gtid_executed system variable (but\nnot its session value); that is, executing this statement sets each of\nthese values to an empty string (\'\'). In MySQL 5.7.5 and later, this\nstatement also clears the mysql.gtid_executed table (see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html#\nreplication-gtids-gtid-executed-table).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/reset-master.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (415,37,'RESET SLAVE','Syntax:\nRESET SLAVE [ALL] [channel_option]\n\nchannel_option:\n FOR CHANNEL channel\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It clears the master info and relay log info repositories,\ndeletes all the relay log files, and starts a new relay log file. It\nalso resets to 0 the replication delay specified with the MASTER_DELAY\noption to CHANGE MASTER TO. RESET SLAVE does not change the values of\ngtid_executed or gtid_purged.\n\n*Note*:\n\nAll relay log files are deleted, even if they have not been completely\nexecuted by the slave SQL thread. (This is a condition likely to exist\non a replication slave if you have issued a STOP SLAVE statement or if\nthe slave is highly loaded.)\n\nTo use RESET SLAVE, the slave replication threads must be stopped, so\non a running slave use STOP SLAVE before issuing RESET SLAVE. To use\nRESET SLAVE on a Group Replication group member, the member status must\nbe OFFLINE, meaning that the plugin is loaded but the member does not\ncurrently belong to any group. A group member can be taken offline by\nusing a STOP GROUP REPLICATION statement.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the RESET SLAVE statement to a specific\nreplication channel. Combining a FOR CHANNEL channel clause with the\nALL option deletes the specified channel. If no channel is named and no\nextra channels exist, the statement applies to the default channel.\nIssuing a RESET SLAVE ALL statement without a FOR CHANNEL channel\nclause when multiple replication channels exist deletes all replication\nchannels and recreates only the default channel. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nRESET SLAVE does not change any replication connection parameters such\nas master host, master port, master user, or master password.\n\no From MySQL 5.7.24, when master_info_repository=TABLE is set on the\n server, replication connection parameters are preserved in the\n crash-safe InnoDB table mysql.slave_master_info as part of the RESET\n SLAVE operation. They are also retained in memory. In the event of a\n server crash or deliberate restart after issuing RESET SLAVE but\n before issuing START SLAVE, the replication connection parameters are\n retrieved from the table and reused for the new connection.\n\no When master_info_repository=FILE is set on the server (which is the\n default in MySQL 5.7), replication connection parameters are only\n retained in memory. If the slave mysqld is restarted immediately\n after issuing RESET SLAVE due to a server crash or deliberate\n restart, the connection parameters are lost. In that case, you must\n issue a CHANGE MASTER TO statement after the server start to\n respecify the connection parameters before issuing START SLAVE.\n\nIf you want to reset the connection parameters intentionally, you need\nto use RESET SLAVE ALL, which clears the connection parameters. In that\ncase, you must issue a CHANGE MASTER TO statement after the server\nstart to specify the new connection parameters.\n\nRESET SLAVE causes an implicit commit of an ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nIf the slave SQL thread was in the middle of replicating temporary\ntables when it was stopped, and RESET SLAVE is issued, these replicated\ntemporary tables are deleted on the slave.\n\nPrior to MySQL 5.7.5, RESET SLAVE also had the effect of resetting both\nthe heartbeat period (Slave_heartbeat_period) and\nSSL_VERIFY_SERVER_CERT. This issue is fixed in MySQL 5.7.5 and later.\n(Bug #18777899, Bug #18778485)\n\nPrior to MySQL 5.7.5, RESET SLAVE ALL did not clear the\nIGNORE_SERVER_IDS list set by CHANGE MASTER TO. In MySQL 5.7.5 and\nlater, the statement clears the list. (Bug #18816897)\n\n*Note*:\n\nWhen used on an NDB Cluster replication slave SQL node, RESET SLAVE\nclears the mysql.ndb_apply_status table. You should keep in mind when\nusing this statement that ndb_apply_status uses the NDB storage engine\nand so is shared by all SQL nodes attached to the slave cluster.\n\nYou can override this behavior by issuing SET GLOBAL\n@@ndb_clear_apply_status=OFF prior to executing RESET SLAVE, which\nkeeps the slave from purging the ndb_apply_status table in such cases.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/reset-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (416,5,'RESIGNAL','Syntax:\nRESIGNAL [condition_value]\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value: {\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n}\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name: {\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n}\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nRESIGNAL passes on the error condition information that is available\nduring execution of a condition handler within a compound statement\ninside a stored procedure or function, trigger, or event. RESIGNAL may\nchange some or all information before passing it on. RESIGNAL is\nrelated to SIGNAL, but instead of originating a condition as SIGNAL\ndoes, RESIGNAL relays existing condition information, possibly after\nmodifying it.\n\nRESIGNAL makes it possible to both handle an error and return the error\ninformation. Otherwise, by executing an SQL statement within the\nhandler, information that caused the handler\'s activation is destroyed.\nRESIGNAL also can make some procedures shorter if a given handler can\nhandle part of a situation, then pass the condition "up the line" to\nanother handler.\n\nNo privileges are required to execute the RESIGNAL statement.\n\nAll forms of RESIGNAL require that the current context be a condition\nhandler. Otherwise, RESIGNAL is illegal and a RESIGNAL when handler not\nactive error occurs.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/resignal.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/resignal.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (417,5,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\nThe LEAVE statement can be used to exit a stored program of those\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/return.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (418,35,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (419,1,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL [PRIVILEGES], GRANT OPTION\n FROM user [, user] ...\n\nREVOKE PROXY ON user\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts.\n\nWhen the read_only system variable is enabled, REVOKE requires the\nSUPER privilege in addition to any other required privileges described\nin the following discussion.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type, priv_level, and object_type values, and the syntax for\nspecifying users and passwords, see [HELP GRANT].\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege, or the UPDATE privilege for the mysql system database.\n\nUser accounts from which privileges are to be revoked must exist.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/revoke.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (420,35,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (421,29,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n -> -1\nmysql> SELECT ROUND(-1.58);\n -> -2\nmysql> SELECT ROUND(1.58);\n -> 2\nmysql> SELECT ROUND(1.298, 1);\n -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n -> 1\nmysql> SELECT ROUND(23.298, -1);\n -> 20\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (422,22,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nROW_COUNT() returns a value as follows:\n\no DDL statements: 0. This applies to statements such as CREATE TABLE or\n DROP TABLE.\n\no DML statements other than SELECT: The number of affected rows. This\n applies to statements such as UPDATE, INSERT, or DELETE (as before),\n but now also to statements such as ALTER TABLE and LOAD DATA INFILE.\n\no SELECT: -1 if the statement returns a result set, or the number of\n rows "affected" if it does not. For example, for SELECT * FROM t1,\n ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE\n \'file_name\', ROW_COUNT() returns the number of rows written to the\n file.\n\no SIGNAL statements: 0.\n\nFor UPDATE statements, the affected-rows value by default is the number\nof rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() when connecting to mysqld, the affected-rows value\nis the number of rows "found"; that is, matched by the WHERE clause.\n\nFor REPLACE statements, the affected-rows value is 2 if the new row\nreplaced an old row, because in this case, one row was inserted after\nthe duplicate was deleted.\n\nFor INSERT ... ON DUPLICATE KEY UPDATE statements, the affected-rows\nvalue per row is 1 if the row is inserted as a new row, 2 if an\nexisting row is updated, and 0 if an existing row is set to its current\nvalues. If you specify the CLIENT_FOUND_ROWS flag, the affected-rows\nvalue is 1 (not 0) if an existing row is set to its current values.\n\nThe ROW_COUNT() value is similar to the value from the\nmysql_affected_rows() C API function and the row count that the mysql\nclient displays following statement execution.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (423,35,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (424,35,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (425,37,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/savepoint.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (426,22,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (427,11,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (428,11,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (429,9,'SELECT','Syntax:\nSELECT\n [ALL | DISTINCT | DISTINCTROW ]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [FROM table_references\n [PARTITION partition_list]\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position}\n [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position}\n [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n export_options\n | INTO DUMPFILE \'file_name\'\n | INTO var_name [, var_name]]\n [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.7/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n rows. Its syntax is described in [HELP JOIN].\n\no SELECT supports explicit partition selection using the PARTITION with\n a list of partitions or subpartitions (or both) following the name of\n the table in a table_reference (see [HELP JOIN]). In this case, rows\n are selected only from the partitions listed, and any other\n partitions of the table are ignored. For more information and\n examples, see\n http://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\n SELECT ... PARTITION from tables using storage engines such as MyISAM\n that perform table-level locks (and thus partition locks) lock only\n the partitions or subpartitions named by the PARTITION option.\n\n For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-locki\n ng.html.\n\no The WHERE clause, if given, indicates the condition or conditions\n that rows must satisfy to be selected. where_condition is an\n expression that evaluates to true for each row to be selected. The\n statement selects all rows if there is no WHERE clause.\n\n In the WHERE expression, you can use any of the functions and\n operators that MySQL supports, except for aggregate (summary)\n functions. See\n http://dev.mysql.com/doc/refman/5.7/en/expressions.html, and\n http://dev.mysql.com/doc/refman/5.7/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/select.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (430,22,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (431,2,'SET','Syntax:\nSET variable = expr [, variable = expr] ...\n\nvariable: {\n user_var_name\n | param_name\n | local_var_name\n | {GLOBAL | @@GLOBAL.} system_var_name\n | [SESSION | @@SESSION. | @@] system_var_name\n}\n\nSET syntax for variable assignment enables you to assign values to\ndifferent types of variables that affect the operation of the server or\nclients:\n\no User-defined variables. See\n http://dev.mysql.com/doc/refman/5.7/en/user-variables.html.\n\no Stored procedure and function parameters, and stored program local\n variables. See\n http://dev.mysql.com/doc/refman/5.7/en/stored-program-variables.html.\n\no System variables. See\n http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n System variables also can be set at server startup, as described in\n http://dev.mysql.com/doc/refman/5.7/en/using-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-variable.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (432,2,'SET CHARACTER SET','Syntax:\nSET {CHARACTER SET | CHARSET}\n {\'charset_name\' | DEFAULT}\n\nThis statement maps all strings sent between the server and the current\nclient with the given mapping. SET CHARACTER SET sets three session\nsystem variables: character_set_client and character_set_results are\nset to the given character set, and character_set_connection to the\nvalue of character_set_database. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html.\n\ncharset_name may be quoted or unquoted.\n\nThe default character set mapping can be restored by using the value\nDEFAULT. The default depends on the server configuration.\n\nSome character sets cannot be used as the client character set.\nAttempting to use them with SET CHARACTER SET produces an error. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html#charset-\nconnection-impermissible-client-charset.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-character-set.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (433,10,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... SET\nvalues are represented internally as integers.\n\nA SET column can have a maximum of 64 distinct members. A table can\nhave no more than 255 unique element list definitions among its ENUM\nand SET columns considered as a group. For more information on this\nlimit, see http://dev.mysql.com/doc/refman/5.7/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (434,37,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-global-sql-slave-skip-counter.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (435,2,'SET NAMES','Syntax:\nSET NAMES {\'charset_name\'\n [COLLATE \'collation_name\'] | DEFAULT}\n\nThis statement sets the three session system variables\ncharacter_set_client, character_set_connection, and\ncharacter_set_results to the given character set. Setting\ncharacter_set_connection to charset_name also sets collation_connection\nto the default collation for charset_name. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html.\n\nThe optional COLLATE clause may be used to specify a collation\nexplicitly. If given, the collation must one of the permitted\ncollations for charset_name.\n\ncharset_name and collation_name may be quoted or unquoted.\n\nThe default mapping can be restored by using a value of DEFAULT. The\ndefault depends on the server configuration.\n\nSome character sets cannot be used as the client character set.\nAttempting to use them with SET NAMES produces an error. See\nhttp://dev.mysql.com/doc/refman/5.7/en/charset-connection.html#charset-\nconnection-impermissible-client-charset.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-names.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-names.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (436,1,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] = password_option\n\npassword_option: {\n \'auth_string\'\n | PASSWORD(\'auth_string\')\n}\n\nThe SET PASSWORD statement assigns a password to a MySQL user account.\n\'auth_string\' represents a cleartext (unencrypted) password.\n\n*Note*:\n\no SET PASSWORD ... = PASSWORD(\'auth_string\') syntax is deprecated as of\n MySQL 5.7.6 and will be removed in a future MySQL release.\n\no SET PASSWORD ... = \'auth_string\' syntax is not deprecated, but ALTER\n USER is the preferred statement for account alterations, including\n assigning passwords. For example:\n\nALTER USER user IDENTIFIED BY \'auth_string\';\n\n*Important*:\n\nUnder some circumstances, SET PASSWORD may be recorded in server logs\nor on the client side in a history file such as ~/.mysql_history, which\nmeans that cleartext passwords may be read by anyone having read access\nto that information. For information about the conditions under which\nthis occurs for the server logs and how to control it, see\nhttp://dev.mysql.com/doc/refman/5.7/en/password-logging.html. For\nsimilar information about client-side logging, see\nhttp://dev.mysql.com/doc/refman/5.7/en/mysql-logging.html.\n\nSET PASSWORD can be used with or without a FOR clause that explicitly\nnames a user account:\n\no With a FOR user clause, the statement sets the password for the named\n account, which must exist:\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = \'auth_string\';\n\no With no FOR user clause, the statement sets the password for the\n current user:\n\nSET PASSWORD = \'auth_string\';\n\n Any client who connects to the server using a nonanonymous account\n can change the password for that account. (In particular, you can\n change your own password.) To see which account the server\n authenticated you as, invoke the CURRENT_USER() function:\n\nSELECT CURRENT_USER();\n\nIf a FOR user clause is given, the account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.7/en/account-names.html.\nFor example:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = \'auth_string\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nSetting the password for a named account (with a FOR clause) requires\nthe UPDATE privilege for the mysql system database. Setting the\npassword for yourself (for a nonanonymous account with no FOR clause)\nrequires no special privileges. When the read_only system variable is\nenabled, SET PASSWORD requires the SUPER privilege in addition to any\nother required privileges.\n\nThe password can be specified in these ways:\n\no Use a string without PASSWORD()\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = \'password\';\n\n SET PASSWORD interprets the string as a cleartext string, passes it\n to the authentication plugin associated with the account, and stores\n the result returned by the plugin in the account row in the\n mysql.user system table. (The plugin is given the opportunity to hash\n the value into the encryption format it expects. The plugin may use\n the value as specified, in which case no hashing occurs.)\n\no Use the PASSWORD() function (deprecated as of MySQL 5.7.6)\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'password\');\n\n The PASSWORD() argument is the cleartext (unencrypted) password.\n PASSWORD() hashes the password and returns the encrypted password\n string for storage in the account row in the mysql.user system table.\n\n The PASSWORD() function hashes the password using the hashing method\n determined by the value of the old_passwords system variable value.\n Be sure that old_passwords has the value corresponding to the hashing\n method expected by the authentication plugin associated with the\n account. For example, if the account uses the mysql_native_password\n plugin, the old_passwords value must be 0:\n\nSET old_passwords = 0;\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'password\');\n\n If the old_passwords value differs from that required by the\n authentication plugin, the hashed password value returned by\n PASSWORD() will not by usable by the plugin and correct\n authentication of client connections will not occur.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-password.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (437,37,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {OFF|ON}\n\nThe sql_log_bin variable controls whether logging to the binary log is\nenabled for the current session (assuming that the binary log itself is\nenabled). The default value is ON. To disable or enable binary logging\nfor the current session, set the session sql_log_bin variable to OFF or\nON.\n\nSet this variable to OFF for a session to temporarily disable binary\nlogging while making changes to the master you do not want replicated\nto the slave.\n\nSetting the session value of this system variable is a restricted\noperation. The session user must have privileges sufficient to set\nrestricted session variables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/system-variable-privileges.html.\n\nIt is not possible to set the session value of sql_log_bin within a\ntransaction or subquery.\n\nSetting this variable to OFF prevents GTIDs from being assigned to\ntransactions in the binary log. If you are using GTIDs for replication,\nthis means that even when binary logging is later enabled again, the\nGTIDs written into the log from this point do not account for any\ntransactions that occurred in the meantime, so in effect those\ntransactions are lost.\n\nThe global sql_log_bin variable is read only and cannot be modified.\nThe global scope is deprecated and will be removed in a future MySQL\nrelease.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/set-sql-log-bin.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (438,12,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a string of\n40 hexadecimal digits, or NULL if the argument was NULL. One of the\npossible uses for this function is as a hash key. See the notes at the\nbeginning of this section about storing hash values efficiently. SHA()\nis synonymous with SHA1().\n\nThe return value is a string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (439,12,'SHA2','Syntax:\nSHA2(str, hash_length)\n\nCalculates the SHA-2 family of hash functions (SHA-224, SHA-256,\nSHA-384, and SHA-512). The first argument is the cleartext string to be\nhashed. The second argument indicates the desired bit length of the\nresult, which must have a value of 224, 256, 384, 512, or 0 (which is\nequivalent to 256). If either argument is NULL or the hash length is\nnot one of the permitted values, the return value is NULL. Otherwise,\nthe function result is a hash value containing the desired number of\nbits. See the notes at the beginning of this section about storing hash\nvalues efficiently.\n\nThe return value is a string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT SHA2(\'abc\', 224);\n -> \'23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\'\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (440,2,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW {BINARY | MASTER} LOGS\nSHOW BINLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW MASTER STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW RELAYLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW SLAVE HOSTS\nSHOW SLAVE STATUS [FOR CHANNEL channel]\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL % and _ wildcard\ncharacters. The pattern is useful for restricting statement output to\nmatching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (441,2,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-binary-logs.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (442,2,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n [IN \'log_name\']\n [FROM pos]\n [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (443,2,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html. For example:\n\nmysql> SHOW 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: http://dev.mysql.com/doc/refman/5.7/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-character-set.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (444,2,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION WHERE Charset = \'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+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-collation.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (445,2,'SHOW COLUMNS','Syntax:\nSHOW [FULL] {COLUMNS | FIELDS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. SHOW COLUMNS displays information only for\nthose columns for which you have some privilege.\n\nmysql> SHOW 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| CountryCode | char(3) | NO | MUL | | |\n| District | char(20) | NO | | | |\n| Population | int(11) | NO | | 0 | |\n+-------------+----------+------+-----+---------+----------------+\n\nAn alternative to tbl_name FROM db_name syntax is db_name.tbl_name.\nThese two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nThe optional FULL keyword causes the output to include the column\ncollation and comments, as well as the privileges you have for each\ncolumn.\n\nThe LIKE clause, if present, indicates which column names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nThe data types may differ from what you expect them to be based on a\nCREATE TABLE statement because MySQL sometimes changes data types when\nyou create or alter a table. The conditions under which this occurs are\ndescribed in\nhttp://dev.mysql.com/doc/refman/5.7/en/silent-column-changes.html.\n\nSHOW COLUMNS displays the following values for each table column:\n\no Field\n\n The column name.\n\no Type\n\n The column data type.\n\no Collation\n\n The collation for nonbinary string columns, or NULL for other\n columns. This value is displayed only if you use the FULL keyword.\n\no Null\n\n The column nullability. The value is YES if NULL values can be stored\n in the column, NO if not.\n\no Key\n\n Whether the column is indexed:\n\n o If Key is empty, the column either is not indexed or is indexed\n only as a secondary column in a multiple-column, nonunique index.\n\n o If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\n o If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index permits multiple NULL values, but you can tell whether\n the column permits NULL by checking the Null field.)\n\n o If Key is MUL, the column is the first column of a nonunique index\n in which multiple occurrences of a given value are permitted within\n the column.\n\n If more than one of the Key values applies to a given column of a\n table, Key displays the one with the highest priority, in the order\n PRI, UNI, MUL.\n\n A UNIQUE index may be displayed as PRI if it cannot contain NULL\n values and there is no PRIMARY KEY in the table. A UNIQUE index may\n display as MUL if several columns form a composite UNIQUE index;\n although the combination of the columns is unique, each column can\n still hold multiple occurrences of a given value.\n\no Default\n\n The default value for the column. This is NULL if the column has an\n explicit default of NULL, or if the column definition includes no\n DEFAULT clause.\n\no Extra\n\n Any additional information that is available about a given column.\n The value is nonempty in these cases:\n\n o auto_increment for columns that have the AUTO_INCREMENT attribute.\n\n o on update CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that\n have the ON UPDATE CURRENT_TIMESTAMP attribute.\n\n o VIRTUAL GENERATED or VIRTUAL STORED for generated columns.\n\no Privileges\n\n The privileges you have for the column. This value is displayed only\n if you use the FULL keyword.\n\no Comment\n\n Any comment included in the column definition. This value is\n displayed only if you use the FULL keyword.\n\nTable column information is also available from the INFORMATION_SCHEMA\nCOLUMNS table. See\nhttp://dev.mysql.com/doc/refman/5.7/en/columns-table.html.\n\nYou can list a table\'s columns with the mysqlshow db_name tbl_name\ncommand.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee http://dev.mysql.com/doc/refman/5.7/en/describe.html.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-columns.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (446,2,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n\nShows the CREATE DATABASE statement that creates the named database. If\nthe SHOW statement includes an IF NOT EXISTS clause, the output too\nincludes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE\nDATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.7/en/show-create-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (447,2,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. It requires the EVENT privilege for the database from\nwhich the event is to be shown. For example (using the same event\ne_daily defined and then altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT myschema.e_daily\\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n time_zone: SYSTEM\n Create Event: CREATE DEFINER=`jon`@`ghidora` 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: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.7/en/show-create-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (448,2,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (449,2,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nTo use either statement, you must be the user named in the routine\nDEFINER clause or have SELECT access to the mysql.proc table. If you do\nnot have privileges for the routine itself, the value displayed for the\nCreate Procedure or Create Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS char(50) CHARSET latin1\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.7/en/show-create-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (450,2,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the named table. To use\nthis statement, you must have some privilege for the table. This\nstatement also works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nFor information about how CREATE TABLE statements are stored by MySQL,\nsee\nhttp://dev.mysql.com/doc/refman/5.7/en/create-table-statement-retention\n.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-table.html\n\n','mysql> SHOW 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','http://dev.mysql.com/doc/refman/5.7/en/show-create-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (451,2,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows the CREATE TRIGGER statement that creates the\nnamed trigger. This statement requires the TRIGGER privilege for the\ntable associated with the trigger.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-trigger.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (452,2,'SHOW CREATE USER','Syntax:\nSHOW CREATE USER user\n\nThis statement shows the CREATE USER statement that creates the named\nuser. An error occurs if the user does not exist. The statement\nrequires the SELECT privilege for the mysql system database, except to\ndisplay information for the current user.\n\nTo name the account, use the format described in\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html. The host\nname part of the account name, if omitted, defaults to \'%\'. It is also\npossible to specify CURRENT_USER or CURRENT_USER() to refer to the\naccount associated with the current session.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (453,2,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows the CREATE VIEW statement that creates the named\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-create-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (454,2,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-databases.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (455,2,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine. It\nrequires the PROCESS privilege. The statement has these variants:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex and rw-lock statistics.\n\n*Note*:\n\nInnoDB mutexes and rwlocks can also be monitored using Performance\nSchema tables. See\nhttp://dev.mysql.com/doc/refman/5.7/en/monitor-innodb-mutex-waits-perfo\nrmance-schema.html.\n\nSHOW ENGINE INNODB MUTEX output was removed in MySQL 5.7.2. It was\nrevised and reintroduced in MySQL 5.7.8.\n\nIn MySQL 5.7.8, mutex statistics collection is configured dynamically\nusing the following options:\n\no To enable the collection of mutex statistics, run:\n\nSET GLOBAL innodb_monitor_enable=\'latch\';\n\no To reset mutex statistics, run:\n\nSET GLOBAL innodb_monitor_reset=\'latch\';\n\no To disable the collection of mutex statistics, run:\n\nSET GLOBAL innodb_monitor_disable=\'latch\';\n\nCollection of mutex statistics for SHOW ENGINE INNODB MUTEX can also be\nenabled by setting innodb_monitor_enable=\'all\', or disabled by setting\ninnodb_monitor_disable=\'all\'.\n\nSHOW ENGINE INNODB MUTEX output has these columns:\n\no Type\n\n Always InnoDB.\n\no Name\n\n Prior to MySQL 5.7.8, the Name field reports the source file where\n the mutex is implemented, and the line number in the file where the\n mutex is created. The line number is specific to your version of\n MySQL. As of MySQL 5.7.8, only the mutex name is reported. File name\n and line number are still reported for rwlocks.\n\no Status\n\n The mutex status.\n\n Prior to MySQL 5.7.8, the Status field displays several values if\n WITH_DEBUG was defined at MySQL compilation time. If WITH_DEBUG was\n not defined, the statement displays only the os_waits value. In the\n latter case (without WITH_DEBUG), the information on which the output\n is based is insufficient to distinguish regular mutexes and mutexes\n that protect rwlocks (which permit multiple readers or a single\n writer). Consequently, the output may appear to contain multiple rows\n for the same mutex. Pre-MySQL 5.7.8 Status field values include:\n\n o count indicates how many times the mutex was requested.\n\n o spin_waits indicates how many times the spinlock had to run.\n\n o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n divided by spin_waits provides the average round count.)\n\n o os_waits indicates the number of operating system waits. This\n occurs when the spinlock did not work (the mutex was not locked\n during the spinlock and it was necessary to yield to the operating\n system and wait).\n\n o os_yields indicates the number of times a thread trying to lock a\n mutex gave up its timeslice and yielded to the operating system (on\n the presumption that permitting other threads to run will free the\n mutex so that it can be locked).\n\n o os_wait_times indicates the amount of time (in ms) spent in\n operating system waits. In MySQL 5.7 timing is disabled and this\n value is always 0.\n\n As of MySQL 5.7.8, the Status field reports the number of spins,\n waits, and calls. Statistics for low-level operating system mutexes,\n which are implemented outside of InnoDB, are not reported.\n\n o spins indicates the number of spins.\n\n o waits indicates the number of mutex waits.\n\n o calls indicates how many times the mutex was requested.\n\nSHOW ENGINE INNODB MUTEX skips the mutexes and rw-locks of buffer pool\nblocks, as the amount of output can be overwhelming on systems with a\nlarge buffer pool. (There is one mutex and one rw-lock in each 16K\nbuffer pool block, and there are 65,536 blocks per gigabyte.) SHOW\nENGINE INNODB MUTEX also does not list any mutexes or rw-locks that\nhave never been waited on (os_waits=0). Thus, SHOW ENGINE INNODB MUTEX\nonly displays information about mutexes and rw-locks outside of the\nbuffer pool that have caused at least one OS-level wait.\n\nUse SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal\noperation of the Performance Schema code:\n\nmysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\\G\n...\n*************************** 3. row ***************************\n Type: performance_schema\n Name: events_waits_history.size\nStatus: 76\n*************************** 4. row ***************************\n Type: performance_schema\n Name: events_waits_history.count\nStatus: 10000\n*************************** 5. row ***************************\n Type: performance_schema\n Name: events_waits_history.memory\nStatus: 760000\n...\n*************************** 57. row ***************************\n Type: performance_schema\n Name: performance_schema.memory\nStatus: 26459600\n...\n\nThis statement is intended to help the DBA understand the effects that\ndifferent Performance Schema options have on memory requirements.\n\nName values consist of two parts, which name an internal buffer and a\nbuffer attribute, respectively. Interpret buffer names as follows:\n\no An internal buffer that is not exposed as a table is named within\n parentheses. Examples: (pfs_cond_class).size,\n (pfs_mutex_class).memory.\n\no An internal buffer that is exposed as a table in the\n performance_schema database is named after the table, without\n parentheses. Examples: events_waits_history.size,\n mutex_instances.count.\n\no A value that applies to the Performance Schema as a whole begins with\n performance_schema. Example: performance_schema.memory.\n\nBuffer attributes have these meanings:\n\no size is the size of the internal record used by the implementation,\n such as the size of a row in a table. size values cannot be changed.\n\no count is the number of internal records, such as the number of rows\n in a table. count values can be changed using Performance Schema\n configuration options.\n\no For a table, tbl_name.memory is the product of size and count. For\n the Performance Schema as a whole, performance_schema.memory is the\n sum of all the memory used (the sum of all other memory values).\n\nIn some cases, there is a direct relationship between a Performance\nSchema configuration parameter and a SHOW ENGINE value. For example,\nevents_waits_history_long.count corresponds to\nperformance_schema_events_waits_history_long_size. In other cases, the\nrelationship is more complex. For example, events_waits_history.count\ncorresponds to performance_schema_events_waits_history_size (the number\nof rows per thread) multiplied by\nperformance_schema_max_thread_instances ( the number of threads).\n\nSHOW ENGINE NDB STATUS If the server has the NDB storage engine\nenabled, SHOW ENGINE NDB STATUS displays cluster status information\nsuch as the number of connected data nodes, the cluster connectstring,\nand cluster binary log epochs, as well as counts of various Cluster API\nobjects created by the MySQL Server when connected to the cluster.\nSample output from this statement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type | Name | Status |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection | cluster_node_id=7,\n connected_host=198.51.100.103, connected_port=1186, number_of_data_nodes=4,\n number_of_ready_data_nodes=3, connect_count=0 |\n| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212 |\n| ndbcluster | NdbOperation | created=8, free=8, sizeof=660 |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744 |\n| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664 |\n| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60 |\n| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136 |\n| ndbcluster | NdbLabel | created=0, free=0, sizeof=196 |\n| ndbcluster | NdbBranch | created=0, free=0, sizeof=24 |\n| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68 |\n| ndbcluster | NdbCall | created=0, free=0, sizeof=16 |\n| ndbcluster | NdbBlob | created=1, free=1, sizeof=264 |\n| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68 |\n| ndbcluster | binlog | latest_epoch=155467, latest_trans_epoch=148126,\n latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n latest_applied_binlog_epoch=0 |\n+------------+-----------------------+--------------------------------------------------+\n\nThe Status column in each of these rows provides information about the\nMySQL server\'s connection to the cluster and about the cluster binary\nlog\'s status, respectively. The Status information is in the form of\ncomma-delimited set of name/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-engine.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (456,2,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is.\n\nFor information about MySQL storage engines, see\nhttp://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.7/en/storage-engines.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-engines.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (457,2,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nSHOW ERRORS is a diagnostic statement that is similar to SHOW WARNINGS,\nexcept that it displays information only for errors, rather than for\nerrors, warnings, and notes.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nSHOW ERRORS and error_count apply only to errors, not warnings or\nnotes. In other respects, they are similar to SHOW WARNINGS and\nwarning_count. In particular, SHOW ERRORS cannot display information\nfor more than max_error_count messages, and error_count can exceed the\nvalue of max_error_count if the number of errors exceeds\nmax_error_count.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-errors.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (458,2,'SHOW EVENTS','Syntax:\nSHOW EVENTS\n [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement displays information about Event Manager events, which\nare discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/event-scheduler.html. It\nrequires the EVENT privilege for the database from which the events are\nto be shown.\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW 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: 1\n Interval field: DAY\n Starts: 2018-08-08 11:06:34\n Ends: NULL\n Status: ENABLED\n Originator: 1\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-events.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (459,2,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-function-code.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (460,2,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-function-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (461,2,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement displays the privileges that are assigned to a MySQL\nuser account, in the form of GRANT statements that must be executed to\nduplicate the privilege assignments.\n\n*Note*:\n\nTo display nonprivilege information for MySQL accounts, use the SHOW\nCREATE USER statement. See [HELP SHOW CREATE USER].\n\nSHOW GRANTS requires the SELECT privilege for the mysql system\ndatabase, except to display privileges for the current user.\n\nTo name the account for SHOW GRANTS, use the same format as for the\nGRANT statement; for example, \'jeffrey\'@\'localhost\':\n\nmysql> SHOW GRANTS FOR \'jeffrey\'@\'localhost\';\n+------------------------------------------------------------------+\n| Grants for jeffrey@localhost |\n+------------------------------------------------------------------+\n| GRANT USAGE ON *.* TO `jeffrey`@`localhost` |\n| GRANT SELECT, INSERT, UPDATE ON `db1`.* TO `jeffrey`@`localhost` |\n+------------------------------------------------------------------+\n\nThe host part, if omitted, defaults to \'%\'. For additional information\nabout specifying account names, see\nhttp://dev.mysql.com/doc/refman/5.7/en/account-names.html.\n\nTo display the privileges granted to the current user (the account you\nare using to connect to the server), you can use any of the following\nstatements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is\nused in definer context, such as within a stored procedure that\nexecutes with definer rather than invoker privileges, the grants\ndisplayed are those of the definer and not the invoker.\n\nSHOW GRANTS does not display privileges that are available to the named\naccount but are granted to a different account. For example, if an\nanonymous account exists, the named account might be able to use its\nprivileges, but SHOW GRANTS does not display them.\n\nSHOW GRANTS output does not include IDENTIFIED BY PASSWORD clauses. Use\nthe SHOW CREATE USER statement instead. See [HELP SHOW CREATE USER].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-grants.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (462,2,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [WHERE expr]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC. This statement requires some\nprivilege for any column in the table.\n\nmysql> SHOW INDEX FROM City\\G\n*************************** 1. row ***************************\n Table: city\n Non_unique: 0\n Key_name: PRIMARY\n Seq_in_index: 1\n Column_name: ID\n Collation: A\n Cardinality: 4188\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment:\n*************************** 2. row ***************************\n Table: city\n Non_unique: 1\n Key_name: CountryCode\n Seq_in_index: 1\n Column_name: CountryCode\n Collation: A\n Cardinality: 232\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment:\n\nAn alternative to tbl_name FROM db_name syntax is db_name.tbl_name.\nThese two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nThe WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nSHOW INDEX returns the following fields:\n\no Table\n\n The name of the table.\n\no Non_unique\n\n 0 if the index cannot contain duplicates, 1 if it can.\n\no Key_name\n\n The name of the index. If the index is the primary key, the name is\n always PRIMARY.\n\no Seq_in_index\n\n The column sequence number in the index, starting with 1.\n\no Column_name\n\n The name of the column.\n\no Collation\n\n How the column is sorted in the index. This can have values A\n (ascending) or NULL (not sorted).\n\no Cardinality\n\n An estimate of the number of unique values in the index. To update\n this number, run ANALYZE TABLE or (for MyISAM tables) myisamchk -a.\n\n Cardinality is counted based on statistics stored as integers, so the\n value is not necessarily exact even for small tables. The higher the\n cardinality, the greater the chance that MySQL uses the index when\n doing joins.\n\no Sub_part\n\n The index prefix. That is, the number of indexed characters if the\n column is only partly indexed, NULL if the entire column is indexed.\n\n *Note*:\n\n Prefix limits are measured in bytes. However, prefix lengths for\n index specifications in CREATE TABLE, ALTER TABLE, and CREATE INDEX\n statements are interpreted as number of characters for nonbinary\n string types (CHAR, VARCHAR, TEXT) and number of bytes for binary\n string types (BINARY, VARBINARY, BLOB). Take this into account when\n specifying a prefix length for a nonbinary string column that uses a\n multibyte character set.\n\n For additional information about index prefixes, see\n http://dev.mysql.com/doc/refman/5.7/en/column-indexes.html, and [HELP\n CREATE INDEX].\n\no Packed\n\n Indicates how the key is packed. NULL if it is not.\n\no Null\n\n Contains YES if the column may contain NULL values and \'\' if not.\n\no Index_type\n\n The index method used (BTREE, FULLTEXT, HASH, RTREE).\n\no Comment\n\n Information about the index not described in its own column, such as\n disabled if the index is disabled.\n\no Index_comment\n\n Any comment provided for the index with a COMMENT attribute when the\n index was created.\n\nInformation about table indexes is also available from the\nINFORMATION_SCHEMA STATISTICS table. See\nhttp://dev.mysql.com/doc/refman/5.7/en/statistics-table.html.\n\nYou can list a table\'s indexes with the mysqlshow -k db_name tbl_name\ncommand.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (463,2,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS\\G\n*************************** 1. row ***************************\n File: master-bin.000002\n Position: 1307\n Binlog_Do_DB: test\n Binlog_Ignore_DB: manual, mysql\nExecuted_Gtid_Set: 3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-master-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (464,2,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.7/en/table-cache.html. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database. The LIKE clause, if present, indicates which table\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-open-tables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (465,2,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins.\n\nExample of SHOW PLUGINS output:\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n Name: CSV\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n Name: MEMORY\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n Name: MyISAM\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-plugins.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (466,2,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-privileges.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (467,2,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nTo use either statement, you must be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE 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\nmysql> SHOW 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+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/show-procedure-code.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (468,2,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n Db: test\n Name: sp1\n Type: PROCEDURE\n Definer: testuser@localhost\n Modified: 2018-08-08 13:54:11\n Created: 2018-08-08 13:54:11\n Security_type: DEFINER\n Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.7/en/show-procedure-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (469,2,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows which threads are running. If you have the\nPROCESS privilege, you can see all threads. Otherwise, you can see only\nyour own threads (that is, threads associated with the MySQL account\nthat you are using). If you do not use the FULL keyword, only the first\n100 characters of each statement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-processlist.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (470,2,'SHOW PROFILE','Syntax:\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}\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\n*Note*:\n\nThe SHOW PROFILE and SHOW PROFILES statements are deprecated and will\nbe removed in a future MySQL release. Use the Performance Schema\ninstead; see\nhttp://dev.mysql.com/doc/refman/5.7/en/performance-schema-query-profili\nng.html.\n\nTo control profiling, use the profiling session variable, which has a\ndefault value of 0 (OFF). Enable profiling by setting profiling to 1 or\nON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nserver. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILE and SHOW PROFILES, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthough there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.7/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n with the name and line number of the file in which the function\n occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-profile.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+----------+--------------------------+\n| 0 | 0.000088 | SET PROFILING = 1 |\n| 1 | 0.000136 | DROP TABLE IF EXISTS t1 |\n| 2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table | 0.000056 |\n| After create | 0.011363 |\n| query end | 0.000375 |\n| freeing items | 0.000089 |\n| logging slow query | 0.000019 |\n| cleaning up | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| query end | 0.000107 |\n| freeing items | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 | 0.000002 |\n| creating table | 0.000056 | 0.000028 | 0.000028 |\n| After create | 0.011363 | 0.000217 | 0.001571 |\n| query end | 0.000375 | 0.000013 | 0.000028 |\n| freeing items | 0.000089 | 0.000010 | 0.000014 |\n| logging slow query | 0.000019 | 0.000009 | 0.000010 |\n| cleaning up | 0.000005 | 0.000003 | 0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.7/en/show-profile.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (471,2,'SHOW PROFILES','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILES statement, together with SHOW PROFILE, displays\nprofiling information that indicates resource usage for statements\nexecuted during the course of the current session. For more\ninformation, see [HELP SHOW PROFILE].\n\n*Note*:\n\nThe SHOW PROFILE and SHOW PROFILES statements are deprecated and will\nbe removed in a future MySQL release. Use the Performance Schema\ninstead; see\nhttp://dev.mysql.com/doc/refman/5.7/en/performance-schema-query-profili\nng.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-profiles.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-profiles.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (472,2,'SHOW RELAYLOG EVENTS','Syntax:\nSHOW RELAYLOG EVENTS\n [IN \'log_name\']\n [FROM pos]\n [LIMIT [offset,] row_count]\n [channel_option]\n\nchannel_option:\n FOR CHANNEL channel\n\nShows the events in the relay log of a replication slave. If you do not\nspecify \'log_name\', the first relay log is displayed. This statement\nhas no effect on the master.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-relaylog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-relaylog-events.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (473,2,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster.\n\nSHOW SLAVE HOSTS should be executed on a server that acts as a\nreplication master. The statement displays information about servers\nthat are or have been connected as replication slaves, with each row of\nthe result corresponding to one slave server, as shown here:\n\nmysql> SHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+--------------------------------------+\n| Server_id | Host | Port | Master_id | Slave_UUID |\n+------------+-----------+------+-----------+--------------------------------------+\n| 192168010 | iconnect2 | 3306 | 192168011 | 14cb6624-7f93-11e0-b2c0-c80aa9429562 |\n| 1921680101 | athena | 3306 | 192168011 | 07af4990-f41f-11df-a566-7ac56fdaf645 |\n+------------+-----------+------+-----------+--------------------------------------+\n\no Server_id: The unique server ID of the slave server, as configured in\n the slave server\'s option file, or on the command line with\n --server-id=value.\n\no Host: The host name of the slave server as specified on the slave\n with the --report-host option. This can differ from the machine name\n as configured in the operating system.\n\no User: The slave server user name as, specified on the slave with the\n --report-user option. Statement output includes this column only if\n the master server is started with the --show-slave-auth-info option.\n\no Password: The slave server password as, specified on the slave with\n the --report-password option. Statement output includes this column\n only if the master server is started with the --show-slave-auth-info\n option.\n\no Port: The port on the master to which the slave server is listening,\n as specified on the slave with the --report-port option.\n\n A zero in this column means that the slave port (--report-port) was\n not set.\n\no Master_id: The unique server ID of the master server that the slave\n server is replicating from. This is the server ID of the server on\n which SHOW SLAVE HOSTS is executed, so this same value is listed for\n each row in the result.\n\no Slave_UUID: The globally unique ID of this slave, as generated on the\n slave and found in the slave\'s auto.cnf file.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-slave-hosts.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (474,2,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS [FOR CHANNEL channel]\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: localhost\n Master_User: repl\n Master_Port: 13000\n Connect_Retry: 60\n Master_Log_File: master-bin.000002\n Read_Master_Log_Pos: 1307\n Relay_Log_File: slave-relay-bin.000003\n Relay_Log_Pos: 1508\n Relay_Master_Log_File: master-bin.000002\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: 1307\n Relay_Log_Space: 1858\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n Master_Server_Id: 1\n Master_UUID: 3e11fa47-71ca-11e1-9e33-c80aa9429562\n Master_Info_File: /var/mysqld.2/data/master.info\n SQL_Delay: 0\n SQL_Remaining_Delay: NULL\n Slave_SQL_Running_State: Reading event from the relay log\n Master_Retry_Count: 10\n Master_Bind:\n Last_IO_Error_Timestamp:\n Last_SQL_Error_Timestamp:\n Master_SSL_Crl:\n Master_SSL_Crlpath:\n Retrieved_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Executed_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Auto_Position: 1\n Replicate_Rewrite_DB:\n Channel_name:\n Master_TLS_Version: TLSv1.2\n\nThe Performance Schema provides tables that expose replication\ninformation. This is similar to the information available from the SHOW\nSLAVE STATUS statement, but represented in table form. For details, see\nhttp://dev.mysql.com/doc/refman/5.7/en/performance-schema-replication-t\nables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (475,2,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\n*Note*:\n\nAs of MySQL 5.7.6, the value of the show_compatibility_56 system\nvariable affects the information available from and privileges required\nfor the statement described here. For details, see the description of\nthat variable in\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nSHOW STATUS provides server status information (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html).\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\n\nStatus variable information is also available from these sources:\n\no Performance Schema tables. See\n http://dev.mysql.com/doc/refman/5.7/en/performance-schema-status-vari\n able-tables.html.\n\no The GLOBAL_STATUS and SESSION_STATUS tables. See\n http://dev.mysql.com/doc/refman/5.7/en/status-table.html.\n\no The mysqladmin extended-status command. See\n http://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html.\n\nFor SHOW STATUS, a LIKE clause, if present, indicates which variable\nnames to match. A WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nSHOW STATUS accepts an optional GLOBAL or SESSION variable scope\nmodifier:\n\no With a GLOBAL modifier, the statement displays the global status\n values. A global status variable may represent status for some aspect\n of the server itself (for example, Aborted_connects), or the\n aggregated status over all connections to MySQL (for example,\n Bytes_received and Bytes_sent). If a variable has no global value,\n the session value is displayed.\n\no With a SESSION modifier, the statement displays the status variable\n values for the current connection. If a variable has no session\n value, the global value is displayed. LOCAL is a synonym for SESSION.\n\no If no modifier is present, the default is SESSION.\n\nThe scope for each status variable is listed at\nhttp://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name | Value |\n+--------------------+----------+\n| Key_blocks_used | 14955 |\n| Key_read_requests | 96854827 |\n| Key_reads | 162040 |\n| Key_write_requests | 7589728 |\n| Key_writes | 3813196 |\n+--------------------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (476,2,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-table-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (477,2,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nMatching performed by the LIKE clause is dependent on the setting of\nthe lower_case_table_names system variable.\n\nThis statement also lists any views in the database. The optional FULL\nmodifier causes SHOW TABLES to display a second output column with\nvalues of BASE TABLE for a table, VIEW for a view, or SYSTEM VIEW for\nan INFORMATION_SCHEMA table.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-tables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (478,2,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement returns results only for databases and tables for which you\nhave the TRIGGER privilege. The LIKE clause, if present, indicates\nwhich table names (not trigger names) to match and causes the statement\nto display triggers for those tables. The WHERE clause can be given to\nselect rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nFor the ins_sum trigger defined in\nhttp://dev.mysql.com/doc/refman/5.7/en/triggers.html, the output of\nSHOW TRIGGERS is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\n Statement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: 2018-08-08 10:10:12.61\n sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,\n NO_ZERO_IN_DATE,NO_ZERO_DATE,\n ERROR_FOR_DIVISION_BY_ZERO,\n NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n Definer: me@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-triggers.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (479,2,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\n*Note*:\n\nAs of MySQL 5.7.6, the value of the show_compatibility_56 system\nvariable affects the information available from and privileges required\nfor the statement described here. For details, see the description of\nthat variable in\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nSHOW VARIABLES shows the values of MySQL system variables (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html).\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\n\nSystem variable information is also available from these sources:\n\no Performance Schema tables. See\n http://dev.mysql.com/doc/refman/5.7/en/performance-schema-system-vari\n able-tables.html.\n\no The GLOBAL_VARIABLES and SESSION_VARIABLES tables. See\n http://dev.mysql.com/doc/refman/5.7/en/variables-table.html.\n\no The mysqladmin variables command. See\n http://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html.\n\nFor SHOW VARIABLES, a LIKE clause, if present, indicates which variable\nnames to match. A WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.7/en/extended-show.html.\n\nSHOW VARIABLES accepts an optional GLOBAL or SESSION variable scope\nmodifier:\n\no With a GLOBAL modifier, the statement displays global system variable\n values. These are the values used to initialize the corresponding\n session variables for new connections to MySQL. If a variable has no\n global value, no value is displayed.\n\no With a SESSION modifier, the statement displays the system variable\n values that are in effect for the current connection. If a variable\n has no session value, the global value is displayed. LOCAL is a\n synonym for SESSION.\n\no If no modifier is present, the default is SESSION.\n\nThe scope for each system variable is listed at\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nSHOW VARIABLES is subject to a version-dependent display-width limit.\nFor variables with very long values that are not completely displayed,\nuse SELECT as a workaround. For example:\n\nSELECT @@GLOBAL.innodb_data_file_path;\n\nMost system variables can be set at server startup (read-only variables\nsuch as version_comment are exceptions). Many can be changed at runtime\nwith the SET statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/using-system-variables.html, and\n[HELP SET].\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the %\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because _ is a wildcard that matches any\nsingle character, you should escape it as \\_ to match it literally. In\npractice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-variables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (480,2,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS is a diagnostic statement that displays information about\nthe conditions (errors, warnings, and notes) resulting from executing a\nstatement in the current session. Warnings are generated for DML\nstatements such as INSERT, UPDATE, and LOAD DATA INFILE as well as DDL\nstatements such as CREATE TABLE and ALTER TABLE.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nSHOW WARNINGS is also used following EXPLAIN, to display the extended\ninformation generated by EXPLAIN. See\nhttp://dev.mysql.com/doc/refman/5.7/en/explain-extended.html.\n\nSHOW WARNINGS displays information about the conditions resulting from\nexecution of the most recent nondiagnostic statement in the current\nsession. If the most recent statement resulted in an error during\nparsing, SHOW WARNINGS shows the resulting conditions, regardless of\nstatement type (diagnostic or nondiagnostic).\n\nThe SHOW COUNT(*) WARNINGS diagnostic statement displays the total\nnumber of errors, warnings, and notes. You can also retrieve this\nnumber from the warning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nA difference in these statements is that the first is a diagnostic\nstatement that does not clear the message list. The second, because it\nis a SELECT statement is considered nondiagnostic and does clear the\nmessage list.\n\nA related diagnostic statement, SHOW ERRORS, shows only error\nconditions (it excludes warnings and notes), and SHOW COUNT(*) ERRORS\nstatement displays the total number of errors. See [HELP SHOW ERRORS].\nGET DIAGNOSTICS can be used to examine information for individual\nconditions. See [HELP GET DIAGNOSTICS].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/show-warnings.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (481,2,'SHUTDOWN','Syntax:\nSHUTDOWN\n\nThis statement stops the MySQL server. It requires the SHUTDOWN\nprivilege.\n\nSHUTDOWN was added in MySQL 5.7.9. It provides an SQL-level interface\nto the same functionality available using the mysqladmin shutdown\ncommand or the mysql_shutdown() C API function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/shutdown.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/shutdown.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (482,29,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n -> -1\nmysql> SELECT SIGN(0);\n -> 0\nmysql> SELECT SIGN(234);\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (483,5,'SIGNAL','Syntax:\nSIGNAL condition_value\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value: {\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n}\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name: {\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n}\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nSIGNAL is the way to "return" an error. SIGNAL provides error\ninformation to a handler, to an outer portion of the application, or to\nthe client. Also, it provides control over the error\'s characteristics\n(error number, SQLSTATE value, message). Without SIGNAL, it is\nnecessary to resort to workarounds such as deliberately referring to a\nnonexistent table to cause a routine to return an error.\n\nNo privileges are required to execute the SIGNAL statement.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.7/en/diagnostics-area.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/signal.html\n\n','CREATE PROCEDURE p (pval INT)\nBEGIN\n DECLARE specialty CONDITION FOR SQLSTATE \'45000\';\n IF pval = 0 THEN\n SIGNAL SQLSTATE \'01000\';\n ELSEIF pval = 1 THEN\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSEIF pval = 2 THEN\n SIGNAL specialty\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSE\n SIGNAL SQLSTATE \'01000\'\n SET MESSAGE_TEXT = \'A warning occurred\', MYSQL_ERRNO = 1000;\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\', MYSQL_ERRNO = 1001;\n END IF;\nEND;\n','http://dev.mysql.com/doc/refman/5.7/en/signal.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (484,29,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (485,28,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. The duration may have a fractional part. If\nthe argument is NULL or negative, SLEEP() produces a warning, or an\nerror in strict SQL mode.\n\nWhen sleep returns normally (without interruption), it returns 0:\n\nmysql> SELECT SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 0 |\n+-------------+\n\nWhen SLEEP() is the only thing invoked by a query that is interrupted,\nit returns 1 and the query itself returns no error. This is true\nwhether the query is killed or times out:\n\no This statement is interrupted using KILL QUERY from another session:\n\nmysql> SELECT SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 1 |\n+-------------+\n\no This statement is interrupted by timing out:\n\nmysql> SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 1 |\n+-------------+\n\nWhen SLEEP() is only part of a query that is interrupted, the query\nreturns an error:\n\no This statement is interrupted using KILL QUERY from another session:\n\nmysql> SELECT 1 FROM t1 WHERE SLEEP(1000);\nERROR 1317 (70100): Query execution was interrupted\n\no This statement is interrupted by timing out:\n\nmysql> SELECT /*+ MAX_EXECUTION_TIME(1000) */ 1 FROM t1 WHERE SLEEP(1000);\nERROR 3024 (HY000): Query execution was interrupted, maximum statement\nexecution time exceeded\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (486,10,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (487,35,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*:\n\nWhen using SOUNDEX(), you should be aware of the following limitations:\n\no This function, as currently implemented, is intended to work well\n with strings that are in the English language only. Strings in other\n languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n strings that use multibyte character sets, including utf-8. See Bug\n #22638 for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (488,35,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (489,35,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n -> \' \'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (490,16,'SPATIAL','For InnoDB and MyISAM tables, MySQL can create spatial indexes using\nsyntax similar to that for creating regular indexes, but using the\nSPATIAL keyword. Columns in spatial indexes must be declared NOT NULL.\nThe following examples demonstrate how to create spatial indexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g));\n\no With ALTER TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL);\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL);\nCREATE SPATIAL INDEX g ON geom (g);\n\nSPATIAL INDEX creates an R-tree index. For storage engines that support\nnonspatial indexing of spatial columns, the engine creates a B-tree\nindex. A B-tree index on spatial values is useful for exact-value\nlookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX g ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-indexes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (491,29,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n -> 2\nmysql> SELECT SQRT(20);\n -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (492,18,'SRID','SRID(g)\n\nST_SRID() and SRID() are synonyms. For more information, see the\ndescription of ST_SRID().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (493,37,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options] [channel_option]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type:\n IO_THREAD | SQL_THREAD\n\nuntil_option:\n UNTIL { {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n | MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n | RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n | SQL_AFTER_MTS_GAPS }\n\nconnection_options:\n [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\nchannel_option:\n FOR CHANNEL channel\n\ngtid_set:\n uuid_set [, uuid_set] ...\n | \'\'\n\nuuid_set:\n uuid:interval[:interval]...\n\nuuid:\n hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n [0-9,A-F]\n\ninterval:\n n[-n]\n\n (n >= 1)\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.7, START SLAVE causes an implicit commit of an ongoing\ntransaction. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\ngtid_next must be set to AUTOMATIC before issuing this statement.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the START SLAVE statement to a specific\nreplication channel. If no clause is named and no extra channels exist,\nthe statement applies to the default channel. If a START SLAVE\nstatement does not have a channel defined when using multiple channels,\nthis statement starts the specified threads for all channels. This\nstatement is disallowed for the group_replication_recovery channel. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nMySQL supports pluggable user-password authentication with START SLAVE\nwith the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR options, as\ndescribed in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nYou cannot use the SQL_THREAD option when specifying any of USER,\nPASSWORD, DEFAULT_AUTH, or PLUGIN_DIR, unless the IO_THREAD option is\nalso provided.\n\nSee\nhttp://dev.mysql.com/doc/refman/5.7/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nSTART SLAVE ... UNTIL supports two additional options for use with\nglobal transaction identifiers (GTIDs) (see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids.html). Each of\nthese takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses the slave SQL thread to process transactions until it has\nreached the first transaction whose GTID is listed in the gtid_set.\nSTART SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to process\nall transactions until the last transaction in the gtid_set has been\nprocessed by both threads. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS causes the slave SQL thread to process all\ntransactions occurring before the first GTID in the gtid_set is\nreached, and START SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads\nto handle all transactions, including those whose GTIDs are found in\ngtid_set, until each has encountered a transaction whose GTID is not\npart of the set. SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the\nSQL_THREAD and IO_THREAD options, although using IO_THREAD with them\ncurrently has no effect.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE SQL_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave SQL thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave SQL\nthread.\n\nPrior to MySQL 5.7.3, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction was completed, but waited until another GTID\nevent was received (Bug #14767986).\n\nWhen using a multithreaded slave, there is a chance of gaps in the\nsequence of transactions that have been executed from the relay log in\nthe following cases:\n\no killing the coordinator thread\n\no after an error occurs in the worker threads\n\no mysqld shuts down unexpectedly\n\nUse the START SLAVE UNTIL SQL_AFTER_MTS_GAPS statement to cause a\nmultithreaded slave\'s worker threads to only run until no more gaps are\nfound in the relay log, and then to stop. This statement can take an\nSQL_THREAD option, but the effects of the statement remain unchanged.\nIt has no effect on the slave I/O thread (and cannot be used with the\nIO_THREAD option).\n\nIssuing START SLAVE on a multithreaded slave with gaps in the sequence\nof transactions executed from the relay log generates a warning. In\nsuch a situation, the solution is to use START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS, then issue RESET SLAVE to remove any remaining\nrelay logs. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-features-transaction\n-inconsistencies.html for more information.\n\nTo change a failed multithreaded slave to single-threaded mode, you can\nissue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\n*Note*:\n\nIt is possible to view the entire text of a running START SLAVE ...\nstatement, including any USER or PASSWORD values used, in the output of\nSHOW PROCESSLIST. This is also true for the text of a running CHANGE\nMASTER TO statement, including any values it employs for MASTER_USER or\nMASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/start-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (494,37,'START TRANSACTION','Syntax:\nSTART TRANSACTION\n [transaction_characteristic [, transaction_characteristic] ...]\n\ntransaction_characteristic: {\n WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n}\n\nBEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThese statements provide control over use of transactions:\n\no START TRANSACTION or BEGIN start a new transaction.\n\no COMMIT commits the current transaction, making its changes permanent.\n\no ROLLBACK rolls back the current transaction, canceling its changes.\n\no SET autocommit disables or enables the default autocommit mode for\n the current session.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. The change cannot be\nrolled back.\n\nTo disable autocommit mode implicitly for a single series of\nstatements, use the START TRANSACTION statement:\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nWith START TRANSACTION, autocommit remains disabled until you end the\ntransaction with COMMIT or ROLLBACK. The autocommit mode then reverts\nto its previous state.\n\nSTART TRANSACTION permits several modifiers that control transaction\ncharacteristics. To specify multiple modifiers, separate them by\ncommas.\n\no The WITH CONSISTENT SNAPSHOT modifier starts a consistent read for\n storage engines that are capable of it. This applies only to InnoDB.\n The effect is the same as issuing a START TRANSACTION followed by a\n SELECT from any InnoDB table. See\n http://dev.mysql.com/doc/refman/5.7/en/innodb-consistent-read.html.\n The WITH CONSISTENT SNAPSHOT modifier does not change the current\n transaction isolation level, so it provides a consistent snapshot\n only if the current isolation level is one that permits a consistent\n read. The only isolation level that permits a consistent read is\n REPEATABLE READ. For all other isolation levels, the WITH CONSISTENT\n SNAPSHOT clause is ignored. As of MySQL 5.7.2, a warning is generated\n when the WITH CONSISTENT SNAPSHOT clause is ignored.\n\no The READ WRITE and READ ONLY modifiers set the transaction access\n mode. They permit or prohibit changes to tables used in the\n transaction. The READ ONLY restriction prevents the transaction from\n modifying or locking both transactional and nontransactional tables\n that are visible to other transactions; the transaction can still\n modify or lock temporary tables.\n\n MySQL enables extra optimizations for queries on InnoDB tables when\n the transaction is known to be read-only. Specifying READ ONLY\n ensures these optimizations are applied in cases where the read-only\n status cannot be determined automatically. See\n http://dev.mysql.com/doc/refman/5.7/en/innodb-performance-ro-txn.html\n for more information.\n\n If no access mode is specified, the default mode applies. Unless the\n default has been changed, it is read/write. It is not permitted to\n specify both READ WRITE and READ ONLY in the same statement.\n\n In read-only mode, it remains possible to change tables created with\n the TEMPORARY keyword using DML statements. Changes made with DDL\n statements are not permitted, just as with permanent tables.\n\n For additional information about transaction access mode, including\n ways to change the default mode, see [HELP ISOLATION].\n\n If the read_only system variable is enabled, explicitly starting a\n transaction with START TRANSACTION READ WRITE requires the SUPER\n privilege.\n\n*Important*:\n\nMany APIs used for writing MySQL client applications (such as JDBC)\nprovide their own methods for starting transactions that can (and\nsometimes should) be used instead of sending a START TRANSACTION\nstatement from the client. See\nhttp://dev.mysql.com/doc/refman/5.7/en/connectors-apis.html, or the\ndocumentation for your API, for more information.\n\nTo disable autocommit mode explicitly, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDB) are not made permanent immediately. You must use COMMIT to store\nyour changes to disk or ROLLBACK to ignore the changes.\n\nautocommit is a session variable and must be set for each session. To\ndisable autocommit mode for each new connection, see the description of\nthe autocommit system variable at\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nBEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for\ninitiating a transaction. START TRANSACTION is standard SQL syntax, is\nthe recommended way to start an ad-hoc transaction, and permits\nmodifiers that BEGIN does not.\n\nThe BEGIN statement differs from the use of the BEGIN keyword that\nstarts a BEGIN ... END compound statement. The latter does not begin a\ntransaction. See [HELP BEGIN END].\n\n*Note*:\n\nWithin all stored programs (stored procedures and functions, triggers,\nand events), the parser treats BEGIN [WORK] as the beginning of a BEGIN\n... END block. Begin a transaction in this context with START\nTRANSACTION instead.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The new transaction also uses the\nsame access mode (READ WRITE or READ ONLY) as the just-terminated\ntransaction. The RELEASE clause causes the server to disconnect the\ncurrent client session after terminating the current transaction.\nIncluding the NO keyword suppresses CHAIN or RELEASE completion, which\ncan be useful if the completion_type system variable is set to cause\nchaining or release completion by default.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/commit.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/commit.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (495,24,'STARTPOINT','StartPoint(ls)\n\nST_StartPoint() and StartPoint() are synonyms. For more information,\nsee the description of ST_StartPoint().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (496,14,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. STD() is a synonym\nfor the standard SQL function STDDEV_POP(), provided as a MySQL\nextension.\n\nIf there are no matching rows, STD() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (497,14,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. STDDEV() is a\nsynonym for the standard SQL function STDDEV_POP(), provided for\ncompatibility with Oracle.\n\nIf there are no matching rows, STDDEV() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (498,14,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nIf there are no matching rows, STDDEV_POP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (499,14,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nIf there are no matching rows, STDDEV_SAMP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (500,37,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_types]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nchannel_option:\n FOR CHANNEL channel\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\nRecommended best practice is to execute STOP SLAVE on the slave before\nstopping the slave server (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-shutdown.html, for more\ninformation).\n\nWhen using the row-based logging format: You should execute STOP SLAVE\nor STOP SLAVE SQL_THREAD on the slave prior to shutting down the slave\nserver if you are replicating any tables that use a nontransactional\nstorage engine (see the Note later in this section).\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\nSTOP SLAVE causes an implicit commit of an ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\nFrom MySQL 5.7, gtid_next must be set to AUTOMATIC before issuing this\nstatement (Bug #16062608).\n\nFrom MySQL 5.7, you can control how long STOP SLAVE waits before timing\nout by setting the rpl_stop_slave_timeout system variable. This can be\nused to avoid deadlocks between STOP SLAVE and other slave SQL\nstatements using different client connections to the slave. When the\ntimeout value is reached, the issuing client returns an error message\nand stops waiting, but the STOP SLAVE instruction remains in effect.\nOnce the slave threads are no longer busy, the STOP SLAVE statement is\nexecuted and the slave stops. (Bug #16856735)\n\nSome CHANGE MASTER TO statements are allowed while the slave is\nrunning, depending on the states of the slave SQL and I/O threads.\nHowever, using STOP SLAVE prior to executing CHANGE MASTER TO in such\ncases is still supported. See [HELP CHANGE MASTER TO], and\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-solutions-switch.htm\nl, for more information.\n\nThe optional FOR CHANNEL channel clause enables you to name which\nreplication channel the statement applies to. Providing a FOR CHANNEL\nchannel clause applies the STOP SLAVE statement to a specific\nreplication channel. If no channel is named and no extra channels\nexist, the statement applies to the default channel. If a STOP SLAVE\nstatement does not name a channel when using multiple channels, this\nstatement stops the specified threads for all channels. This statement\ncannot be used with the group_replication_recovery channel. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information.\n\nWhen using statement-based replication: changing the master while it\nhas open temporary tables is potentially unsafe. This is one of the\nreasons why statement-based replication of temporary tables is not\nrecommended. You can find out whether there are any temporary tables on\nthe slave by checking the value of Slave_open_temp_tables; when using\nstatement-based replication, this value should be 0 before executing\nCHANGE MASTER TO. If there are any temporary tables open on the slave,\nissuing a CHANGE MASTER TO statement after issuing a STOP SLAVE causes\nan ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO warning.\n\nWhen using a multithreaded slave (slave_parallel_workers is a nonzero\nvalue), any gaps in the sequence of transactions executed from the\nrelay log are closed as part of stopping the worker threads. If the\nslave is stopped unexpectedly (for example due to an error in a worker\nthread, or another thread issuing KILL) while a STOP SLAVE statement is\nexecuting, the sequence of executed transactions from the relay log may\nbecome inconsistent. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-features-transaction\n-inconsistencies.html, for more information.\n\nIf the current replication event group has modified one or more\nnontransactional tables, STOP SLAVE waits for up to 60 seconds for the\nevent group to complete, unless you issue a KILL QUERY or KILL\nCONNECTION statement for the slave SQL thread. If the event group\nremains incomplete after the timeout, an error message is logged.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/stop-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (501,35,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (502,11,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (503,32,'ST_AREA','ST_Area({poly|mpoly})\n\nReturns a double-precision number indicating the area of the Polygon or\nMultiPolygon argument, as measured in its spatial reference system. For\narguments of dimension 0 or 1, the result is 0. If the argument is an\nempty geometry the return value is 0. If the argument is NULL the\nreturn value is NULL.\n\nThe result is the sum of the area values of all components for a\ngeometry collection. If a geometry collection is empty, its area is\nreturned as 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT ST_Area(ST_GeomFromText(@poly));\n+---------------------------------+\n| ST_Area(ST_GeomFromText(@poly)) |\n+---------------------------------+\n| 4 |\n+---------------------------------+\n\nmysql> SET @mpoly =\n \'MultiPolygon(((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1)))\';\nmysql> SELECT ST_Area(ST_GeomFromText(@mpoly));\n+----------------------------------+\n| ST_Area(ST_GeomFromText(@mpoly)) |\n+----------------------------------+\n| 8 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (504,40,'ST_ASBINARY','ST_AsBinary(g), ST_AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nIf the argument is NULL, the return value is NULL. If the argument is\nnot a syntactically well-formed geometry, an ER_GIS_INVALID_DATA error\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','SELECT ST_AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (505,27,'ST_ASGEOJSON','ST_AsGeoJSON(g [, max_dec_digits [, options]])\n\nGenerates a GeoJSON object from the geometry g. The object string has\nthe connection character set and collation.\n\nIf any argument is NULL, the return value is NULL. If any non-NULL\nargument is invalid, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html\n\n','mysql> SELECT ST_AsGeoJSON(ST_GeomFromText(\'POINT(11.11111 12.22222)\'),2);\n+-------------------------------------------------------------+\n| ST_AsGeoJSON(ST_GeomFromText(\'POINT(11.11111 12.22222)\'),2) |\n+-------------------------------------------------------------+\n| {"type": "Point", "coordinates": [11.11, 12.22]} |\n+-------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (506,40,'ST_ASTEXT','ST_AsText(g), ST_AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nIf the argument is NULL, the return value is NULL. If the argument is\nnot a syntactically well-formed geometry, an ER_GIS_INVALID_DATA error\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,2 2,3 3) |\n+--------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (507,20,'ST_BUFFER','ST_Buffer(g, d[, strategy1[, strategy2[, strategy3]]])\n\nReturns a geometry that represents all points whose distance from the\ngeometry value g is less than or equal to a distance of d, or NULL if\nany argument is NULL. The SRID of the geometry argument must be 0\nbecause ST_Buffer() supports only the Cartesian coordinate system. If\nany geometry argument is not a syntactically well-formed geometry, an\nER_GIS_INVALID_DATA error occurs.\n\nIf the geometry argument is empty, ST_Buffer() returns an empty\ngeometry.\n\nIf the distance is 0, ST_Buffer() returns the geometry argument\nunchanged:\n\nmysql> SET @pt = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SELECT ST_AsText(ST_Buffer(@pt, 0));\n+------------------------------+\n| ST_AsText(ST_Buffer(@pt, 0)) |\n+------------------------------+\n| POINT(0 0) |\n+------------------------------+\n\nST_Buffer() supports negative distances for Polygon and MultiPolygon\nvalues, and for geometry collections containing Polygon or MultiPolygon\nvalues. The result may be an empty geometry. An ER_WRONG_ARGUMENTS\nerror occurs for ST_Buffer() with a negative distance for Point,\nMultiPoint, LineString, and MultiLineString values, and for geometry\ncollections not containing any Polygon or MultiPolygon values.\n\nAs of MySQL 5.7.7, ST_Buffer() permits up to three optional strategy\narguments following the distance argument. Strategies influence buffer\ncomputation. These arguments are byte string values produced by the\nST_Buffer_Strategy() function, to be used for point, join, and end\nstrategies:\n\no Point strategies apply to Point and MultiPoint geometries. If no\n point strategy is specified, the default is\n ST_Buffer_Strategy(\'point_circle\', 32).\n\no Join strategies apply to LineString, MultiLineString, Polygon, and\n MultiPolygon geometries. If no join strategy is specified, the\n default is ST_Buffer_Strategy(\'join_round\', 32).\n\no End strategies apply to LineString and MultiLineString geometries. If\n no end strategy is specified, the default is\n ST_Buffer_Strategy(\'end_round\', 32).\n\nUp to one strategy of each type may be specified, and they may be given\nin any order. If multiple strategies of a given type are specified, an\nER_WRONG_ARGUMENTS error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @pt = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SET @pt_strategy = ST_Buffer_Strategy(\'point_square\');\nmysql> SELECT ST_AsText(ST_Buffer(@pt, 2, @pt_strategy));\n+--------------------------------------------+\n| ST_AsText(ST_Buffer(@pt, 2, @pt_strategy)) |\n+--------------------------------------------+\n| POLYGON((-2 -2,2 -2,2 2,-2 2,-2 -2)) |\n+--------------------------------------------+\n\nmysql> SET @ls = ST_GeomFromText(\'LINESTRING(0 0,0 5,5 5)\');\nmysql> SET @end_strategy = ST_Buffer_Strategy(\'end_flat\');\nmysql> SET @join_strategy = ST_Buffer_Strategy(\'join_round\', 10);\nmysql> SELECT ST_AsText(ST_Buffer(@ls, 5, @end_strategy, @join_strategy))\n+---------------------------------------------------------------+\n| ST_AsText(ST_Buffer(@ls, 5, @end_strategy, @join_strategy)) |\n+---------------------------------------------------------------+\n| POLYGON((5 5,5 10,0 10,-3.5355339059327373 8.535533905932738, |\n| -5 5,-5 0,0 0,5 0,5 5)) |\n+---------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (508,20,'ST_BUFFER_STRATEGY','ST_Buffer_Strategy(strategy[, points_per_circle])\n\nThis function returns a strategy byte string for use with ST_Buffer()\nto influence buffer computation. If any argument is NULL, the return\nvalue is NULL. If any argument is invalid, an ER_WRONG_ARGUMENTS error\noccurs.\n\nInformation about strategies is available at Boost.org\n(http://www.boost.org).\n\nThe first argument must be a string indicating a strategy option:\n\no For point strategies, permitted values are \'point_circle\' and\n \'point_square\'.\n\no For join strategies, permitted values are \'join_round\' and\n \'join_miter\'.\n\no For end strategies, permitted values are \'end_round\' and \'end_flat\'.\n\nIf the first argument is \'point_circle\', \'join_round\', \'join_miter\', or\n\'end_round\', the points_per_circle argument must be given as a positive\nnumeric value. The maximum points_per_circle value is the value of the\nmax_points_in_geometry system variable as of MySQL 5.7.8, 65,536 before\nthat. If the first argument is \'point_square\' or \'end_flat\', the\npoints_per_circle argument must not be given or an ER_WRONG_ARGUMENTS\nerror occurs.\n\nFor examples, see the description of ST_Buffer().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (509,32,'ST_CENTROID','ST_Centroid({poly|mpoly})\n\nReturns the mathematical centroid for the Polygon or MultiPolygon\nargument as a Point. The result is not guaranteed to be on the\nMultiPolygon. If the argument is NULL or an empty geometry, the return\nvalue is NULL.\n\nThis function processes geometry collections by computing the centroid\npoint for components of highest dimension in the collection. Such\ncomponents are extracted and made into a single MultiPolygon,\nMultiLineString, or MultiPoint for centroid computation. If the\nargument is an empty geometry collection, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n ST_GeomFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))\');\nmysql> SELECT ST_GeometryType(@poly),ST_AsText(ST_Centroid(@poly));\n+------------------------+--------------------------------------------+\n| ST_GeometryType(@poly) | ST_AsText(ST_Centroid(@poly)) |\n+------------------------+--------------------------------------------+\n| POLYGON | POINT(4.958333333333333 4.958333333333333) |\n+------------------------+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (510,19,'ST_CONTAINS','ST_Contains(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as ST_Within().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (511,20,'ST_CONVEXHULL','ST_ConvexHull(g)\n\nReturns a geometry that represents the convex hull of the geometry\nvalue g. If the argument is NULL, the return value is NULL.\n\nThis function computes a geometry\'s convex hull by first checking\nwhether its vertex points are colinear. The function returns a linear\nhull if so, a polygon hull otherwise. This function processes geometry\ncollections by extracting all vertex points of all components of the\ncollection, creating a MultiPoint value from them, and computing its\nconvex hull. If the argument is an empty geometry collection, the\nreturn value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g = \'MULTIPOINT(5 0,25 0,15 10,15 25)\';\nmysql> SELECT ST_AsText(ST_ConvexHull(ST_GeomFromText(@g)));\n+-----------------------------------------------+\n| ST_AsText(ST_ConvexHull(ST_GeomFromText(@g))) |\n+-----------------------------------------------+\n| POLYGON((5 0,25 0,15 25,5 0)) |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (512,19,'ST_CROSSES','ST_Crosses(g1, g2)\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect.\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries.\n\no Their intersection is not equal to either of the two given\n geometries.\n\nThis function returns 1 or 0 to indicate whether g1 spatially crosses\ng2. If g1 is a Polygon or a MultiPolygon, or if g2 is a Point or a\nMultiPoint, the return value is NULL.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if the first\nargument is a Polygon or MultiPolygon and/or the second argument is a\nPoint or MultiPoint.\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if the first\nargument is a Polygon or MultiPolygon and/or the second argument is a\nPoint or MultiPoint.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (513,20,'ST_DIFFERENCE','ST_Difference(g1, g2)\n\nReturns a geometry that represents the point set difference of the\ngeometry values g1 and g2. If any argument is NULL, the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(1 1) |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (514,18,'ST_DIMENSION','ST_Dimension(g)\n\nReturns the inherent dimension of the geometry value g, or NULL if the\nargument is NULL. The dimension can be −1, 0, 1, or 2. The meaning of\nthese values is given in\nhttp://dev.mysql.com/doc/refman/5.7/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_Dimension(ST_GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------------+\n| ST_Dimension(ST_GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------------+\n| 1 |\n+------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (515,19,'ST_DISJOINT','ST_Disjoint(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (516,19,'ST_DISTANCE','ST_Distance(g1, g2)\n\nReturns the distance between g1 and g2. If either argument is NULL or\nan empty geometry, the return value is NULL.\n\nThis function processes geometry collections by returning the shortest\ndistance among all combinations of the components of the two geometry\narguments.\n\nIf an intermediate or final result produces NaN or a negative number,\nan ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = Point(1,1);\nmysql> SET @g2 = Point(2,2);\nmysql> SELECT ST_Distance(@g1, @g2);\n+-----------------------+\n| ST_Distance(@g1, @g2) |\n+-----------------------+\n| 1.4142135623730951 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (517,27,'ST_DISTANCE_SPHERE','ST_Distance_Sphere(g1, g2 [, radius])\n\nReturns the mimimum spherical distance between two points and/or\nmultipoints on a sphere, in meters, or NULL if any geometry argument is\nNULL or empty.\n\nCalculations use a spherical earth and a configurable radius. The\noptional radius argument should be given in meters. If omitted, the\ndefault radius is 6,370,986 meters. An ER_WRONG_ARGUMENTS error occurs\nif the radius argument is present but not positive.\n\nThe geometry arguments should consist of points that specify\n(longitude, latitude) coordinate values:\n\no Longitude and latitude are the first and second coordinates of the\n point, respectively.\n\no Both coordinates are in degrees.\n\no Longitude values must be in the range (-180, 180]. Positive values\n are east of the prime meridian.\n\no Latitude values must be in the range [-90, 90]. Positive values are\n north of the equator.\n\nSupported argument combinations are (Point, Point), (Point,\nMultiPoint), and (MultiPoint, Point). An ER_GIS_UNSUPPORTED_ARGUMENT\nerror occurs for other combinations.\n\nIf any geometry argument is not a syntactically well-formed geometry\nbyte string, an ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @pt1 = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SET @pt2 = ST_GeomFromText(\'POINT(180 0)\');\nmysql> SELECT ST_Distance_Sphere(@pt1, @pt2);\n+--------------------------------+\n| ST_Distance_Sphere(@pt1, @pt2) |\n+--------------------------------+\n| 20015042.813723423 |\n+--------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (518,24,'ST_ENDPOINT','ST_EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_EndPoint(ST_GeomFromText(@ls)));\n+----------------------------------------------+\n| ST_AsText(ST_EndPoint(ST_GeomFromText(@ls))) |\n+----------------------------------------------+\n| POINT(3 3) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (519,18,'ST_ENVELOPE','ST_Envelope(g)\n\nReturns the minimum bounding rectangle (MBR) for the geometry value g,\nor NULL if the argument is NULL. The result is returned as a Polygon\nvalue that is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nmysql> SELECT ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,2 2)\')));\n+----------------------------------------------------------------+\n| ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,2 2)\'))) |\n+----------------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1)) |\n+----------------------------------------------------------------+\n\nAs of MySQL 5.7.6, if the argument is a point or a vertical or\nhorizontal line segment, ST_Envelope() returns the point or the line\nsegment as its MBR rather than returning an invalid polygon:\n\nmysql> SELECT ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,1 2)\')));\n+----------------------------------------------------------------+\n| ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,1 2)\'))) |\n+----------------------------------------------------------------+\n| LINESTRING(1 1,1 2) |\n+----------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (520,19,'ST_EQUALS','ST_Equals(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_Equals(@g1, @g1), ST_Equals(@g1, @g2);\n+---------------------+---------------------+\n| ST_Equals(@g1, @g1) | ST_Equals(@g1, @g2) |\n+---------------------+---------------------+\n| 1 | 0 |\n+---------------------+---------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (521,32,'ST_EXTERIORRING','ST_ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly)));\n+----------------------------------------------------+\n| ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly))) |\n+----------------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (522,27,'ST_GEOHASH','ST_GeoHash(longitude, latitude, max_length), ST_GeoHash(point,\nmax_length)\n\nReturns a geohash string in the connection character set and collation.\n\nIf any argument is NULL, the return value is NULL. If any argument is\ninvalid, an error occurs.\n\nFor the first syntax, the longitude must be a number in the range\n[−180, 180], and the latitude must be a number in the range [−90,\n90]. For the second syntax, a POINT value is required, where the X and\nY coordinates are in the valid ranges for longitude and latitude,\nrespectively.\n\nThe resulting string is no longer than max_length characters, which has\nan upper limit of 100. The string might be shorter than max_length\ncharacters because the algorithm that creates the geohash value\ncontinues until it has created a string that is either an exact\nrepresentation of the location or max_length characters, whichever\ncomes first.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SELECT ST_GeoHash(180,0,10), ST_GeoHash(-180,-90,15);\n+----------------------+-------------------------+\n| ST_GeoHash(180,0,10) | ST_GeoHash(-180,-90,15) |\n+----------------------+-------------------------+\n| xbpbpbpbpb | 000000000000000 |\n+----------------------+-------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (523,41,'ST_GEOMCOLLFROMTEXT','ST_GeomCollFromText(wkt[, srid]), ST_GeometryCollectionFromText(wkt[,\nsrid]), ST_GeomCollFromTxt(wkt[, srid])\n\nConstructs a GeometryCollection value using its WKT representation and\nSRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','mysql> SET @g = "MULTILINESTRING((10 10, 11 11), (9 9, 10 10))";\nmysql> SELECT ST_AsText(ST_GeomCollFromText(@g));\n+--------------------------------------------+\n| ST_AsText(ST_GeomCollFromText(@g)) |\n+--------------------------------------------+\n| MULTILINESTRING((10 10,11 11),(9 9,10 10)) |\n+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (524,40,'ST_GEOMCOLLFROMWKB','ST_GeomCollFromWKB(wkb[, srid]), ST_GeometryCollectionFromWKB(wkb[,\nsrid])\n\nConstructs a GeometryCollection value using its WKB representation and\nSRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (525,20,'ST_GEOMETRYN','ST_GeometryN(gc, N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1. If any argument is NULL or\nthe geometry argument is an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1));\n+-------------------------------------------------+\n| ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1)) |\n+-------------------------------------------------+\n| POINT(1 1) |\n+-------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (526,18,'ST_GEOMETRYTYPE','ST_GeometryType(g)\n\nReturns a binary string indicating the name of the geometry type of\nwhich the geometry instance g is a member, or NULL if the argument is\nNULL. The name corresponds to one of the instantiable Geometry\nsubclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_GeometryType(ST_GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------------+\n| ST_GeometryType(ST_GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------------+\n| POINT |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (527,27,'ST_GEOMFROMGEOJSON','ST_GeomFromGeoJSON(str [, options [, srid]])\n\nParses a string str representing a GeoJSON object and returns a\ngeometry.\n\nIf any argument is NULL, the return value is NULL. If any non-NULL\nargument is invalid, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html\n\n','mysql> SET @json = \'{ "type": "Point", "coordinates": [102.0, 0.0]}\';\nmysql> SELECT ST_AsText(ST_GeomFromGeoJSON(@json));\n+--------------------------------------+\n| ST_AsText(ST_GeomFromGeoJSON(@json)) |\n+--------------------------------------+\n| POINT(102 0) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (528,41,'ST_GEOMFROMTEXT','ST_GeomFromText(wkt[, srid]), ST_GeometryFromText(wkt[, srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (529,40,'ST_GEOMFROMWKB','ST_GeomFromWKB(wkb[, srid]), ST_GeometryFromWKB(wkb[, srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (530,32,'ST_INTERIORRINGN','ST_InteriorRingN(poly, N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1. If the argument is\nNULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1));\n+-------------------------------------------------------+\n| ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1)) |\n+-------------------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+-------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (531,20,'ST_INTERSECTION','ST_Intersection(g1, g2)\n\nReturns a geometry that represents the point set intersection of the\ngeometry values g1 and g2. If any argument is NULL, the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = ST_GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT ST_AsText(ST_Intersection(@g1, @g2));\n+--------------------------------------+\n| ST_AsText(ST_Intersection(@g1, @g2)) |\n+--------------------------------------+\n| POINT(2 2) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (532,19,'ST_INTERSECTS','ST_Intersects(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (533,24,'ST_ISCLOSED','ST_IsClosed(ls)\n\nFor a LineString value ls, ST_IsClosed() returns 1 if ls is closed\n(that is, its ST_StartPoint() and ST_EndPoint() values are the same).\nIf the argument is NULL or an empty geometry, the return value is NULL.\n\nFor a MultiLineString value ls, ST_IsClosed() returns 1 if ls is closed\n(that is, the ST_StartPoint() and ST_EndPoint() values are the same for\neach LineString in ls).\n\nST_IsClosed() returns 0 if ls is not closed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls1 = \'LineString(1 1,2 2,3 3,2 2)\';\nmysql> SET @ls2 = \'LineString(1 1,2 2,3 3,1 1)\';\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls1));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls1)) |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls2));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls2)) |\n+------------------------------------+\n| 1 |\n+------------------------------------+\n\nmysql> SET @ls3 = \'MultiLineString((1 1,2 2,3 3),(4 4,5 5))\';\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls3));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls3)) |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (534,18,'ST_ISEMPTY','ST_IsEmpty(g)\n\nThis function is a placeholder that returns 0 for any valid geometry\nvalue, 1 for any invalid geometry value, or NULL if the argument is\nNULL.\n\nMySQL does not support GIS EMPTY values such as POINT EMPTY.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (535,18,'ST_ISSIMPLE','ST_IsSimple(g)\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. ST_IsSimple() returns 0 if\nthe argument is not simple, and NULL if the argument is NULL.\n\nThe descriptions of the instantiable geometric classes given under\nhttp://dev.mysql.com/doc/refman/5.7/en/opengis-geometry-model.html\nincludes the specific conditions that cause class instances to be\nclassified as not simple.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (536,27,'ST_ISVALID','ST_IsValid(g)\n\nReturns 1 if the argument is syntactically well-formed and is\ngeometrically valid, 0 if the argument is not syntactically well-formed\nor is not geometrically valid. If the argument is NULL, the return\nvalue is NULL. Geometry validity is defined by the OGC specification.\n\nThe only valid empty geometry is represented in the form of an empty\ngeometry collection value. ST_IsValid() returns 1 in this case.\n\nST_IsValid() works only for the Cartesian coordinate system and\nrequires a geometry argument with an SRID of 0. An ER_WRONG_ARGUMENTS\nerror occurs otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @ls1 = ST_GeomFromText(\'LINESTRING(0 0,-0.00 0,0.0 0)\');\nmysql> SET @ls2 = ST_GeomFromText(\'LINESTRING(0 0, 1 1)\');\nmysql> SELECT ST_IsValid(@ls1);\n+------------------+\n| ST_IsValid(@ls1) |\n+------------------+\n| 0 |\n+------------------+\nmysql> SELECT ST_IsValid(@ls2);\n+------------------+\n| ST_IsValid(@ls2) |\n+------------------+\n| 1 |\n+------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (537,27,'ST_LATFROMGEOHASH','ST_LatFromGeoHash(geohash_str)\n\nReturns the latitude from a geohash string value, as a DOUBLE value in\nthe range [−90, 90].\n\nIf the argument is NULL, the return value is NULL. If the argument is\ninvalid, an error occurs.\n\nThe ST_LatFromGeoHash() decoding function reads no more than 433\ncharacters from the geohash_str argument. That represents the upper\nlimit on information in the internal representation of coordinate\nvalues. Characters past the 433rd are ignored, even if they are\notherwise illegal and produce an error.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SELECT ST_LatFromGeoHash(ST_GeoHash(45,-20,10));\n+------------------------------------------+\n| ST_LatFromGeoHash(ST_GeoHash(45,-20,10)) |\n+------------------------------------------+\n| -20 |\n+------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (538,24,'ST_LENGTH','ST_Length(ls)\n\nReturns a double-precision number indicating the length of the\nLineString or MultiLineString value ls in its associated spatial\nreference. The length of a MultiLineString value is equal to the sum of\nthe lengths of its elements. If the argument is NULL or an empty\ngeometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_Length(ST_GeomFromText(@ls));\n+---------------------------------+\n| ST_Length(ST_GeomFromText(@ls)) |\n+---------------------------------+\n| 2.8284271247461903 |\n+---------------------------------+\n\nmysql> SET @mls = \'MultiLineString((1 1,2 2,3 3),(4 4,5 5))\';\nmysql> SELECT ST_Length(ST_GeomFromText(@mls));\n+----------------------------------+\n| ST_Length(ST_GeomFromText(@mls)) |\n+----------------------------------+\n| 4.242640687119286 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (539,41,'ST_LINEFROMTEXT','ST_LineFromText(wkt[, srid]), ST_LineStringFromText(wkt[, srid])\n\nConstructs a LineString value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (540,40,'ST_LINEFROMWKB','ST_LineFromWKB(wkb[, srid]), ST_LineStringFromWKB(wkb[, srid])\n\nConstructs a LineString value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (541,27,'ST_LONGFROMGEOHASH','ST_LongFromGeoHash(geohash_str)\n\nReturns the longitude from a geohash string value, as a DOUBLE value in\nthe range [−180, 180].\n\nIf the argument is NULL, the return value is NULL. If the argument is\ninvalid, an error occurs.\n\nThe remarks in the description of ST_LatFromGeoHash() regarding the\nmaximum number of characters processed from the geohash_str argument\nalso apply to ST_LongFromGeoHash().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SELECT ST_LongFromGeoHash(ST_GeoHash(45,-20,10));\n+-------------------------------------------+\n| ST_LongFromGeoHash(ST_GeoHash(45,-20,10)) |\n+-------------------------------------------+\n| 45 |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (542,27,'ST_MAKEENVELOPE','ST_MakeEnvelope(pt1, pt2)\n\nReturns the rectangle that forms the envelope around two points, as a\nPoint, LineString, or Polygon. If any argument is NULL, the return\nvalue is NULL.\n\nCalculations are done using the Cartesian coordinate system rather than\non a sphere, spheroid, or on earth.\n\nGiven two points pt1 and pt2, ST_MakeEnvelope() creates the result\ngeometry on an abstract plane like this:\n\no If pt1 and pt2 are equal, the result is the point pt1.\n\no Otherwise, if (pt1, pt2) is a vertical or horizontal line segment,\n the result is the line segment (pt1, pt2).\n\no Otherwise, the result is a polygon using pt1 and pt2 as diagonal\n points.\n\nThe result geometry has an SRID of 0.\n\nST_MakeEnvelope() requires Point geometry arguments with an SRID of 0.\nAn ER_WRONG_ARGUMENTS error occurs otherwise.\n\nIf any argument is not a syntactically well-formed geometry byte\nstring, or if any coordinate value of the two points is infinite or\nNaN, an ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @pt1 = ST_GeomFromText(\'POINT(0 0)\');\nmysql> SET @pt2 = ST_GeomFromText(\'POINT(1 1)\');\nmysql> SELECT ST_AsText(ST_MakeEnvelope(@pt1, @pt2));\n+----------------------------------------+\n| ST_AsText(ST_MakeEnvelope(@pt1, @pt2)) |\n+----------------------------------------+\n| POLYGON((0 0,1 0,1 1,0 1,0 0)) |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (543,41,'ST_MLINEFROMTEXT','ST_MLineFromText(wkt[, srid]), ST_MultiLineStringFromText(wkt[, srid])\n\nConstructs a MultiLineString value using its WKT representation and\nSRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (544,40,'ST_MLINEFROMWKB','ST_MLineFromWKB(wkb[, srid]), ST_MultiLineStringFromWKB(wkb[, srid])\n\nConstructs a MultiLineString value using its WKB representation and\nSRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (545,41,'ST_MPOINTFROMTEXT','ST_MPointFromText(wkt[, srid]), ST_MultiPointFromText(wkt[, srid])\n\nConstructs a MultiPoint value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nAs of MySQL 5.7.9, spatial functions such as ST_MPointFromText() and\nST_GeomFromText() that accept WKT-format representations of MultiPoint\nvalues permit individual points within values to be surrounded by\nparentheses. For example, both of the following function calls are\nvalid, whereas before MySQL 5.7.9 the second one produces an error:\n\nST_MPointFromText(\'MULTIPOINT (1 1, 2 2, 3 3)\')\nST_MPointFromText(\'MULTIPOINT ((1 1), (2 2), (3 3))\')\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (546,40,'ST_MPOINTFROMWKB','ST_MPointFromWKB(wkb[, srid]), ST_MultiPointFromWKB(wkb[, srid])\n\nConstructs a MultiPoint value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (547,41,'ST_MPOLYFROMTEXT','ST_MPolyFromText(wkt[, srid]), ST_MultiPolygonFromText(wkt[, srid])\n\nConstructs a MultiPolygon value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (548,40,'ST_MPOLYFROMWKB','ST_MPolyFromWKB(wkb[, srid]), ST_MultiPolygonFromWKB(wkb[, srid])\n\nConstructs a MultiPolygon value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (549,20,'ST_NUMGEOMETRIES','ST_NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc. If\nthe argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT ST_NumGeometries(ST_GeomFromText(@gc));\n+----------------------------------------+\n| ST_NumGeometries(ST_GeomFromText(@gc)) |\n+----------------------------------------+\n| 2 |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (550,32,'ST_NUMINTERIORRINGS','ST_NumInteriorRing(poly), ST_NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly. If the\nargument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_NumInteriorRings(ST_GeomFromText(@poly));\n+---------------------------------------------+\n| ST_NumInteriorRings(ST_GeomFromText(@poly)) |\n+---------------------------------------------+\n| 1 |\n+---------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (551,24,'ST_NUMPOINTS','ST_NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls. If the\nargument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_NumPoints(ST_GeomFromText(@ls));\n+------------------------------------+\n| ST_NumPoints(ST_GeomFromText(@ls)) |\n+------------------------------------+\n| 3 |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (552,19,'ST_OVERLAPS','ST_Overlaps(g1, g2)\n\nTwo geometries spatially overlap if they intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nThis function returns 1 or 0 to indicate whether g1 spatially overlaps\ng2.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if called with\ngeometries of different dimensions or any argument is a Point.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (553,27,'ST_POINTFROMGEOHASH','ST_PointFromGeoHash(geohash_str, srid)\n\nReturns a POINT value containing the decoded geohash value, given a\ngeohash string value.\n\nThe X and Y coordinates of the point are the longitude in the range\n[−180, 180] and the latitude in the range [−90, 90], respectively.\n\nIf any argument is NULL, the return value is NULL. If any argument is\ninvalid, an error occurs.\n\nThe srid argument is an unsigned 32-bit integer.\n\nThe remarks in the description of ST_LatFromGeoHash() regarding the\nmaximum number of characters processed from the geohash_str argument\nalso apply to ST_PointFromGeoHash().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html\n\n','mysql> SET @gh = ST_GeoHash(45,-20,10);\nmysql> SELECT ST_AsText(ST_PointFromGeoHash(@gh,0));\n+---------------------------------------+\n| ST_AsText(ST_PointFromGeoHash(@gh,0)) |\n+---------------------------------------+\n| POINT(45 -20) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-geohash-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (554,41,'ST_POINTFROMTEXT','ST_PointFromText(wkt[, srid])\n\nConstructs a Point value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (555,40,'ST_POINTFROMWKB','ST_PointFromWKB(wkb[, srid])\n\nConstructs a Point value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (556,24,'ST_POINTN','ST_PointN(ls, N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1. If any argument is NULL or the geometry argument is\nan empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_PointN(ST_GeomFromText(@ls),2));\n+----------------------------------------------+\n| ST_AsText(ST_PointN(ST_GeomFromText(@ls),2)) |\n+----------------------------------------------+\n| POINT(2 2) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (557,41,'ST_POLYFROMTEXT','ST_PolyFromText(wkt[, srid]), ST_PolygonFromText(wkt[, srid])\n\nConstructs a Polygon value using its WKT representation and SRID.\n\nIf the geometry argument is NULL or not a syntactically well-formed\ngeometry, or if the SRID argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (558,40,'ST_POLYFROMWKB','ST_PolyFromWKB(wkb[, srid]), ST_PolygonFromWKB(wkb[, srid])\n\nConstructs a Polygon value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (559,27,'ST_SIMPLIFY','ST_Simplify(g, max_distance)\n\nSimplifies a geometry using the Douglas-Peucker algorithm and returns a\nsimplified value of the same type. If any argument is NULL, the return\nvalue is NULL.\n\nThe geometry may be any geometry type, although the Douglas-Peucker\nalgorithm may not actually process every type. A geometry collection is\nprocessed by giving its components one by one to the simplification\nalgorithm, and the returned geometries are put into a geometry\ncollection as result.\n\nThe max_distance argument is the distance (in units of the input\ncoordinates) of a vertex to other segments to be removed. Vertices\nwithin this distance of the simplified linestring are removed. If the\nmax_distance argument is not positive, or is NaN, an ER_WRONG_ARGUMENTS\nerror occurs.\n\nAccording to Boost.Geometry, geometries might become invalid as a\nresult of the simplification process, and the process might create\nself-intersections. To check the validity of the result, pass it to\nST_IsValid().\n\nIf the geometry argument is not a syntactically well-formed geometry\nbyte string, an ER_GIS_INVALID_DATA error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @g = ST_GeomFromText(\'LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3)\');\nmysql> SELECT ST_AsText(ST_Simplify(@g, 0.5));\n+---------------------------------+\n| ST_AsText(ST_Simplify(@g, 0.5)) |\n+---------------------------------+\n| LINESTRING(0 0,0 1,1 1,2 3,3 3) |\n+---------------------------------+\nmysql> SELECT ST_AsText(ST_Simplify(@g, 1.0));\n+---------------------------------+\n| ST_AsText(ST_Simplify(@g, 1.0)) |\n+---------------------------------+\n| LINESTRING(0 0,3 3) |\n+---------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (560,18,'ST_SRID','ST_SRID(g)\n\nReturns an integer indicating the spatial reference system ID\nassociated with the geometry value g, or NULL if the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_SRID(ST_GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------------+\n| ST_SRID(ST_GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------------+\n| 101 |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (561,24,'ST_STARTPOINT','ST_StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\nIf the argument is NULL or an empty geometry, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_StartPoint(ST_GeomFromText(@ls)));\n+------------------------------------------------+\n| ST_AsText(ST_StartPoint(ST_GeomFromText(@ls))) |\n+------------------------------------------------+\n| POINT(1 1) |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (562,20,'ST_SYMDIFFERENCE','ST_SymDifference(g1, g2)\n\nReturns a geometry that represents the point set symmetric difference\nof the geometry values g1 and g2, which is defined as:\n\ng1 symdifference g2 := (g1 union g2) difference (g1 intersection g2)\n\nOr, in function call notation:\n\nST_SymDifference(g1, g2) = ST_Difference(ST_Union(g1, g2), ST_Intersection(g1, g2))\n\nIf any argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_AsText(ST_SymDifference(@g1, @g2));\n+---------------------------------------+\n| ST_AsText(ST_SymDifference(@g1, @g2)) |\n+---------------------------------------+\n| MULTIPOINT((1 1),(2 2)) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (563,19,'ST_TOUCHES','ST_Touches(g1, g2)\n\nTwo geometries spatially touch if their interiors do not intersect, but\nthe boundary of one of the geometries intersects either the boundary or\nthe interior of the other.\n\nThis function returns 1 or 0 to indicate whether g1 spatially touches\ng2.\n\nThis function returns 0 if called with an inapplicable geometry\nargument type combination. For example, it returns 0 if either of the\narguments is a Point or MultiPoint.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (564,20,'ST_UNION','ST_Union(g1, g2)\n\nReturns a geometry that represents the point set union of the geometry\nvalues g1 and g2. If any argument is NULL, the return value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = ST_GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT ST_AsText(ST_Union(@g1, @g2));\n+--------------------------------------+\n| ST_AsText(ST_Union(@g1, @g2)) |\n+--------------------------------------+\n| MULTILINESTRING((1 1,3 3),(1 3,3 1)) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (565,27,'ST_VALIDATE','ST_Validate(g)\n\nValidates a geometry according to the OGC specification. A geometry can\nbe syntactically well-formed (WKB value plus SRID) but geometrically\ninvalid. For example, this polygon is geometrically invalid: POLYGON((0\n0, 0 0, 0 0, 0 0, 0 0))\n\nST_Validate() returns the geometry if it is syntactically well-formed\nand is geometrically valid, NULL if the argument is not syntactically\nwell-formed or is not geometrically valid or is NULL.\n\nST_Validate() can be used to filter out invalid geometry data, although\nat a cost. For applications that require more precise results not\ntainted by invalid data, this penalty may be worthwhile.\n\nIf the geometry argument is valid, it is returned as is, except that if\nan input Polygon or MultiPolygon has clockwise rings, those rings are\nreversed before checking for validity. If the geometry is valid, the\nvalue with the reversed rings is returned.\n\nThe only valid empty geometry is represented in the form of an empty\ngeometry collection value. ST_Validate() returns it directly without\nfurther checks in this case.\n\nST_Validate() works only for the Cartesian coordinate system and\nrequires a geometry argument with an SRID of 0. An ER_WRONG_ARGUMENTS\nerror occurs otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html\n\n','mysql> SET @ls1 = ST_GeomFromText(\'LINESTRING(0 0)\');\nmysql> SET @ls2 = ST_GeomFromText(\'LINESTRING(0 0, 1 1)\');\nmysql> SELECT ST_AsText(ST_Validate(@ls1));\n+------------------------------+\n| ST_AsText(ST_Validate(@ls1)) |\n+------------------------------+\n| NULL |\n+------------------------------+\nmysql> SELECT ST_AsText(ST_Validate(@ls2));\n+------------------------------+\n| ST_AsText(ST_Validate(@ls2)) |\n+------------------------------+\n| LINESTRING(0 0,1 1) |\n+------------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (566,19,'ST_WITHIN','ST_Within(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as ST_Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (567,31,'ST_X','ST_X(p)\n\nReturns the X-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','mysql> SELECT ST_X(Point(56.7, 53.34));\n+--------------------------+\n| ST_X(Point(56.7, 53.34)) |\n+--------------------------+\n| 56.7 |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (568,31,'ST_Y','ST_Y(p)\n\nReturns the Y-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','mysql> SELECT ST_Y(Point(56.7, 53.34));\n+--------------------------+\n| ST_Y(Point(56.7, 53.34)) |\n+--------------------------+\n| 53.34 |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (569,11,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\n\nThe second form enables the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (570,35,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (571,35,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (572,35,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (573,11,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 − expr2 expressed as a value in the same\nformat as expr1. expr1 is a time or datetime expression, and expr2 is a\ntime expression.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (574,14,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used to sum only the distinct values\nof expr.\n\nIf there are no matching rows, SUM() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (575,11,'SYSDATE','Syntax:\nSYSDATE([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (576,22,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (577,29,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (578,10,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 − 1) characters.\nThe effective maximum length is less if the value contains multibyte\ncharacters. Each TEXT value is stored using a 2-byte length prefix that\nindicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (579,10,'TIME','TIME[(fsp)]\n\nA time. The range is \'-838:59:59.000000\' to \'838:59:59.000000\'. MySQL\ndisplays TIME values in \'HH:MM:SS[.fraction]\' format, but permits\nassignment of values to TIME columns using either strings or numbers.\n\nAn optional fsp value in the range from 0 to 6 may be given to specify\nfractional seconds precision. A value of 0 signifies that there is no\nfractional part. If omitted, the default precision is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (580,11,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (581,11,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 − expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nThe result returned by TIMEDIFF() is limited to the range allowed for\nTIME values. Alternatively, you can use either of the functions\nTIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n -> \'2000:01:01 00:00:00.000001\');\n -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n -> \'2008-12-30 01:01:01.000002\');\n -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (582,10,'TIMESTAMP','TIMESTAMP[(fsp)]\n\nA timestamp. The range is \'1970-01-01 00:00:01.000000\' UTC to\n\'2038-01-19 03:14:07.999999\' UTC. TIMESTAMP values are stored as the\nnumber of seconds since the epoch (\'1970-01-01 00:00:00\' UTC). A\nTIMESTAMP cannot represent the value \'1970-01-01 00:00:00\' because that\nis equivalent to 0 seconds from the epoch and the value 0 is reserved\nfor representing \'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nAn optional fsp value in the range from 0 to 6 may be given to specify\nfractional seconds precision. A value of 0 signifies that there is no\nfractional part. If omitted, the default precision is 0.\n\nThe way the server handles TIMESTAMP definitions depends on the value\nof the explicit_defaults_for_timestamp system variable (see\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html).\n\nIf explicit_defaults_for_timestamp is enabled, there is no automatic\nassignment of the DEFAULT CURRENT_TIMESTAMP or ON UPDATE\nCURRENT_TIMESTAMP attributes to any TIMESTAMP column. They must be\nincluded explicitly in the column definition. Also, any TIMESTAMP not\nexplicitly declared as NOT NULL permits NULL values.\n\nIf explicit_defaults_for_timestamp is disabled, the server handles\nTIMESTAMP as follows:\n\nUnless specified otherwise, the first TIMESTAMP column in a table is\ndefined to be automatically set to the date and time of the most recent\nmodification if not explicitly assigned a value. This makes TIMESTAMP\nuseful for recording the timestamp of an INSERT or UPDATE operation.\nYou can also set any TIMESTAMP column to the current date and time by\nassigning it a NULL value, unless it has been defined with the NULL\nattribute to permit NULL values.\n\nAutomatic initialization and updating to the current date and time can\nbe specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE\nCURRENT_TIMESTAMP column definition clauses. By default, the first\nTIMESTAMP column has these properties, as previously noted. However,\nany TIMESTAMP column in a table can be defined to have these\nproperties.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (583,11,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (584,11,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: MICROSECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (585,11,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 − datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n -> 128885\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (586,11,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (587,11,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n -> 2378\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (588,10,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 − 1) bytes. Each\nTINYBLOB value is stored using a 1-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (589,10,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (590,10,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 − 1) characters. The\neffective maximum length is less if the value contains multibyte\ncharacters. Each TINYTEXT value is stored using a 1-byte length prefix\nthat indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (591,19,'TOUCHES','Touches(g1, g2)\n\nST_Touches() and Touches() are synonyms. For more information, see the\ndescription of ST_Touches().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (592,35,'TO_BASE64','Syntax:\nTO_BASE64(str)\n\nConverts the string argument to base-64 encoded form and returns the\nresult as a character string with the connection character set and\ncollation. If the argument is not a string, it is converted to a string\nbefore conversion takes place. The result is NULL if the argument is\nNULL. Base-64 encoded strings can be decoded using the FROM_BASE64()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (593,11,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n -> 733321\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (594,11,'TO_SECONDS','Syntax:\nTO_SECONDS(expr)\n\nGiven a date or datetime expr, returns the number of seconds since the\nyear 0. If expr is not a valid date or datetime value, returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT TO_SECONDS(950501);\n -> 62966505600\nmysql> SELECT TO_SECONDS(\'2009-11-29\');\n -> 63426672000\nmysql> SELECT TO_SECONDS(\'2009-11-29 13:43:32\');\n -> 63426721412\nmysql> SELECT TO_SECONDS( NOW() );\n -> 63426721458\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (595,35,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT TRIM(\' bar \');\n -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (596,23,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/boolean-literals.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/boolean-literals.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (597,29,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n -> 1028\n','http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (598,8,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n back. See\n http://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table or NDB table if there are\n any FOREIGN KEY constraints from other tables that reference the\n table. Foreign key constraints between columns of the same table are\n permitted.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n even for MyISAM and InnoDB, which normally do not reuse sequence\n values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/truncate-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (599,35,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (600,12,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (601,12,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n -> 30\n','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (602,35,'UNHEX','Syntax:\n\nUNHEX(str)\n\nFor a string argument str, UNHEX(str) interprets each pair of\ncharacters in the argument as a hexadecimal number and converts it to\nthe byte represented by the number. The return value is a binary\nstring.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n -> \'MySQL\'\nmysql> SELECT X\'4D7953514C\';\n -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (603,30,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin system table. UNINSTALL PLUGIN is\nthe complement of INSTALL PLUGIN.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\nsystem table, so that subsequent server restarts will not load and\ninitialize the plugin. UNINSTALL PLUGIN does not remove the plugin\'s\nshared library file.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/uninstall-plugin.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (604,9,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/union.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (605,11,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC). The return value is an integer if no\nargument is given or the argument does not include a fractional seconds\npart, or DECIMAL if an argument is given that includes a fractional\nseconds part.\n\nIf UNIX_TIMESTAMP() is called with a date argument, it returns the\nvalue of the argument as seconds since \'1970-01-01 00:00:00\' UTC. The\ndate argument may be a DATE, DATETIME, or TIMESTAMP string, or a number\nin YYMMDD, YYMMDDHHMMSS, YYYYMMDD, or YYYYMMDDHHMMSS format. If the\nargument includes a time part, it may optionally include a fractional\nseconds part. The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n -> 1447431666\nmysql> SELECT UNIX_TIMESTAMP(\'2015-11-13 10:20:19\');\n -> 1447431619\nmysql> SELECT UNIX_TIMESTAMP(\'2015-11-13 10:20:19.012\');\n -> 1447431619.012\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (606,9,'UPDATE','Syntax:\nUPDATE is a DML statement that modifies rows in a table.\n\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n SET assignment_list\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nvalue:\n {expr | DEFAULT}\n\nassignment:\n col_name = value\n\nassignment_list:\n assignment [, assignment] ...\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET assignment_list\n [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. Each matching row is\nupdated once, even if it matches the conditions multiple times. For\nmultiple-table syntax, ORDER BY and LIMIT cannot be used.\n\nFor partitioned tables, both the single-single and multiple-table forms\nof this statement support the use of a PARTITION option as part of a\ntable reference. This option takes a list of one or more partitions or\nsubpartitions (or both). Only the partitions (or subpartitions) listed\nare checked for matches, and a row that is not in any of these\npartitions or subpartitions is not updated, whether it satisfies the\nwhere_condition or not.\n\n*Note*:\n\nUnlike the case when using PARTITION with an INSERT or REPLACE\nstatement, an otherwise valid UPDATE ... PARTITION statement is\nconsidered successful even if no rows in the listed partitions (or\nsubpartitions) match the where_condition.\n\nFor more information and examples, see\nhttp://dev.mysql.com/doc/refman/5.7/en/partitioning-selection.html.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated. For expression syntax, see\nhttp://dev.mysql.com/doc/refman/5.7/en/expressions.html.\n\ntable_references and where_condition are specified as described in\nhttp://dev.mysql.com/doc/refman/5.7/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no With the LOW_PRIORITY modifier, execution of the UPDATE is delayed\n until no other clients are reading from the table. This affects only\n storage engines that use only table-level locking (such as MyISAM,\n MEMORY, and MERGE).\n\no With the IGNORE modifier, the update statement does not abort even if\n errors occur during the update. Rows for which duplicate-key\n conflicts occur on a unique key value are not updated. Rows updated\n to values that would cause data conversion errors are updated to the\n closest valid values instead. For more information, see\n http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#ignore-strict-co\n mparison.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/update.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (607,35,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user.\n\nIf no expression matching xpath_expr is found, or if multiple matches\nare found, the function returns the original xml_target XML fragment.\nAll three arguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html\n\n','mysql> SELECT\n -> UpdateXML(\'ccc\', \'/a\', \'fff\') AS val1,\n -> UpdateXML(\'ccc\', \'/b\', \'fff\') AS val2,\n -> UpdateXML(\'ccc\', \'//b\', \'fff\') AS val3,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val4,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val5\n -> \\G\n\n*************************** 1. row ***************************\nval1: fff\nval2: ccc\nval3: fff\nval4: cccfff\nval5: ccc\n','http://dev.mysql.com/doc/refman/5.7/en/xml-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (608,35,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n -> \'HEJ\'\n\nSee the description of LOWER() for information that also applies to\nUPPER(). This included information about how to perform lettercase\nconversion of binary strings (BINARY, VARBINARY, BLOB) for which these\nfunctions are ineffective, and information about case folding for\nUnicode character sets.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (609,39,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable; # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable; # selects from db2.mytable\n\nThe database name must be specified on a single line. Newlines in\ndatabase names are not supported.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/use.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (610,22,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (611,11,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (612,11,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME([fsp])\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (613,11,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP([fsp])\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether the function\nis used in a string or numeric context.\n\nIf the fsp argument is given to specify a fractional seconds precision\nfrom 0 to 6, the return value includes a fractional seconds part of\nthat many digits.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (614,28,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to RFC\n4122, "A Universally Unique IDentifier (UUID) URN Namespace"\n(http://www.ietf.org/rfc/rfc4122.txt).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate devices not\nconnected to each other.\n\n*Warning*:\n\nAlthough UUID() values are intended to be unique, they are not\nnecessarily unguessable or unpredictable. If unpredictability is\nrequired, UUID values should be generated some other way.\n\nUUID() returns a value that conforms to UUID version 1 as described in\nRFC 4122. The value is a 128-bit number represented as a utf8 string of\nfive hexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\nformat:\n\no The first three numbers are generated from the low, middle, and high\n parts of a timestamp. The high part also includes the UUID version\n number.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n uniqueness. A random number is substituted if the latter is not\n available (for example, because the host device has no Ethernet card,\n or it is unknown how to find the hardware address of an interface on\n the host operating system). In this case, spatial uniqueness cannot\n be guaranteed. Nevertheless, a collision should have very low\n probability.\n\n The MAC address of an interface is taken into account only on FreeBSD\n and Linux. On other operating systems, MySQL uses a randomly\n generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n -> \'6ccd780c-baba-1026-9564-5b8c656024db\'\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (615,28,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer.\nValues returned by UUID_SHORT() differ from the string-format 128-bit\nidentifiers returned by the UUID() function and have different\nuniqueness properties. The value of UUID_SHORT() is guaranteed to be\nunique if the following conditions hold:\n\no The server_id value of the current server is between 0 and 255 and is\n unique among your set of master and slave servers\n\no You do not set back the system time for your server host between\n mysqld restarts\n\no You invoke UUID_SHORT() on average fewer than 16 million times per\n second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (616,12,'VALIDATE_PASSWORD_STRENGTH','Syntax:\nVALIDATE_PASSWORD_STRENGTH(str)\n\nGiven an argument representing a cleartext password, this function\nreturns an integer to indicate how strong the password is. The return\nvalue ranges from 0 (weak) to 100 (strong).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (617,28,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in the ON DUPLICATE KEY UPDATE clause of\nINSERT statements and returns NULL otherwise. See\nhttp://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (618,10,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (619,10,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters. See\nhttp://dev.mysql.com/doc/refman/5.7/en/column-count-limit.html.\n\nMySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A\nVARCHAR column uses one length byte if values require no more than 255\nbytes, two length bytes if values may require more than 255 bytes.\n\n*Note*:\n\nMySQL follows the standard SQL specification, and does not remove\ntrailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL uses utf8 as this predefined character\nset. http://dev.mysql.com/doc/refman/5.7/en/charset-national.html.\nNVARCHAR is shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (620,14,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. VARIANCE() is a\nsynonym for the standard SQL function VAR_POP(), provided as a MySQL\nextension.\n\nIf there are no matching rows, VARIANCE() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (621,14,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nIf there are no matching rows, VAR_POP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (622,14,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nIf there are no matching rows, VAR_SAMP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (623,22,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.7.26-standard\'\n','http://dev.mysql.com/doc/refman/5.7/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (624,27,'WAIT_FOR_EXECUTED_GTID_SET','Syntax:\nWAIT_FOR_EXECUTED_GTID_SET(gtid_set[, timeout])\n\nWait until the server has applied all of the transactions whose global\ntransaction identifiers are contained in gtid_set; that is, until the\ncondition GTID_SUBSET(gtid_subset, @@GLOBAL.gtid_executed) holds. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html\nfor a definition of GTID sets.\n\nIf a timeout is specified, and timeout seconds elapse before all of the\ntransactions in the GTID set have been applied, the function stops\nwaiting. timeout is optional, and the default timeout is 0 seconds, in\nwhich case the function always waits until all of the transactions in\nthe GTID set have been applied.\n\nWAIT_FOR_EXECUTED_GTID_SET() monitors all the GTIDs that are applied on\nthe server, including transactions that arrive from all replication\nchannels and user clients. It does not take into account whether\nreplication channels have been started or stopped.\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','mysql> SELECT WAIT_FOR_EXECUTED_GTID_SET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (625,27,'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS','Syntax:\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(gtid_set[, timeout][,channel])\n\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() is similar to\nWAIT_FOR_EXECUTED_GTID_SET() in that it waits until all of the\ntransactions whose global transaction identifiers are contained in\ngtid_set have been applied, or until timeout seconds have elapsed,\nwhichever occurs first. However, WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS()\napplies to a specific replication channel, and stops only after the\ntransactions have been applied on the specified channel, for which the\napplier must be running. In contrast, WAIT_FOR_EXECUTED_GTID_SET()\nstops after the transactions have been applied, regardless of where\nthey were applied (on any replication channel or any user client), and\nwhether or not any replication channels are running.\n\nThe channel option names which replication channel the function applies\nto. If no channel is named and no channels other than the default\nreplication channel exist, the function applies to the default\nreplication channel. If multiple replication channels exist, you must\nspecify a channel as otherwise it is not known which replication\nchannel the function applies to. See\nhttp://dev.mysql.com/doc/refman/5.7/en/replication-channels.html for\nmore information on replication channels.\n\n*Note*:\n\nBecause WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() applies to a specific\nreplication channel, if an expected transaction arrives on a different\nreplication channel or from a user client, for example in a failover or\nmanual recovery situation, the function can hang indefinitely if no\ntimeout is set. Use WAIT_FOR_EXECUTED_GTID_SET() instead to ensure\ncorrect handling of transactions in these situations.\n\nGTID sets used with WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() are represented\nas strings and must be quoted in the same way as for\nWAIT_FOR_EXECUTED_GTID_SET(). For WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(),\nthe return value for the function is an arbitrary positive number. If\nGTID-based replication is not active (that is, if the value of the\ngtid_mode variable is OFF), then this value is undefined and\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() returns NULL. If the slave is not\nrunning then the function also returns NULL.\n\ngtid_mode cannot be changed to OFF while any client is using this\nfunction to wait for GTIDs to be applied.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (626,11,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (627,11,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (628,11,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n -> 8\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (629,35,'WEIGHT_STRING','Syntax:\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n\nlevels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nThis function returns the weight string for the input string. The\nreturn value is a binary string that represents the comparison and\nsorting value of the string. It has these properties:\n\no If WEIGHT_STRING(str1) = WEIGHT_STRING(str2), then str1 = str2 (str1\n and str2 are considered equal)\n\no If WEIGHT_STRING(str1) < WEIGHT_STRING(str2), then str1 < str2 (str1\n sorts before str2)\n\nWEIGHT_STRING() is a debugging function intended for internal use. Its\nbehavior can change without notice between MySQL versions. It can be\nused for testing and debugging of collations, especially if you are\nadding a new collation. See\nhttp://dev.mysql.com/doc/refman/5.7/en/adding-collation.html.\n\nThis list briefly summarizes the arguments. More details are given in\nthe discussion following the list.\n\no str: The input string expression.\n\no AS clause: Optional; cast the input string to a given type and\n length.\n\no LEVEL clause: Optional; specify weight levels for the return value.\n\no flags: Optional; unused.\n\nThe input string, str, is a string expression. If the input is a\nnonbinary (character) string such as a CHAR, VARCHAR, or TEXT value,\nthe return value contains the collation weights for the string. If the\ninput is a binary (byte) string such as a BINARY, VARBINARY, or BLOB\nvalue, the return value is the same as the input (the weight for each\nbyte in a binary string is the byte value). If the input is NULL,\nWEIGHT_STRING() returns NULL.\n\nExamples:\n\nmysql> SET @s = _latin1 \'AB\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = _latin1 \'ab\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'AB\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'ab\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 6162 |\n+------+---------+------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (630,5,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition expression is true. statement_list consists of one or\nmore SQL statements, each terminated by a semicolon (;) statement\ndelimiter.\n\nA WHILE statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/while.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND;\n','http://dev.mysql.com/doc/refman/5.7/en/while.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (631,27,'WITHIN','Within(g1, g2)\n\nMBRWithin() and Within() are synonyms. For more information, see the\ndescription of MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (632,41,'WKT DEFINITION','The Well-Known Text (WKT) representation of geometry values is designed\nfor exchanging geometry data in ASCII form. The OpenGIS specification\nprovides a Backus-Naur grammar that specifies the formal production\nrules for writing WKT values (see\nhttp://dev.mysql.com/doc/refman/5.7/en/spatial-types.html).\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (633,31,'X','X(p)\n\nST_X() and X() are synonyms. For more information, see the description\nof ST_X().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (634,37,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER [CONVERT XID]\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (X\'6162\', 0x6162), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nXA START xid starts an XA transaction with the given xid value. Each XA\ntransaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.7/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------+\n| 7 | 3 | 3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nXID values may contain nonprintable characters. As of MySQL 5.7.5, XA\nRECOVER permits an optional CONVERT XID clause so that clients can\nrequest XID values in hexadecimal.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/xa-statements.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (635,26,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n -> 0\nmysql> SELECT 1 XOR 0;\n -> 1\nmysql> SELECT 1 XOR NULL;\n -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.7/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (636,31,'Y','Y(p)\n\nST_Y() and Y() are synonyms. For more information, see the description\nof ST_Y().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (637,11,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n -> 1987\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (638,10,'YEAR DATA TYPE','YEAR[(4)]\n\nA year in four-digit format. MySQL displays YEAR values in YYYY format,\nbut permits assignment of values to YEAR columns using either strings\nor numbers. Values display as 1901 to 2155, and 0000.\n\n*Note*:\n\nThe YEAR(2) data type is deprecated and support for it is removed in\nMySQL 5.7.5. To convert YEAR(2) columns to YEAR(4), see\nhttp://dev.mysql.com/doc/refman/5.7/en/migrating-to-year4.html.\n\nFor additional information about YEAR display format and interpretation\nof input values, see http://dev.mysql.com/doc/refman/5.7/en/year.html.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (639,11,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The year in the result may be\ndifferent from the year in the date argument for the first and the last\nweek of the year.\n\nThe mode argument works exactly like the mode argument to WEEK(). For\nthe single-argument syntax, a mode value of 0 is used. Unlike WEEK(),\nthe value of default_week_format does not influence YEARWEEK().\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n -> 198652\n','http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (640,3,'^','Syntax:\n^\n\nBitwise XOR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (641,3,'|','Syntax:\n|\n\nBitwise OR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (642,3,'~','Syntax:\n~\n\nInvert all bits.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (0,'JOIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (1,'HOST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (2,'SERIALIZABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (3,'CONTAINS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (4,'SRID'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (5,'AT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (6,'SCHEDULE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (7,'RETURNS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (8,'MASTER_TLS_VERSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (9,'MASTER_SSL_CA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (10,'NCHAR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (11,'ONLY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (12,'ST_GEOMETRYN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (13,'ST_GEOMCOLLFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (14,'WORK'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (15,'OPEN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (16,'ST_INTERSECTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (17,'ESCAPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (18,'EVENTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (19,'MONTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (20,'PROFILES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (21,'ISCLOSED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (22,'DUPLICATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (23,'ST_POINTN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (24,'REPLICATION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (25,'UNLOCK'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (26,'STATS_PERSISTENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (27,'INNODB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (28,'REPLICATE_REWRITE_DB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (29,'YEAR_MONTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (30,'WITHIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (31,'PREPARE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (32,'LOCK'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (33,'NDB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (34,'INT4'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (35,'POLYGON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (36,'MINUTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (37,'SEPARATOR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (38,'DELETE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (39,'JSON_SEARCH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (40,'ON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (41,'CONNECTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (42,'CLOSE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (43,'MASTER_SSL_CRLPATH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (44,'USE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (45,'PRIVILEGES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (46,'SPATIAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (47,'SQL_BUFFER_RESULT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (48,'JSON_ARRAYAGG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (49,'ERROR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (50,'SECURITY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (51,'AUTOEXTEND_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (52,'ST_STARTPOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (53,'NDBCLUSTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (54,'ST_POLYGONFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (55,'LEVEL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (56,'BINARY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (57,'CURRENT_USER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (58,'HOUR_MINUTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (59,'UPDATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (60,'PRESERVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (61,'ST_SIMPLIFY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (62,'INTO'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (63,'POLYFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (64,'SQL_AFTER_GTIDS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (65,'VARIABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (66,'ROLLBACK'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (67,'TIMESTAMP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (68,'IMPORT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (69,'CHECKSUM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (70,'THEN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (71,'ENGINES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (72,'HANDLER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (73,'DAY_SECOND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (74,'HELP_DATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (75,'BOOLEAN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (76,'JSON_EXTRACT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (77,'MOD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (78,'ST_GEOMETRYTYPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (79,'CLASS_ORIGIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (80,'MPOLYFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (81,'ITERATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (82,'DO'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (83,'DATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (84,'FULLTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (85,'COMMENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (86,'COMPRESSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (87,'ST_ASTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (88,'MASTER_CONNECT_RETRY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (89,'JSON_TYPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (90,'MASTER_LOG_FILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (91,'PRECISION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (92,'REQUIRE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (93,'ST_ASWKT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (94,'LONG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (95,'FORMAT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (96,'OPTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (97,'REORGANIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (98,'ELSE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (99,'EXTERIORRING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (100,'GEOMFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (101,'STATS_AUTO_RECALC'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (102,'FROM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (103,'MULTIPOLYGON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (104,'LEFT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (105,'ELSEIF'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (106,'ST_ISCLOSED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (107,'COMPACT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (108,'DEC'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (109,'FOR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (110,'WARNINGS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (111,'ST_LONGFROMGEOHASH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (112,'ST_LINESTRINGFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (113,'STRING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (114,'CONDITION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (115,'ENCLOSED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (116,'AGGREGATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (117,'NUMBER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (118,'FIELDS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (119,'JSON_INSERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (120,'JSON_UNQUOTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (121,'PATH)'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (122,'KILL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (123,'DISJOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (124,'TABLESPACE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (125,'OVERLAPS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (126,'INFILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (127,'MBREQUAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (128,'HELP_VERSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (129,'ORDER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (130,'MASTER_SSL_CRL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (131,'ST_GEOMFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (132,'USING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (133,'REPLICATE_WILD_DO_TABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (134,'MIDDLEINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (135,'GRANT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (136,'MBRINTERSECTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (137,'ST_MPOLYFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (138,'JSON_ARRAY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (139,'GEOMETRYN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (140,'GEOMETRYFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (141,'DEFAULT_AUTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (142,'FOREIGN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (143,'CACHE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (144,'MYSQL_ERRNO'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (145,'SCHEMAS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (146,'LEADING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (147,'CONSTRAINT_NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (148,'CONVERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (149,'DYNAMIC'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (150,'ST_ISVALID'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (151,'POLYGONFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (152,'ENVELOPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (153,'ST_ISEMPTY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (154,'HAVING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (155,'STARTING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (156,'RELOAD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (157,'ISSIMPLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (158,'AUTOCOMMIT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (159,'ST_Y'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (160,'REVOKE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (161,'RANDOM_BYTES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (162,'EXPLAIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (163,'CSV'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (164,'OUTFILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (165,'LOW_PRIORITY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (166,'FILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (167,'ANY_VALUE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (168,'NODEGROUP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (169,'SCHEMA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (170,'ST_TOUCHES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (171,'MLINEFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (172,'ST_POLYGONFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (173,'DUAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (174,'MULTIPOINTFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (175,'MULTIPOINTFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (176,'EXTENDED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (177,'CROSS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (178,'GROUP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (179,'NATIONAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (180,'ST_ISSIMPLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (181,'SHA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (182,'POINTN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (183,'IGNORE_SERVER_IDS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (184,'MASTER_AUTO_POSITION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (185,'ASBINARY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (186,'ST_MLINEFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (187,'EXTRACTION)'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (188,'MBROVERLAPS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (189,'GENERAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (190,'OWNER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (191,'TRUE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (192,'CHARACTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (193,'SCHEMA_NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (194,'TABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (195,'ST_LINEFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (196,'CASCADE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (197,'RELAY_LOG_POS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (198,'ASWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (199,'LEAVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (200,'ST_GEOHASH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (201,'MODIFY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (202,'MATCH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (203,'MASTER_LOG_POS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (204,'DISTINCTROW'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (205,'X'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (206,'CURSOR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (207,'INLINE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (208,'ST_UNION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (209,'CROSSES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (210,'->>'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (211,'GEOMETRYCOLLECTIONFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (212,'CHAIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (213,'FLUSH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (214,'CREATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (215,'DESCRIBE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (216,'PROCESSLIST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (217,'JSON_OBJECTAGG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (218,'DISCARD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (219,'SOUNDS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (220,'PACK_KEYS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (221,'MULTILINESTRINGFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (222,'INTERSECTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (223,'FAST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (224,'GET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (225,'REPLICATE_WILD_IGNORE_TABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (226,'LOOP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (227,'VARCHARACTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (228,'BEFORE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (229,'ALL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (230,'REDUNDANT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (231,'USER_RESOURCES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (232,'PARTIAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (233,'END'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (234,'ST_CONTAINS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (235,'SECOND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (236,'FLOAT8'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (237,'PREV'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (238,'MBRCONTAINS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (239,'OR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (240,'IDENTIFIED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (241,'POINTFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (242,'MASTER_SSL_CIPHER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (243,'SQL_SLAVE_SKIP_COUNTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (244,'BOTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (245,'YEAR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (246,'UNIQUE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (247,'TRIGGERS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (248,'RESIGNAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (249,'ST_NUMPOINTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (250,'MASTER_SSL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (251,'DATE_ADD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (252,'JSON_VALID'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (253,'ST_ENVELOPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (254,'LIKE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (255,'PLUGIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (256,'MULTIPOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (257,'FETCH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (258,'MBRWITHIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (259,'COLUMN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (260,'USAGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (261,'MEMORY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (262,'ST_MULTIPOINTFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (263,'QUERY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (264,'DISTANCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (265,'Y'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (266,'LINES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (267,'PLUGIN_DIR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (268,'SQL_THREAD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (269,'INTERIORRINGN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (270,'NUMINTERIORRINGS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (271,'REPLICATE_IGNORE_DB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (272,'MAX_QUERIES_PER_HOUR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (273,'ST_POLYFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (274,'TRANSACTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (275,'STDDEV'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (276,'NAMES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (277,'INT1'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (278,'RIGHT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (279,'MAX_ROWS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (280,'ALTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (281,'NATURAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (282,'JSON_STORAGE_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (283,'MULTILINESTRING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (284,'VARIABLES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (285,'ESCAPED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (286,'KEY_BLOCK_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (287,'MPOINTFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (288,'CHAR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (289,'UPGRADE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (290,'INTERVAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (291,'NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (292,'ST_POINTFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (293,'REFERENCES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (294,'JSON_PRETTY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (295,'ST_MAKEENVELOPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (296,'ST_WITHIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (297,'STORAGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (298,'ISOLATION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (299,'EVERY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (300,'INT8'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (301,'ST_BUFFER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (302,'BUFFER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (303,'RESTRICT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (304,'JSON_OBJECT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (305,'UNCOMMITTED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (306,'LINESTRINGFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (307,'IS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (308,'ST_CENTROID'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (309,'NOT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (310,'REPLICATE_DO_TABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (311,'DATAFILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (312,'ANALYSE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (313,'DES_KEY_FILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (314,'COMPRESSED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (315,'START'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (316,'PARTITIONING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (317,'IF'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (318,'ROWS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (319,'PURGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (320,'USER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (321,'EXIT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (322,'ST_MULTILINESTRINGFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (323,'MERGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (324,'ST_DISTANCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (325,'SQL_NO_CACHE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (326,'ST_MULTIPOLYGONFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (327,'DELAYED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (328,'PROXY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (329,'ST_DISTANCE_SPHERE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (330,'ST_POLYFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (331,'RELAY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (332,'WRITE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (333,'VIRTUAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (334,'JSON_QUOTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (335,'NEVER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (336,'DATABASE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (337,'NULL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (338,'POWER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (339,'POINTFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (340,'USE_FRM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (341,'TERMINATED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (342,'NVARCHAR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (343,'RETURN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (344,'DIRECTORY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (345,'AES_DECRYPT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (346,'GLENGTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (347,'SHUTDOWN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (348,'JSON_REMOVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (349,'ST_ASGEOJSON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (350,'CATALOG_NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (351,'FILE_BLOCK_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (352,'FIXED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (353,'ST_BUFFER_STRATEGY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (354,'MULTIPOLYGONFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (355,'REPEAT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (356,'REPLACE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (357,'ST_SYMDIFFERENCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (358,'STARTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (359,'ST_NUMINTERIORRING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (360,'COMPLETION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (361,'COLUMNS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (362,'DATETIME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (363,'MODE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (364,'INTEGER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (365,'VALUE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (366,'ASWKT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (367,'MASTER_SSL_VERIFY_SERVER_CERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (368,'GEOMETRYCOLLECTIONFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (369,'DROP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (370,'SQL_BIG_RESULT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (371,'SUBJECT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (372,'MASTER_RETRY_COUNT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (373,'ST_VALIDATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (374,'CHECK'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (375,'FULL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (376,'BY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (377,'ST_POINTFROMGEOHASH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (378,'NO'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (379,'DAY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (380,'DATA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (381,'PARTITION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (382,'REAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (383,'SHARE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (384,'LINESTRING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (385,'MESSAGE_TEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (386,'MASTER_HEARTBEAT_PERIOD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (387,'COLUMN_NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (388,'X509'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (389,'LINEFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (390,'SUBCLASS_ORIGIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (391,'WHERE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (392,'EVENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (393,'SUPER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (394,'IGNORE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (395,'SHA2'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (396,'STORED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (397,'QUICK'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (398,'SIGNED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (399,'ENCRYPTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (400,'ST_GEOMCOLLFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (401,'FALSE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (402,'POLYGONFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (403,'FORCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (404,'TO'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (405,'CHANGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (406,'POINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (407,'CREATE_DH_PARAMETERS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (408,'TABLE_NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (409,'SLOW'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (410,'VARYING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (411,'FEDERATED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (412,'MAX_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (413,'HOUR_SECOND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (414,'ST_DIFFERENCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (415,'OPTIMIZER_COSTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (416,'TRADITIONAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (417,'GEOMETRYCOLLECTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (418,'ST_GEOMETRYCOLLECTIONFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (419,'ST_ASBINARY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (420,'PROCEDURE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (421,'AGAINST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (422,'ST_AREA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (423,'SQL_BEFORE_GTIDS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (424,'ENDPOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (425,'LONGBINARY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (426,'INSERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (427,'COUNT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (428,'JSON_ARRAY_APPEND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (429,'PORT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (430,'MLINEFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (431,'EXISTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (432,'MUTEX'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (433,'GEOMCOLLFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (434,'RELEASE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (435,'DEFAULT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (436,'TYPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (437,'NO_WRITE_TO_BINLOG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (438,'JSON_ARRAY_INSERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (439,'OPTIMIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (440,'SQLSTATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (441,'RESET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (442,'INSTALL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (443,'BIGINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (444,'ST_DIMENSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (445,'SET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (446,'JSON_MERGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (447,'ISSUER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (448,'ST_MPOINTFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (449,'STATUS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (450,'INNER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (451,'RELAYLOG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (452,'STOP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (453,'MRG_MYISAM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (454,'TRAILING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (455,'PARTITIONS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (456,'ST_NUMINTERIORRINGS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (457,'JSON_KEYS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (458,'DEALLOCATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (459,'IO_THREAD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (460,'CASE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (461,'CIPHER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (462,'CONTINUE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (463,'READ'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (464,'MINUTE_SECOND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (465,'ST_MULTIPOINTFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (466,'MIN_ROWS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (467,'ROW_COUNT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (468,'FUNCTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (469,'ST_GEOMETRYFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (470,'CHARSET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (471,'INT3'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (472,'JSON_CONTAINS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (473,'ADD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (474,'AVG_ROW_LENGTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (475,'ARCHIVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (476,'FLOAT4'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (477,'ASTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (478,'NUMGEOMETRIES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (479,'ALGORITHM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (480,'VIEW'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (481,'REPEATABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (482,'JSON_CONTAINS_PATH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (483,'ST_MPOINTFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (484,'CONSTRAINT_CATALOG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (485,'STARTPOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (486,'MPOLYFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (487,'JSON_MERGE_PRESERVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (488,'UNSIGNED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (489,'DECIMAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (490,'INDEXES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (491,'ST_INTERSECTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (492,'HOSTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (493,'COMMIT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (494,'SNAPSHOT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (495,'DECLARE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (496,'NUMPOINTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (497,'INSTANCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (498,'LOAD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (499,'SQL_CACHE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (500,'->'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (501,'COLLATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (502,'ST_GEOMETRYFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (503,'CHANNEL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (504,'BYTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (505,'GLOBAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (506,'LINESTRINGFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (507,'WHEN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (508,'CONVEXHULL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (509,'TOUCHES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (510,'AS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (511,'ST_LINESTRINGFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (512,'AUTO_INCREMENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (513,'GEOMCOLLFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (514,'ST_INTERIORRINGN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (515,'GRANTS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (516,'REPLICATE_DO_DB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (517,'OUTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (518,'CURSOR_NAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (519,'EXPIRE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (520,'SQL_AFTER_MTS_GAPS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (521,'FLOOR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (522,'WITH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (523,'STD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (524,'AFTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (525,'DISABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (526,'UNINSTALL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (527,'ST_CONVEXHULL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (528,'SONAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (529,'POW'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (530,'INDEX'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (531,'DEFINER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (532,'MASTER_BIND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (533,'REMOVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (534,'MULTILINESTRINGFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (535,'ST_POINTFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (536,'ST_ENDPOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (537,'ACCOUNT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (538,'ST_OVERLAPS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (539,'UNDO'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (540,'JSON_SET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (541,'ZEROFILL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (542,'CLIENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (543,'MASTER_PASSWORD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (544,'RELAY_LOG_FILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (545,'MASTER_USER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (546,'MBRTOUCHES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (547,'ENGINE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (548,'INSERT_METHOD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (549,'SQL_CALC_FOUND_ROWS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (550,'UNION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (551,'MYISAM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (552,'DESC'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (553,'TIME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (554,'EXPANSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (555,'NUMERIC'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (556,'CODE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (557,'AREA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (558,'LOGFILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (559,'EXTENT_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (560,'ST_LINEFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (561,'MAX_UPDATES_PER_HOUR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (562,'INT2'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (563,'ENDS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (564,'LOGS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (565,'RECOVER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (566,'ISEMPTY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (567,'HEAP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (568,'RETURNED_SQLSTATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (569,'EXCHANGE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (570,'BETWEEN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (571,'ST_CROSSES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (572,'REPAIR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (573,'ST_MPOLYFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (574,'MBRDISJOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (575,'CALL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (576,'VALUES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (577,'ST_X'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (578,'TRUNCATE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (579,'SHOW'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (580,'BINLOG'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (581,'ST_DISJOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (582,'AND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (583,'HOUR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (584,'SELECT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (585,'DATABASES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (586,'JSON_MERGE_PATCH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (587,'WRAPPER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (588,'BOOL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (589,'MASTER_PORT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (590,'CONCURRENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (591,'HELP'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (592,'PROCESS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (593,'OPTIONS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (594,'CONSISTENT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (595,'MAX_CONNECTIONS_PER_HOUR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (596,'IN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (597,'DIAGNOSTICS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (598,'JSON_REPLACE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (599,'DUMPFILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (600,'POLYFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (601,'EXECUTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (602,'ST_SRID'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (603,'JSON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (604,'CEIL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (605,'ST_MULTILINESTRINGFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (606,'MASTER_HOST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (607,'ST_EQUALS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (608,'SERVER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (609,'MASTER_SSL_CERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (610,'MULTIPOLYGONFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (611,'DAY_MINUTE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (612,'DATE_SUB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (613,'REPLICATE_IGNORE_TABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (614,'REBUILD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (615,'GEOMETRYFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (616,'GEOMFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (617,'RENAME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (618,'PARSER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (619,'ST_ASWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (620,'SOCKET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (621,'ST_LATFROMGEOHASH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (622,'ST_GEOMFROMGEOJSON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (623,'STRAIGHT_JOIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (624,'ST_GEOMETRYCOLLECTIONFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (625,'ST_GEOMFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (626,'SHA1'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (627,'PASSWORD'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (628,'OFFSET'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (629,'NEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (630,'ERRORS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (631,'SQL_LOG_BIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (632,'TEMPORARY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (633,'COMMITTED'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (634,'DIMENSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (635,'SQL_SMALL_RESULT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (636,'ST_MULTIPOLYGONFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (637,'FILTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (638,'XA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (639,'EQUALS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (640,'DELAY_KEY_WRITE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (641,'BEGIN'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (642,'PROFILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (643,'MEDIUM'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (644,'CENTROID'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (645,'SSL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (646,'DAY_HOUR'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (647,'AES_ENCRYPT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (648,'CEILING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (649,'LINEFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (650,'GEOMETRYTYPE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (651,'STATS_SAMPLE_PAGES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (652,'SIGNAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (653,'PLUGINS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (654,'SAVEPOINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (655,'ST_NUMGEOMETRIES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (656,'PRIMARY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (657,'JSON_DEPTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (658,'LAST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (659,'MPOINTFROMWKB'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (660,'KEYS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (661,'LIMIT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (662,'KEY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (663,'UNTIL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (664,'ST_MLINEFROMTEXT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (665,'CONSTRAINT_SCHEMA'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (666,'ST_EXTERIORRING'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (667,'ANALYZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (668,'CONSTRAINT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (669,'SERIAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (670,'ACTION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (671,'INITIAL_SIZE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (672,'SESSION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (673,'SLAVE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (674,'ASC'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (675,'ENABLE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (676,'OPTIONALLY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (677,'MAX_USER_CONNECTIONS'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (678,'WHILE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (679,'DISTINCT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (680,'LOCAL'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (681,'MASTER_SSL_KEY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (682,'JSON_APPEND'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (683,'JSON_LENGTH'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (684,'NONE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (685,'TABLES'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (686,'<>'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (687,'EXPORT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (688,'RLIKE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (689,'TRIGGER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (690,'COLLATION'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (691,'HIGH_PRIORITY'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (692,'BTREE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (693,'FIRST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (694,'COALESCE'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (695,'WAIT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (696,'MASTER'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (697,'ROW_FORMAT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (698,'(JSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (0,'(JSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (1,'->'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (2,'->>'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (3,'<>'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (4,'ACCOUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (5,'ACTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (6,'ADD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (7,'AES_DECRYPT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (8,'AES_ENCRYPT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (9,'AFTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (10,'AGAINST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (11,'AGGREGATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (12,'ALGORITHM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (13,'ALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (14,'ALTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (15,'ANALYSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (16,'ANALYZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (17,'AND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (18,'ANY_VALUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (19,'ARCHIVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (20,'AREA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (21,'AS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (22,'ASBINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (23,'ASC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (24,'ASTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (25,'ASWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (26,'ASWKT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (27,'AT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (28,'AUTOCOMMIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (29,'AUTOEXTEND_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (30,'AUTO_INCREMENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (31,'AVG_ROW_LENGTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (32,'BEFORE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (33,'BEGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (34,'BETWEEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (35,'BIGINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (36,'BINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (37,'BINLOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (38,'BOOL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (39,'BOOLEAN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (40,'BOTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (41,'BTREE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (42,'BUFFER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (43,'BY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (44,'BYTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (45,'CACHE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (46,'CALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (47,'CASCADE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (48,'CASE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (49,'CATALOG_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (50,'CEIL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (51,'CEILING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (52,'CENTROID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (53,'CHAIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (54,'CHANGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (55,'CHANNEL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (56,'CHAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (57,'CHARACTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (58,'CHARSET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (59,'CHECK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (60,'CHECKSUM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (61,'CIPHER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (62,'CLASS_ORIGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (63,'CLIENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (64,'CLOSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (65,'COALESCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (66,'CODE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (67,'COLLATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (68,'COLLATION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (69,'COLUMN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (70,'COLUMNS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (71,'COLUMN_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (72,'COMMENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (73,'COMMIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (74,'COMMITTED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (75,'COMPACT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (76,'COMPLETION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (77,'COMPRESSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (78,'COMPRESSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (79,'CONCURRENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (80,'CONDITION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (81,'CONNECTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (82,'CONSISTENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (83,'CONSTRAINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (84,'CONSTRAINT_CATALOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (85,'CONSTRAINT_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (86,'CONSTRAINT_SCHEMA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (87,'CONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (88,'CONTINUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (89,'CONVERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (90,'CONVEXHULL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (91,'COUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (92,'CREATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (93,'CREATE_DH_PARAMETERS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (94,'CROSS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (95,'CROSSES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (96,'CSV'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (97,'CURRENT_USER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (98,'CURSOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (99,'CURSOR_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (100,'DATA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (101,'DATABASE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (102,'DATABASES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (103,'DATAFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (104,'DATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (105,'DATETIME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (106,'DATE_ADD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (107,'DATE_SUB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (108,'DAY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (109,'DAY_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (110,'DAY_MINUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (111,'DAY_SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (112,'DEALLOCATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (113,'DEC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (114,'DECIMAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (115,'DECLARE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (116,'DEFAULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (117,'DEFAULT_AUTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (118,'DEFINER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (119,'DELAYED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (120,'DELAY_KEY_WRITE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (121,'DELETE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (122,'DESC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (123,'DESCRIBE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (124,'DES_KEY_FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (125,'DIAGNOSTICS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (126,'DIMENSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (127,'DIRECTORY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (128,'DISABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (129,'DISCARD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (130,'DISJOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (131,'DISTANCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (132,'DISTINCT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (133,'DISTINCTROW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (134,'DO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (135,'DROP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (136,'DUAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (137,'DUMPFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (138,'DUPLICATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (139,'DYNAMIC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (140,'ELSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (141,'ELSEIF'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (142,'ENABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (143,'ENCLOSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (144,'ENCRYPTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (145,'END'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (146,'ENDPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (147,'ENDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (148,'ENGINE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (149,'ENGINES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (150,'ENVELOPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (151,'EQUALS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (152,'ERROR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (153,'ERRORS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (154,'ESCAPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (155,'ESCAPED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (156,'EVENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (157,'EVENTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (158,'EVERY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (159,'EXCHANGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (160,'EXECUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (161,'EXISTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (162,'EXIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (163,'EXPANSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (164,'EXPIRE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (165,'EXPLAIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (166,'EXPORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (167,'EXTENDED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (168,'EXTENT_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (169,'EXTERIORRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (170,'EXTRACTION)'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (171,'FALSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (172,'FAST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (173,'FEDERATED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (174,'FETCH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (175,'FIELDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (176,'FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (177,'FILE_BLOCK_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (178,'FILTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (179,'FIRST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (180,'FIXED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (181,'FLOAT4'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (182,'FLOAT8'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (183,'FLOOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (184,'FLUSH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (185,'FOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (186,'FORCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (187,'FOREIGN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (188,'FORMAT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (189,'FROM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (190,'FULL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (191,'FULLTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (192,'FUNCTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (193,'GENERAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (194,'GEOMCOLLFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (195,'GEOMCOLLFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (196,'GEOMETRYCOLLECTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (197,'GEOMETRYCOLLECTIONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (198,'GEOMETRYCOLLECTIONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (199,'GEOMETRYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (200,'GEOMETRYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (201,'GEOMETRYN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (202,'GEOMETRYTYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (203,'GEOMFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (204,'GEOMFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (205,'GET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (206,'GLENGTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (207,'GLOBAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (208,'GRANT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (209,'GRANTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (210,'GROUP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (211,'HANDLER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (212,'HAVING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (213,'HEAP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (214,'HELP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (215,'HELP_DATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (216,'HELP_VERSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (217,'HIGH_PRIORITY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (218,'HOST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (219,'HOSTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (220,'HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (221,'HOUR_MINUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (222,'HOUR_SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (223,'IDENTIFIED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (224,'IF'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (225,'IGNORE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (226,'IGNORE_SERVER_IDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (227,'IMPORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (228,'IN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (229,'INDEX'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (230,'INDEXES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (231,'INFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (232,'INITIAL_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (233,'INLINE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (234,'INNER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (235,'INNODB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (236,'INSERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (237,'INSERT_METHOD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (238,'INSTALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (239,'INSTANCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (240,'INT1'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (241,'INT2'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (242,'INT3'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (243,'INT4'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (244,'INT8'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (245,'INTEGER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (246,'INTERIORRINGN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (247,'INTERSECTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (248,'INTERVAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (249,'INTO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (250,'IO_THREAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (251,'IS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (252,'ISCLOSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (253,'ISEMPTY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (254,'ISOLATION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (255,'ISSIMPLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (256,'ISSUER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (257,'ITERATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (258,'JOIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (259,'JSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (260,'JSON_APPEND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (261,'JSON_ARRAY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (262,'JSON_ARRAYAGG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (263,'JSON_ARRAY_APPEND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (264,'JSON_ARRAY_INSERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (265,'JSON_CONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (266,'JSON_CONTAINS_PATH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (267,'JSON_DEPTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (268,'JSON_EXTRACT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (269,'JSON_INSERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (270,'JSON_KEYS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (271,'JSON_LENGTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (272,'JSON_MERGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (273,'JSON_MERGE_PATCH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (274,'JSON_MERGE_PRESERVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (275,'JSON_OBJECT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (276,'JSON_OBJECTAGG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (277,'JSON_PRETTY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (278,'JSON_QUOTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (279,'JSON_REMOVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (280,'JSON_REPLACE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (281,'JSON_SEARCH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (282,'JSON_SET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (283,'JSON_STORAGE_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (284,'JSON_TYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (285,'JSON_UNQUOTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (286,'JSON_VALID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (287,'KEY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (288,'KEYS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (289,'KEY_BLOCK_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (290,'KILL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (291,'LAST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (292,'LEADING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (293,'LEAVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (294,'LEFT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (295,'LEVEL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (296,'LIKE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (297,'LIMIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (298,'LINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (299,'LINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (300,'LINES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (301,'LINESTRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (302,'LINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (303,'LINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (304,'LOAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (305,'LOCAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (306,'LOCK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (307,'LOGFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (308,'LOGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (309,'LONG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (310,'LONGBINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (311,'LOOP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (312,'LOW_PRIORITY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (313,'MASTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (314,'MASTER_AUTO_POSITION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (315,'MASTER_BIND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (316,'MASTER_CONNECT_RETRY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (317,'MASTER_HEARTBEAT_PERIOD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (318,'MASTER_HOST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (319,'MASTER_LOG_FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (320,'MASTER_LOG_POS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (321,'MASTER_PASSWORD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (322,'MASTER_PORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (323,'MASTER_RETRY_COUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (324,'MASTER_SSL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (325,'MASTER_SSL_CA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (326,'MASTER_SSL_CERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (327,'MASTER_SSL_CIPHER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (328,'MASTER_SSL_CRL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (329,'MASTER_SSL_CRLPATH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (330,'MASTER_SSL_KEY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (331,'MASTER_SSL_VERIFY_SERVER_CERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (332,'MASTER_TLS_VERSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (333,'MASTER_USER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (334,'MATCH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (335,'MAX_CONNECTIONS_PER_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (336,'MAX_QUERIES_PER_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (337,'MAX_ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (338,'MAX_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (339,'MAX_UPDATES_PER_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (340,'MAX_USER_CONNECTIONS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (341,'MBRCONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (342,'MBRDISJOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (343,'MBREQUAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (344,'MBRINTERSECTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (345,'MBROVERLAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (346,'MBRTOUCHES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (347,'MBRWITHIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (348,'MEDIUM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (349,'MEMORY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (350,'MERGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (351,'MESSAGE_TEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (352,'MIDDLEINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (353,'MINUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (354,'MINUTE_SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (355,'MIN_ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (356,'MLINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (357,'MLINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (358,'MOD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (359,'MODE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (360,'MODIFY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (361,'MONTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (362,'MPOINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (363,'MPOINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (364,'MPOLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (365,'MPOLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (366,'MRG_MYISAM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (367,'MULTILINESTRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (368,'MULTILINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (369,'MULTILINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (370,'MULTIPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (371,'MULTIPOINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (372,'MULTIPOINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (373,'MULTIPOLYGON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (374,'MULTIPOLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (375,'MULTIPOLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (376,'MUTEX'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (377,'MYISAM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (378,'MYSQL_ERRNO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (379,'NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (380,'NAMES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (381,'NATIONAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (382,'NATURAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (383,'NCHAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (384,'NDB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (385,'NDBCLUSTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (386,'NEVER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (387,'NEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (388,'NO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (389,'NODEGROUP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (390,'NONE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (391,'NOT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (392,'NO_WRITE_TO_BINLOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (393,'NULL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (394,'NUMBER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (395,'NUMERIC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (396,'NUMGEOMETRIES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (397,'NUMINTERIORRINGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (398,'NUMPOINTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (399,'NVARCHAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (400,'OFFSET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (401,'ON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (402,'ONLY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (403,'OPEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (404,'OPTIMIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (405,'OPTIMIZER_COSTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (406,'OPTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (407,'OPTIONALLY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (408,'OPTIONS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (409,'OR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (410,'ORDER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (411,'OUTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (412,'OUTFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (413,'OVERLAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (414,'OWNER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (415,'PACK_KEYS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (416,'PARSER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (417,'PARTIAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (418,'PARTITION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (419,'PARTITIONING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (420,'PARTITIONS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (421,'PASSWORD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (422,'PATH)'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (423,'PLUGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (424,'PLUGINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (425,'PLUGIN_DIR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (426,'POINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (427,'POINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (428,'POINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (429,'POINTN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (430,'POLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (431,'POLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (432,'POLYGON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (433,'POLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (434,'POLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (435,'PORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (436,'POW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (437,'POWER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (438,'PRECISION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (439,'PREPARE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (440,'PRESERVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (441,'PREV'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (442,'PRIMARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (443,'PRIVILEGES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (444,'PROCEDURE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (445,'PROCESS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (446,'PROCESSLIST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (447,'PROFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (448,'PROFILES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (449,'PROXY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (450,'PURGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (451,'QUERY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (452,'QUICK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (453,'RANDOM_BYTES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (454,'READ'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (455,'REAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (456,'REBUILD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (457,'RECOVER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (458,'REDUNDANT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (459,'REFERENCES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (460,'RELAY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (461,'RELAYLOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (462,'RELAY_LOG_FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (463,'RELAY_LOG_POS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (464,'RELEASE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (465,'RELOAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (466,'REMOVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (467,'RENAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (468,'REORGANIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (469,'REPAIR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (470,'REPEAT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (471,'REPEATABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (472,'REPLACE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (473,'REPLICATE_DO_DB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (474,'REPLICATE_DO_TABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (475,'REPLICATE_IGNORE_DB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (476,'REPLICATE_IGNORE_TABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (477,'REPLICATE_REWRITE_DB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (478,'REPLICATE_WILD_DO_TABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (479,'REPLICATE_WILD_IGNORE_TABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (480,'REPLICATION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (481,'REQUIRE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (482,'RESET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (483,'RESIGNAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (484,'RESTRICT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (485,'RETURN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (486,'RETURNED_SQLSTATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (487,'RETURNS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (488,'REVOKE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (489,'RIGHT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (490,'RLIKE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (491,'ROLLBACK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (492,'ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (493,'ROW_COUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (494,'ROW_FORMAT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (495,'SAVEPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (496,'SCHEDULE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (497,'SCHEMA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (498,'SCHEMAS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (499,'SCHEMA_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (500,'SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (501,'SECURITY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (502,'SELECT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (503,'SEPARATOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (504,'SERIAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (505,'SERIALIZABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (506,'SERVER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (507,'SESSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (508,'SET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (509,'SHA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (510,'SHA1'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (511,'SHA2'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (512,'SHARE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (513,'SHOW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (514,'SHUTDOWN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (515,'SIGNAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (516,'SIGNED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (517,'SLAVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (518,'SLOW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (519,'SNAPSHOT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (520,'SOCKET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (521,'SONAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (522,'SOUNDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (523,'SPATIAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (524,'SQLSTATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (525,'SQL_AFTER_GTIDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (526,'SQL_AFTER_MTS_GAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (527,'SQL_BEFORE_GTIDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (528,'SQL_BIG_RESULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (529,'SQL_BUFFER_RESULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (530,'SQL_CACHE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (531,'SQL_CALC_FOUND_ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (532,'SQL_LOG_BIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (533,'SQL_NO_CACHE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (534,'SQL_SLAVE_SKIP_COUNTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (535,'SQL_SMALL_RESULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (536,'SQL_THREAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (537,'SRID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (538,'SSL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (539,'START'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (540,'STARTING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (541,'STARTPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (542,'STARTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (543,'STATS_AUTO_RECALC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (544,'STATS_PERSISTENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (545,'STATS_SAMPLE_PAGES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (546,'STATUS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (547,'STD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (548,'STDDEV'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (549,'STOP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (550,'STORAGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (551,'STORED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (552,'STRAIGHT_JOIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (553,'STRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (554,'ST_AREA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (555,'ST_ASBINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (556,'ST_ASGEOJSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (557,'ST_ASTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (558,'ST_ASWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (559,'ST_ASWKT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (560,'ST_BUFFER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (561,'ST_BUFFER_STRATEGY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (562,'ST_CENTROID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (563,'ST_CONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (564,'ST_CONVEXHULL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (565,'ST_CROSSES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (566,'ST_DIFFERENCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (567,'ST_DIMENSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (568,'ST_DISJOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (569,'ST_DISTANCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (570,'ST_DISTANCE_SPHERE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (571,'ST_ENDPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (572,'ST_ENVELOPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (573,'ST_EQUALS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (574,'ST_EXTERIORRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (575,'ST_GEOHASH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (576,'ST_GEOMCOLLFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (577,'ST_GEOMCOLLFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (578,'ST_GEOMETRYCOLLECTIONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (579,'ST_GEOMETRYCOLLECTIONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (580,'ST_GEOMETRYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (581,'ST_GEOMETRYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (582,'ST_GEOMETRYN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (583,'ST_GEOMETRYTYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (584,'ST_GEOMFROMGEOJSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (585,'ST_GEOMFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (586,'ST_GEOMFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (587,'ST_INTERIORRINGN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (588,'ST_INTERSECTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (589,'ST_INTERSECTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (590,'ST_ISCLOSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (591,'ST_ISEMPTY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (592,'ST_ISSIMPLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (593,'ST_ISVALID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (594,'ST_LATFROMGEOHASH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (595,'ST_LINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (596,'ST_LINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (597,'ST_LINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (598,'ST_LINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (599,'ST_LONGFROMGEOHASH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (600,'ST_MAKEENVELOPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (601,'ST_MLINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (602,'ST_MLINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (603,'ST_MPOINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (604,'ST_MPOINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (605,'ST_MPOLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (606,'ST_MPOLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (607,'ST_MULTILINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (608,'ST_MULTILINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (609,'ST_MULTIPOINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (610,'ST_MULTIPOINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (611,'ST_MULTIPOLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (612,'ST_MULTIPOLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (613,'ST_NUMGEOMETRIES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (614,'ST_NUMINTERIORRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (615,'ST_NUMINTERIORRINGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (616,'ST_NUMPOINTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (617,'ST_OVERLAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (618,'ST_POINTFROMGEOHASH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (619,'ST_POINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (620,'ST_POINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (621,'ST_POINTN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (622,'ST_POLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (623,'ST_POLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (624,'ST_POLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (625,'ST_POLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (626,'ST_SIMPLIFY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (627,'ST_SRID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (628,'ST_STARTPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (629,'ST_SYMDIFFERENCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (630,'ST_TOUCHES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (631,'ST_UNION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (632,'ST_VALIDATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (633,'ST_WITHIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (634,'ST_X'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (635,'ST_Y'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (636,'SUBCLASS_ORIGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (637,'SUBJECT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (638,'SUPER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (639,'TABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (640,'TABLES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (641,'TABLESPACE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (642,'TABLE_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (643,'TEMPORARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (644,'TERMINATED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (645,'THEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (646,'TIME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (647,'TIMESTAMP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (648,'TO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (649,'TOUCHES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (650,'TRADITIONAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (651,'TRAILING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (652,'TRANSACTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (653,'TRIGGER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (654,'TRIGGERS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (655,'TRUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (656,'TRUNCATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (657,'TYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (658,'UNCOMMITTED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (659,'UNDO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (660,'UNINSTALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (661,'UNION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (662,'UNIQUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (663,'UNLOCK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (664,'UNSIGNED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (665,'UNTIL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (666,'UPDATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (667,'UPGRADE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (668,'USAGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (669,'USE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (670,'USER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (671,'USER_RESOURCES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (672,'USE_FRM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (673,'USING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (674,'VALUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (675,'VALUES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (676,'VARCHARACTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (677,'VARIABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (678,'VARIABLES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (679,'VARYING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (680,'VIEW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (681,'VIRTUAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (682,'WAIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (683,'WARNINGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (684,'WHEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (685,'WHERE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (686,'WHILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (687,'WITH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (688,'WITHIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (689,'WORK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (690,'WRAPPER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (691,'WRITE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (692,'X'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (693,'X509'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (694,'XA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (695,'Y'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (696,'YEAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (697,'YEAR_MONTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (698,'ZEROFILL'); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,0); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,0); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,1); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,2); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (2,3); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (3,4); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,5); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,6); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,6); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,7); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,8); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,9); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (269,10); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,11); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,11); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,11); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,12); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (7,13); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,14); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (14,15); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,15); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,15); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,15); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (15,16); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,17); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,18); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,18); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (108,18); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,19); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,20); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (21,21); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,22); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,23); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,24); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,24); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,25); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,25); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,25); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,26); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,26); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,27); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,27); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,28); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,29); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,30); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,31); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (466,31); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,31); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,32); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,32); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,32); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,32); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,32); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,32); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,33); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (317,34); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,35); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,36); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,37); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,38); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,38); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,38); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,39); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,40); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,40); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,40); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,40); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,41); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,41); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,41); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,41); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,42); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,42); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,43); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,44); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,44); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,44); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,45); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,45); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,45); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,45); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,46); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,46); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,47); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,48); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,49); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,50); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,51); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (48,52); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,53); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (300,54); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,55); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,56); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,56); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,56); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,56); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,57); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,57); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,58); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,59); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,59); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,59); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,59); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,60); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,60); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (56,61); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,62); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,62); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,62); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,62); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,63); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,64); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,65); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,66); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (611,66); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,66); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (438,67); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (66,67); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,68); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,68); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (251,69); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,69); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,69); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,70); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,70); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,70); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,71); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (488,71); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,72); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,72); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,73); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (71,74); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,75); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,75); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (74,76); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,77); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (432,77); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,78); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,79); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,79); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,79); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (80,80); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,81); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,82); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,82); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,82); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (635,82); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (478,83); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (84,83); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,83); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,83); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,84); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,84); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,84); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,85); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,85); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,85); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,85); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,85); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,85); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,86); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (85,87); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,88); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (86,89); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,90); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,91); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,92); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,92); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,92); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (85,93); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,94); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,95); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,96); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,96); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,97); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,98); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,98); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (91,99); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (92,100); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,101); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,101); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (608,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,102); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (94,103); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,104); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,105); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (96,106); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,107); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (451,108); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,109); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (8,0); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (9,0); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (8,1); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (9,2); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (1,3); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,4); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,4); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,5); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,5); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,6); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,6); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,6); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,6); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,7); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,8); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,9); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,10); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,11); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,12); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,13); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,13); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,13); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,13); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (604,13); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,15); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,16); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,16); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,17); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,17); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (38,18); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,19); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (39,20); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,21); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,21); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,21); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,21); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,21); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,22); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,23); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,23); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,24); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,25); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,26); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,27); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,28); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,29); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,30); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,31); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,31); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,32); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,33); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,33); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,33); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,34); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (163,35); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (62,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (71,38); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (589,38); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,39); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (589,39); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (595,40); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,41); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (72,42); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (84,44); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,45); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,45); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,45); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (309,45); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (413,45); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (74,46); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,47); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,47); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,47); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,47); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,48); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,48); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,49); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,49); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,49); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (78,50); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,51); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (80,52); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,53); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (474,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (84,56); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,56); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (83,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (432,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (619,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (432,58); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,59); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,59); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,59); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,60); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (90,60); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,60); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,61); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,61); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,61); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,62); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,62); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,62); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,63); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (91,64); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,64); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,65); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,66); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,66); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,67); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,67); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,67); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,67); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,68); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (444,68); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,69); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,71); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,71); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,71); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,73); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,73); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,74); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,75); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,76); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,76); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,77); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,79); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,79); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,80); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,81); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,81); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,81); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,81); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,82); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,82); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,83); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,83); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,84); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,84); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,84); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,85); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,85); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,85); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,86); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,86); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,86); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (100,87); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,88); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,89); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,89); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (104,90); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (108,91); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,91); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (480,91); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (115,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (447,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (449,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (450,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,94); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (127,95); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,96); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,96); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,97); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,97); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (151,98); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,99); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,99); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,99); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,102); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,102); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,103); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,103); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,104); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,104); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,104); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,104); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,105); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,106); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,107); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,108); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (583,109); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,110); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (516,110); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (103,111); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (194,112); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,113); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,114); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,115); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,116); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,117); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,118); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,118); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,118); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (109,119); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,120); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (208,121); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,122); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,123); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,124); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,124); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (261,124); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,124); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (115,125); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,126); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,126); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,127); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,128); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,129); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,129); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,129); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,129); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,129); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,130); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (123,131); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,132); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,132); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,132); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,133); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,134); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,135); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,135); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (127,136); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,137); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (133,138); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (134,139); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (576,140); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,141); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,142); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,142); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,142); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,142); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,143); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,143); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,143); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (68,143); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (97,143); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,144); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,144); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,144); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,145); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (105,145); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (608,146); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,147); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,147); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,147); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,148); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (552,148); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,149); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (145,150); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (563,151); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (149,152); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,153); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,154); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,155); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,156); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,157); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,158); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (156,159); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,160); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (160,161); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,162); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,163); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,163); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,164); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,165); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,166); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (170,167); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,168); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,169); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,169); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (506,169); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,169); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,169); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,170); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,171); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,172); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (179,173); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (615,174); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (267,175); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,176); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,176); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,177); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,178); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (349,178); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,178); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,178); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,179); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (269,179); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (183,180); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (587,181); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (184,182); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,183); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,184); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (188,185); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,186); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,187); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (193,188); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,189); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,190); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (244,191); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (213,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (269,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (312,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,192); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,193); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,193); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,193); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (72,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (512,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (620,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (251,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (44,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,194); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (194,195); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,196); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,196); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,196); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,196); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,197); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (188,198); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,199); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (201,200); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,201); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,202); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,203); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,204); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (203,205); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (583,206); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (208,207); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (206,208); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (205,209); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (208,210); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,211); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,212); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,213); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (97,213); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (607,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (506,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (13,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (349,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (17,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (247,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (44,214); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,110); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,111); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (147,112); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (149,113); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,114); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,114); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,114); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,115); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (151,115); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,115); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,115); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,117); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,118); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,118); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,119); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,119); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,119); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,120); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,120); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,121); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,121); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,121); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,122); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,122); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,122); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,123); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,124); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,125); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (160,126); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,127); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,127); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,127); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,128); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,128); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,128); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,129); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (161,130); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,131); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (108,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (330,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (349,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (574,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (604,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,133); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,134); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,134); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (164,134); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (630,134); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (147,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (169,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (170,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (171,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (173,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (175,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (176,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (179,136); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,137); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,138); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,139); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,140); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,140); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,141); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,142); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,142); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,142); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,143); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,144); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (630,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (183,146); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,147); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (175,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,149); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (456,149); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (185,150); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (186,151); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,152); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,153); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,153); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,154); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,155); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,156); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,156); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,156); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (447,156); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,157); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,157); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,157); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,158); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,159); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,160); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,160); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (173,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,162); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,163); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,164); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,164); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,165); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,166); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,167); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,167); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,168); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (191,169); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (8,170); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (596,171); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,173); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (194,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,175); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,175); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,175); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,176); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,177); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,178); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,179); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,179); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,179); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,180); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (149,180); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,181); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,182); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (163,183); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,184); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,184); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (151,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (474,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,186); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,187); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,187); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,187); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,187); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,188); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (595,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (469,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (477,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (169,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (170,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,193); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (206,194); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,195); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (210,196); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (206,197); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,198); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (213,199); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (214,200); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (211,201); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (212,202); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (213,203); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (214,204); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,205); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,206); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,207); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,207); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,207); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,207); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (479,207); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,209); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,209); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,210); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (115,210); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,210); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,210); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,211); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,211); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,212); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,213); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (225,214); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,215); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,216); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (604,216); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (214,217); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,218); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (553,219); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,220); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,220); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (387,221); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,222); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,223); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,224); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,225); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (216,226); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,227); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,228); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,229); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (503,229); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,229); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,229); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,229); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,230); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,231); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,232); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (210,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (216,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (144,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (635,233); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,234); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,235); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,236); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,237); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (222,238); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (226,239); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,240); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,240); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,240); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,240); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (228,241); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,242); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,243); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (608,244); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,245); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,246); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (20,247); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,247); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,248); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (235,249); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,250); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,251); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,252); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,253); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,254); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,254); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (553,254); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,255); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,255); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (582,255); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,256); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,257); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (245,258); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,259); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,260); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,261); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,262); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,263); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,263); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,263); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,263); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (97,263); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (248,264); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (250,265); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,266); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,266); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,267); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,268); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,268); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (253,269); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (252,270); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,271); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,272); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,272); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,272); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,273); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,274); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (226,214); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (227,215); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (228,216); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,217); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,217); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,218); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,219); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,219); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,219); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,220); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,221); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,222); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,223); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,223); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,223); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,223); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (173,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,226); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,227); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,227); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (171,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (309,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,230); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,231); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,231); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,232); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,232); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (9,233); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,234); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,235); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,235); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,237); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,237); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,238); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,239); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (589,240); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,241); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (344,242); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (245,243); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (58,244); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,245); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,245); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (245,245); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (247,246); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (248,247); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,248); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,248); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,248); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,248); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,249); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (309,249); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,249); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,249); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,250); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,250); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (250,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (251,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (252,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (253,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,252); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (255,253); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,254); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (258,255); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,256); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,256); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,256); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (265,257); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,258); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,258); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,259); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,259); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (267,260); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,261); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (269,262); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (270,263); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,264); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (272,265); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,266); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,267); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (275,268); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (276,269); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (277,270); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (278,271); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,272); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (280,273); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,274); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (258,275); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (363,276); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,277); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,278); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,279); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,279); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (104,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (44,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,280); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,281); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (264,282); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (265,283); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,284); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,284); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,285); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,286); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,286); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (267,287); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (617,288); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,288); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,289); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,289); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,289); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,290); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,290); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,290); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,290); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,291); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (276,292); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,293); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,293); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,293); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (277,294); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (278,295); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,296); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (488,297); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,298); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,299); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (398,300); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (283,301); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (284,302); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,303); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,303); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,303); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (285,304); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,305); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,306); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (372,307); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (128,307); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,307); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,307); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (289,308); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (372,309); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (128,309); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,309); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,309); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,309); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (507,309); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,310); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,311); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,311); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,312); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,313); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,314); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,315); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,315); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,315); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,316); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (5,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (518,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,317); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,318); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,319); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (518,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,320); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,321); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (618,322); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,323); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,324); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,325); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (524,326); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,327); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,327); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (629,327); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,328); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (299,329); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (300,330); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,331); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,332); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,332); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,332); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,332); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,333); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (304,334); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,335); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,335); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,336); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,336); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,336); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (506,336); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,336); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,336); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (372,337); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,337); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,337); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,338); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (307,339); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,340); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,341); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,342); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (313,343); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,344); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,344); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,344); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,345); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (318,346); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,347); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,347); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (320,348); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,349); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,350); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,350); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,350); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,351); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (451,352); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,352); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (322,353); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,354); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (144,355); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,356); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,356); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,356); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (328,357); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,358); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,359); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,360); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,360); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,361); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,361); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,361); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,361); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,361); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,362); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,363); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,363); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (317,364); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,364); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,364); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,365); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,365); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,365); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,365); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,365); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (433,366); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,367); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (388,368); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (466,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (5,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (261,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (58,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (256,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (518,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,369); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,370); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,371); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,371); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,371); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,372); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (341,373); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,374); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,374); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,374); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,375); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,375); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (190,375); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,375); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (604,375); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,376); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (344,377); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,378); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,378); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,379); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,380); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,380); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,380); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,380); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,380); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,381); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,382); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,382); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,383); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (347,384); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,385); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,385); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,385); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,386); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,387); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,387); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,387); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,388); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,388); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,388); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (354,389); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,390); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,390); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,390); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,391); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,391); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,391); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,391); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,391); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,392); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,392); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,392); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (225,392); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,393); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,394); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,394); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,394); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,394); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,394); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,394); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (359,395); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,396); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,397); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,397); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,397); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,398); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,399); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,400); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (244,401); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (61,402); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,403); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,404); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (611,404); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,404); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,405); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,405); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,405); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (369,406); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,407); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,408); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,408); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,408); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,409); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,410); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,411); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,412); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,413); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,414); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,415); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,416); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,417); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,418); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (379,419); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (13,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (630,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (211,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,420); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,421); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (382,422); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,423); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (383,424); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,425); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,426); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,426); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (629,426); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,426); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (362,427); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (270,427); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (516,427); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,428); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,429); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (387,430); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (5,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (518,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,431); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,432); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,432); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (388,433); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,434); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (611,434); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,434); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,435); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,436); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,437); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,437); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,437); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (620,437); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (394,438); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,439); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,439); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,440); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,440); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,441); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,441); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,441); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (97,441); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (582,442); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (138,443); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (400,444); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (213,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (363,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (312,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (314,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,445); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (402,446); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,447); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,447); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,447); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (405,448); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (211,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,449); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,450); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,451); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,452); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,453); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (608,454); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,455); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,456); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (412,457); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (466,458); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,459); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,459); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,460); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,460); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,461); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,461); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,461); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,462); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,463); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,463); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,463); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,463); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,463); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,463); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,464); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (405,465); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,466); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,466); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,467); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (247,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (256,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,468); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (586,469); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (312,470); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,471); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (430,472); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,473); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,473); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (44,473); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,473); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,474); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,474); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,475); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (426,476); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (433,477); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,478); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,479); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (607,480); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,480); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (104,480); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,481); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,482); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,483); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,484); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,484); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,484); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (444,485); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,486); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,487); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (317,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (451,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (426,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (398,488); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,489); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,489); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,489); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,490); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,491); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,492); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,492); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,492); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,493); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,493); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,494); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,494); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,495); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,495); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (583,495); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,495); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,496); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,497); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,498); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,498); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,499); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,500); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,501); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,501); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (132,501); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,501); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (123,502); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,503); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (617,504); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,505); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,505); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,505); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,505); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,505); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (605,506); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,507); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,507); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,508); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (469,509); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,510); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,510); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,510); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,510); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,510); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (517,511); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,512); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (282,275); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (283,276); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (284,277); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (285,278); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (286,279); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,280); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (288,281); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (289,282); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (291,284); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,285); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (293,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,287); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,287); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,287); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,287); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,287); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,288); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,288); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,288); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,289); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,289); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,290); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,291); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (595,292); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (300,293); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,294); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,296); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,296); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (488,296); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (304,298); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (305,299); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,300); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,300); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,301); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (304,302); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (305,303); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,304); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (309,304); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,307); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (115,307); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,307); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,308); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,308); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,308); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,308); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,309); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,310); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (321,311); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (413,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (463,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,314); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,315); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,316); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,317); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,318); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,319); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,320); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,321); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,323); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,324); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,325); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,326); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,327); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,328); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,330); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,331); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,332); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,334); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,335); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,335); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,335); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,336); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,336); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,336); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,337); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,337); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,338); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,339); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,339); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,339); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,340); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,340); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,340); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,341); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,342); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (336,343); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,344); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,345); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (341,347); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,348); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,349); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,350); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,351); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,351); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,351); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (344,352); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,353); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,354); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,355); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,355); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,356); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,357); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (2,358); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (353,358); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,359); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,359); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,360); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,361); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,362); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (357,363); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (358,364); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (359,365); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,366); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (360,367); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,369); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,370); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,371); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (357,372); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (362,373); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (358,374); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (359,375); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,376); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,376); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,377); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,379); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (435,380); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (83,381); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (619,381); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (83,383); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,384); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,385); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,386); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,386); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,387); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,388); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,388); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,389); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,390); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (251,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (252,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,392); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,392); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,392); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,392); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (252,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (253,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,394); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (149,395); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (370,396); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,397); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (372,398); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (619,399); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,400); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,401); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,401); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,401); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,401); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,402); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,402); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,402); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,403); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (376,403); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,403); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,403); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,404); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,404); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,405); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,407); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,408); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,408); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (378,409); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,411); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,412); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (380,413); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,414); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,415); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,415); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,416); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,416); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,416); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,417); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,419); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,420); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (9,422); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,423); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,423); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (603,423); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,424); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,425); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (385,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (386,427); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (387,428); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (388,429); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (389,430); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (390,431); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (391,432); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (389,433); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (390,434); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,435); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (393,436); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (394,437); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,438); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (147,439); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (395,439); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,439); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,440); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,440); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,441); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,442); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,443); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,443); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,443); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (466,443); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (449,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,445); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,446); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (469,446); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,447); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (471,448); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,449); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,450); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (413,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,452); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,452); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,452); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (402,453); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,456); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,457); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,458); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,459); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,459); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,459); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,460); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,461); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,463); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (425,464); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,464); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,464); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,465); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,466); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,467); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,467); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (406,467); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,467); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,468); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,469); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,469); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,470); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,472); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,472); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,472); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,473); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,474); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,475); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,476); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,478); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,479); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,480); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,480); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,481); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,481); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,481); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (413,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,483); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,484); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,484); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,484); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (417,485); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,486); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,487); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (419,488); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,489); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,490); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (425,491); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,491); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,491); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,492); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,493); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,494); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,494); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (425,495); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,496); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,496); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,497); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,497); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,497); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,497); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,497); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,498); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,498); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,499); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,499); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,499); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,500); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,501); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,503); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,504); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,504); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,505); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,506); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,506); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (173,506); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,507); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,507); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,507); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (479,507); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (432,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (435,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (436,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (438,509); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (438,510); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,511); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,512); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (444,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (447,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (449,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (450,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (456,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (463,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (466,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (469,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (471,513); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,513); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,514); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,515); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,515); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,516); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,517); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,518); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,518); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,518); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,519); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,519); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,520); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (138,521); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,522); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (477,523); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,524); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,525); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,525); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,525); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,526); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (481,527); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,528); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,529); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (58,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (68,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (44,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,530); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,531); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,531); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (474,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (476,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (477,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (478,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (479,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (480,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,514); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (481,514); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,515); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,516); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (413,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (474,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,518); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,519); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,519); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,520); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,521); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (488,522); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,523); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,523); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,525); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,526); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,527); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,528); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,529); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,530); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,531); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,532); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,533); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,534); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (489,535); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,536); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,537); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,537); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,538); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,539); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (496,540); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,541); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (317,541); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (451,541); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,541); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (426,541); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (398,541); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,542); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,543); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,544); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,545); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (499,546); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (261,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,547); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,548); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,548); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,549); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (503,550); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,550); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,551); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,552); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,552); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,552); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (510,553); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (236,553); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,553); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,554); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (451,555); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,556); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (630,556); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (515,557); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,558); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (349,558); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,558); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,559); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (517,560); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,561); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,561); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,561); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (146,562); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,563); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,564); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,564); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,564); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,564); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,565); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (520,566); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,567); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,568); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,569); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (93,570); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (523,571); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,572); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,572); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (524,573); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (526,574); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,575); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,576); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,576); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,577); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (512,578); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,578); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (213,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (362,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (488,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (13,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (20,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (190,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (225,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (105,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (630,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (506,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (632,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (108,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (247,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (211,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (516,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (604,579); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,580); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (535,580); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,581); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,582); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (93,582); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,583); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (326,584); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,584); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,584); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,584); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,584); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,585); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (105,585); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (390,586); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,587); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,588); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,588); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,589); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,590); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,590); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (559,591); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,591); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,592); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,593); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,593); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,594); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,594); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,595); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,595); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,595); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,596); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,596); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (373,596); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,596); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,596); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,533); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (434,534); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,535); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,536); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,536); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,537); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,538); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,538); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,538); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,539); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,539); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,539); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,540); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (495,541); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,542); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,543); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,543); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,544); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,544); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,545); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,545); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (463,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (474,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (476,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (496,547); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (497,548); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (500,549); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (456,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,551); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,552); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,552); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,553); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (503,554); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (504,555); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,556); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (506,557); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (504,558); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (506,559); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (507,560); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (508,561); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,562); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (510,563); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (511,564); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (512,565); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (513,566); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,567); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (515,568); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (516,569); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (517,570); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (518,571); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (519,572); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (520,573); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,574); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (522,575); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (523,576); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (524,577); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (523,578); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (524,579); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,580); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (529,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,582); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (526,583); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (527,584); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,585); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (529,586); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,587); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (531,588); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (532,589); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,590); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,591); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (535,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (536,593); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (537,594); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (539,595); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,596); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,597); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (560,598); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,599); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (563,600); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,601); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,601); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (564,602); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,603); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,603); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (567,604); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,605); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,606); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (571,607); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,608); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,608); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (5,608); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,609); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (80,610); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,611); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,612); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,613); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,614); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (92,615); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (576,616); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,617); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (72,617); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,617); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,617); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,618); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,618); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,618); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (379,619); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,620); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (580,621); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (581,622); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,623); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,623); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (7,624); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (586,625); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (587,626); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (298,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,627); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,628); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,629); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (362,630); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,630); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (314,631); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,632); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,633); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (591,634); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,635); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,636); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,637); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,638); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (594,639); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,640); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,640); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,641); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (210,641); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,641); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,642); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,643); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (595,644); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,645); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,645); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,645); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,646); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (598,647); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (603,648); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (605,649); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,650); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,651); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,651); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,652); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,653); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (611,654); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (612,655); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,656); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (613,657); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,658); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (615,659); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,660); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,660); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,660); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,661); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,661); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,661); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,661); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,661); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,661); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,662); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (44,662); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,662); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,662); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,662); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (144,663); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (618,664); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (610,665); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,665); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,665); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (621,666); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (620,667); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,667); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,668); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,668); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,669); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,669); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (623,670); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,670); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,671); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,671); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,672); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,672); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,672); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,672); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,673); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,674); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,674); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (572,675); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,675); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,675); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,676); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,677); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,677); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,677); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (635,678); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (325,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (555,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (495,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (270,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (503,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,679); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (292,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (403,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (620,680); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,681); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (636,682); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (637,683); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,684); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,685); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,685); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,685); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (190,685); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,685); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,686); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,687); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (22,688); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,689); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (17,689); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,689); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,690); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (632,690); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,691); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (384,691); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,692); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,693); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,693); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,693); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,694); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,695); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (625,695); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,696); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,696); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,696); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,696); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (437,696); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,696); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (296,697); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (616,697); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (208,698); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,698); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (539,597); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,600); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (543,601); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (544,602); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,603); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (546,604); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (547,605); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (548,606); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (543,607); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (544,608); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,609); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (546,610); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (547,611); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (548,612); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (549,613); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (550,614); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (550,615); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (551,616); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (552,617); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (553,618); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (554,619); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (555,620); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (556,621); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,622); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (558,623); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,624); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (558,625); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (559,626); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (560,627); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,628); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (562,629); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (563,630); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (564,631); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,632); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (566,633); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (567,634); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,635); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,636); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,636); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,636); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,637); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,637); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,637); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,638); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (90,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (406,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (450,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (476,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (490,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (598,639); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,640); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,640); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,640); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (464,640); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (477,640); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,641); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,641); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,641); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (175,641); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,642); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,642); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,642); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (174,643); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,644); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,645); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,645); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,645); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,646); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,646); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (580,646); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (582,647); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (583,647); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (81,648); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,648); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (425,648); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (591,649); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,650); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (595,651); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,652); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,652); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,653); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (176,653); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,653); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,654); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (478,654); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (596,655); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,656); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (598,656); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,657); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,658); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (152,659); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (603,660); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,661); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (604,661); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,662); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,663); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,663); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,663); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (58,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (102,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (149,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (245,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (589,664); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (410,665); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (99,666); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,666); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (429,666); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,666); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,667); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,667); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,667); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,668); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,669); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,669); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (609,669); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (493,670); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,671); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,672); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,673); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,673); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (266,673); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,674); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,674); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,674); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,674); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (483,674); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,675); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (411,675); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (619,676); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,677); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,678); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (479,678); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (619,679); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,680); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,680); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,680); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,681); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,682); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (119,682); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (440,683); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (480,683); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,684); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (76,684); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (157,685); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (224,685); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,685); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,685); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (606,685); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (630,686); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (114,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (199,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,687); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (631,688); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,689); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,690); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,691); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,691); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (494,691); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,691); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (633,692); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (34,693); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,693); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,693); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (634,694); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (636,695); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,696); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (139,697); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (58,698); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (149,698); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,698); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,698); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (245,698); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (589,698); COMMIT; From f660a863697ebb7345af19c22e0d5a30c08bc0ed Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 22 Jan 2019 18:05:59 +0200 Subject: [PATCH 198/214] PS-4688: Add section about SSL improvements --- doc/source/index.rst | 1 + doc/source/management/ssl-improvement.rst | 103 ++++++++++++++++++ .../Percona-Server-5.5.61-38.13.rst | 38 ------- 3 files changed, 104 insertions(+), 38 deletions(-) create mode 100644 doc/source/management/ssl-improvement.rst delete mode 100644 doc/source/release-notes/Percona-Server-5.5.61-38.13.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index d54759e125ec..d252c153880f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -138,6 +138,7 @@ Management Improvements management/start_transaction_with_consistent_snapshot management/super_read_only management/extended_show_grants + management/ssl-improvement Diagnostics Improvements ======================== diff --git a/doc/source/management/ssl-improvement.rst b/doc/source/management/ssl-improvement.rst new file mode 100644 index 000000000000..87cbfa2e2d16 --- /dev/null +++ b/doc/source/management/ssl-improvement.rst @@ -0,0 +1,103 @@ +.. _percona-server.management.ssl: + +================================================================================ +SSL Improvements +================================================================================ + +|Percona Server| enables transmitting data in the encrypted form by using the +TLSv1.2 protocol. By default, |Percona Server| disables TLSv1.0 and deprecates +TLSv1.1. + +.. rubric:: Implemented Using |openssl| + +|Percona Server| binaries link with the |openssl| library to implement the +support of TLS protocols. |Percona Server| supports |openssl| version 1.1. + +|Percona Server| binaries do not link with the |yassl.def| as |MySQL| Community +Edition does. The |yassl| library only supports TSLv1.0 and TSL1.1 protocols +which are less secure than TLSv1.2. You may still link with |yassl| when +building |Percona Server| from source. + +As part of its implementation, |Percona Server| offers correct diagnostic +messages in cases like ciphers on the client and the server mismatching, +the required TLS version not enabled, and so on. For more information, see +`#75311 Error for SSL cipher is unhelpful +`_. + +.. important:: + + As |Percona Server| does not use |yassl|, |yassl| security advisories are not + applicable to |Percona Server|. System administrators should track the + security advisories relevant to |openssl| and upgrade their operating system + promptly. + +.. seealso:: + + More information about |yassl.def| + https://www.wolfssl.com/products/yassl/ + |MySQL| Documentation: OpenSSL Versus yaSSL + https://dev.mysql.com/doc/refman/5.6/en/openssl-versus-yassl.html + |MySQL| Bug System (solved for |Percona Server|): + `#75311 Error for SSL cipher is unhelpful `_ + +By default, |Percona Server| passes elliptic curve crypto-based +ciphers to OpenSSL, such as ECDHE-RSA-AES128-GCM-SHA256. + +.. note:: + + Although documented as supported, elliptic curve crypto-based ciphers do not work with |MySQL|. + + .. seealso:: + + |MySQL| Bug System (solved for |Percona Server|): + `#82935 Cipher ECDHE-RSA-AES128-GCM-SHA256 listed in man/Ssl_cipher_list, not supported `_ + +.. _percona-server.management.ssl.multi-domain-certificate: + +Multi-Domain Certificates +================================================================================ + +|Percona Server| supports multi-domain certificates (:abbr:`SAN (Subject +Alternative Name)`). This feature is useful to help manage the storage better, +for building high availability clusters, or as part of a backup solution. + +.. seealso:: + + |Percona| Blog Post: When would you use SAN with MySQL? + https://www.percona.com/blog/2009/03/09/when-would-you-use-san-with-mysql/ + |MySQL| Bug System (solved for |Percona Server|): + `#68052 SSL Certificate Subject ALT Names with IPs not respected with --ssl-verify-serve `_ + + +.. _percona-server.management.ssl.compatibility-matrix: + +Compatibility Matrix +================================================================================ + +========================================== ======= ================== ================ +Feature YaSSL OpenSSL < 1.0.2 OpenSSL >= 1.0.2 +========================================== ======= ================== ================ +Validation of SSL certificate common name Yes Yes Yes +Validation of |san.abbr| No Yes Yes +Support for wildcard names No No Yes +========================================== ======= ================== ================ + +.. _percona-server.management.ssl.mysqlbinlog: + +SSL Improvements in ``mysqlbinlog`` +================================================================================ + +|Percona Server| extends :command:`mysqlbinlog` to accept the ``SSL`` connection +options as all the other client programs. + +.. seealso:: + + How |Percona Server| extends the functionality of :command:`mysqlbinlog` + :ref:`extended_mysqlbinlog` + |MySQL| Bug System (solved for |Percona Server|): + `#41975 Support for SSL options not included in mysqlbinlog `_ + +.. |openssl| replace:: OpenSSL +.. |yassl| replace:: yaSSL +.. |yassl.def| replace:: :abbr:`yaSSL embedded SSL library` +.. |san.abbr| replace:: :abbr:`SAN (Subject Alternative Name)` diff --git a/doc/source/release-notes/Percona-Server-5.5.61-38.13.rst b/doc/source/release-notes/Percona-Server-5.5.61-38.13.rst deleted file mode 100644 index d091bfb1dadc..000000000000 --- a/doc/source/release-notes/Percona-Server-5.5.61-38.13.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. rn:: 5.5.61-38.13 - -================================================================================ -|Percona Server| 5.5.61-38.13 -================================================================================ - -Percona is glad to announce the release of |Percona Server| 5.5.61-38.13 on -August 17th, 2018. Downloads are available `here -`_ -and from the :doc:`Percona Software Repositories `. This release -merges changes of :ref:`MySQL 5.5.61 -", including -all the bug fixes in it. Percona Server for MySQL 5.5.61-38.13 is now the -current GA release in the 5.6 series. All of Percona’s software is open-source -and free. - -Bugs Fixed -================================================================================ - -* The ``--innodb-optimize-keys`` option of the ``mysqldump`` utility - fails when a dumped table has two columns such that the name of one - of them contains the other as a prefix and is defined with the - AUTO_INCREMENT attribute. Bug fixed :psbug:`4524`. - - -Other Bugs Fixed -================================================================================ - -- :psbug:`4566` "stack-use-after-scope in reinit_io_cache()" (upstream :mysqlbug:`91603`) -- :psbug:`4581` "stack-use-after-scope in _db_enter_() / mysql_select_db()" (upstream :mysqlbug:`91604`) -- :psbug:`4600` "stack-use-after-scope in _db_enter_() / get_upgrade_info_file_name()" (upstream :mysqlbug:`91617`) -- :psbug:`3976` "Errors in MTR tests main.variables-big, - main.information_schema-big, innodb.innodb_bug14676111" - -Find the release notes for Percona Server for MySQL 5.5.61-38.13 in our `online -documentation -`_. -Report bugs in the `Jira bug tracker `_. From 4528aed105580855ccbad42e6f5a48cd57fae7e8 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Thu, 3 Jan 2019 10:54:45 +0100 Subject: [PATCH 199/214] PS-4996, PS-3956: Fixing user statistics bugs * Added tests to ensure that some untested columns of user/thread statisctics work correctly, as they were mentioned in PS-4996. Some counters are only bugged in later versions, but work in 5.6. * Fixed commit counter: committed transactions weren't counted * Fixed access denied counter: most access denied paths weren't counted * Fixed denied connections counter: authentication failures weren't counted This is a cherry-pick of 6ee45b95be7c931fc83290d83f0c592a065b9deb, as GCA merge in a merge conflict to the 5.7 trunk. --- mysql-test/r/percona_userstat.result | 21 ++++++ .../r/percona_userstat_conn_handling.result | 7 ++ mysql-test/t/percona_userstat.test | 19 +++++ .../t/percona_userstat_conn_handling.test | 43 +++++++++++ sql/auth/sql_authentication.cc | 7 ++ sql/auth/sql_authorization.cc | 1 + sql/handler.cc | 3 + sql/sql_connect.cc | 74 ++++++++++--------- sql/sql_connect.h | 1 + sql/sql_parse.cc | 2 + 10 files changed, 143 insertions(+), 35 deletions(-) diff --git a/mysql-test/r/percona_userstat.result b/mysql-test/r/percona_userstat.result index 39a0caf5779d..a3eb93b034b7 100644 --- a/mysql-test/r/percona_userstat.result +++ b/mysql-test/r/percona_userstat.result @@ -109,7 +109,9 @@ INFORMATION_SCHEMA.USER_STATISTICS ; select_must_be_true_6 update_must_be_true_6 other_must_be_true_6 rows_must_be_true_6 1 1 1 1 +# # Bug lp:1659992 "Function over userstat tables cause mysql to crash" +# CREATE FUNCTION utility_get_global_variable(in_name VARCHAR(64)) RETURNS VARCHAR(1024) CHARSET utf8 DETERMINISTIC SQL SECURITY INVOKER BEGIN DECLARE var_value VARCHAR(1024); @@ -124,4 +126,23 @@ SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS s WHERE utility_get_global_variable('userstat') = 'ON'; DROP FUNCTION utility_get_global_variable; +# +# Bug PS-4996: statistics commit counter doesn't work +# +SET autocommit=0; +START TRANSACTION; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (42); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (42); +ROLLBACK; +SELECT COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS FROM INFORMATION_SCHEMA.THREAD_STATISTICS; +COMMIT_TRANSACTIONS ROLLBACK_TRANSACTIONS +0 0 +SELECT COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS; +COMMIT_TRANSACTIONS ROLLBACK_TRANSACTIONS +7 1 +SET autocommit=1; +DROP TABLE t1; SET GLOBAL userstat= @userstat_old; diff --git a/mysql-test/r/percona_userstat_conn_handling.result b/mysql-test/r/percona_userstat_conn_handling.result index 73967e28a5e2..9d7d77949ddf 100644 --- a/mysql-test/r/percona_userstat_conn_handling.result +++ b/mysql-test/r/percona_userstat_conn_handling.result @@ -14,15 +14,20 @@ SELECT 1; 1 1 include/assert.inc [I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: two connections] +include/assert.inc [I_S.USER_STATISTICS TOTAL_CONNECTIONS: two connections] include/assert.inc [I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: handle disconnects] +include/assert.inc [I_S.USER_STATISTICS TOTAL_CONNECTIONS: two connections after disconnect] SELECT 1; 1 1 include/assert.inc [I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: connections from other users] +include/assert.inc [I_S.USER_STATISTICS TOTAL_CONNECTIONS: connections from other users] include/assert.inc [I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: no connections - zero concurrency] set password for mysqltest_2@"localhost" = 'foo'; ERROR 28000: Access denied for user 'mysqltest_2'@'localhost' (using password: NO) include/assert.inc [I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: wrong password connection] +include/assert.inc [I_S.USER_STATISTICS TOTAL_CONNECTIONS: failed connection] +include/assert.inc [I_S.USER_STATISTICS DENIED_CONNECTIONS: failed connection] SELECT 1; 1 1 @@ -45,6 +50,8 @@ SELECT 1; 1 1 include/assert.inc [I_S.CLIENT_STATISTICS CONCURRENT_CONNECTIONS: two connections after userstat=1] +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'foo' +include/assert.inc [I_S.USER_STATISTICS ACCESS_DENIED: counts previous error] DROP USER mysqltest_1@localhost; DROP USER mysqltest_2@localhost; SET GLOBAL userstat= @userstat_old; diff --git a/mysql-test/t/percona_userstat.test b/mysql-test/t/percona_userstat.test index 25ecf408d965..c939fa70403e 100644 --- a/mysql-test/t/percona_userstat.test +++ b/mysql-test/t/percona_userstat.test @@ -136,7 +136,9 @@ FROM INFORMATION_SCHEMA.USER_STATISTICS ; +--echo # --echo # Bug lp:1659992 "Function over userstat tables cause mysql to crash" +--echo # delimiter |; CREATE FUNCTION utility_get_global_variable(in_name VARCHAR(64)) RETURNS VARCHAR(1024) CHARSET utf8 DETERMINISTIC SQL SECURITY INVOKER @@ -159,4 +161,21 @@ SELECT * DROP FUNCTION utility_get_global_variable; + +--echo # +--echo # Bug PS-4996: statistics commit counter doesn't work +--echo # +SET autocommit=0; +START TRANSACTION; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (42); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (42); +ROLLBACK; +SELECT COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS FROM INFORMATION_SCHEMA.THREAD_STATISTICS; +SELECT COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS; +SET autocommit=1; +DROP TABLE t1; + SET GLOBAL userstat= @userstat_old; diff --git a/mysql-test/t/percona_userstat_conn_handling.test b/mysql-test/t/percona_userstat_conn_handling.test index d4112cdb5938..247e9e251a5a 100644 --- a/mysql-test/t/percona_userstat_conn_handling.test +++ b/mysql-test/t/percona_userstat_conn_handling.test @@ -30,6 +30,12 @@ connection default; --let $assert_cond= "$query_result" = 2 --source include/assert.inc +# Test total connections number +--let $assert_text= I_S.USER_STATISTICS TOTAL_CONNECTIONS: two connections +--let $query_result= query_get_value(SELECT TOTAL_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', TOTAL_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 2 +--source include/assert.inc + # Check if number of concurrent connections decreased disconnect conn2; connection default; @@ -41,6 +47,12 @@ let $count_sessions= 2; --let $assert_cond= "$query_result" = 1 --source include/assert.inc +# Test total connections number unchanged +--let $assert_text= I_S.USER_STATISTICS TOTAL_CONNECTIONS: two connections after disconnect +--let $query_result= query_get_value(SELECT TOTAL_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', TOTAL_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 2 +--source include/assert.inc + # Number of concurrent connections shouldn't be affected by different users connect (conn3,localhost,mysqltest_2,,); SELECT 1; @@ -51,6 +63,12 @@ connection default; --let $assert_cond= "$query_result" = 1 --source include/assert.inc +# Test total connections number +--let $assert_text= I_S.USER_STATISTICS TOTAL_CONNECTIONS: connections from other users +--let $query_result= query_get_value(SELECT TOTAL_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', TOTAL_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 2 +--source include/assert.inc + # if there is no connections, concurrent connections counter should be zero disconnect conn1; @@ -81,6 +99,18 @@ connection default; --let $assert_cond= "$query_result" = 1 --source include/assert.inc +# Failed connection attempt should keep number of total connections intact +--let $assert_text= I_S.USER_STATISTICS TOTAL_CONNECTIONS: failed connection +--let $query_result= query_get_value(SELECT TOTAL_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_2', TOTAL_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + +# Denied connections should record the failure +--let $assert_text= I_S.USER_STATISTICS DENIED_CONNECTIONS: failed connection +--let $query_result= query_get_value(SELECT DENIED_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_2', DENIED_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + # We need alive connection to check that flush will not remove concurent_connections counter # and disconnect not causing debug assert connect (conn1,localhost,mysqltest_1,,); @@ -145,6 +175,19 @@ connection default; --let $assert_cond= "$query_result" = 2 --source include/assert.inc +# verify access_denied works +connection conn1; +--disable_query_log +--error ER_DBACCESS_DENIED_ERROR +CREATE DATABASE foo; +--enable_query_log + +connection default; +--let $assert_text= I_S.USER_STATISTICS ACCESS_DENIED: counts previous error +--let $query_result= query_get_value(SELECT ACCESS_DENIED FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', ACCESS_DENIED, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + disconnect conn2; disconnect conn1; connection default; diff --git a/sql/auth/sql_authentication.cc b/sql/auth/sql_authentication.cc index 8cb945bf3e50..36ae6f9f6a69 100644 --- a/sql/auth/sql_authentication.cc +++ b/sql/auth/sql_authentication.cc @@ -461,6 +461,13 @@ static void login_failed_error(MPVIO_EXT *mpvio, int passwd_used) { THD *thd= current_thd; +#ifndef EMBEDDED_LIBRARY + thd->diff_denied_connections++; + update_global_user_stats(thd, false, time(NULL), mpvio->auth_info.user_name, + mpvio->auth_info.host_or_ip, + mpvio->auth_info.host_or_ip); +#endif /* EMBEDDED_LIBRARY */ + if (thd->is_error()) sql_print_information("%s", thd->get_stmt_da()->message_text()); diff --git a/sql/auth/sql_authorization.cc b/sql/auth/sql_authorization.cc index 2385ae13d13a..882239efbeaf 100644 --- a/sql/auth/sql_authorization.cc +++ b/sql/auth/sql_authorization.cc @@ -960,6 +960,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, (db ? db : (thd->db().str ? thd->db().str : "unknown"))); + thd->diff_access_denied_errors++; DBUG_RETURN(TRUE); } diff --git a/sql/handler.cc b/sql/handler.cc index 607bc9cd1718..1298d3c7c447 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1882,6 +1882,9 @@ int ha_commit_trans(THD *thd, bool all, bool ignore_global_read_lock) gtid_state->update_on_commit(thd); } + if(!error) + thd->diff_commit_trans++; + DBUG_RETURN(error); } diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 32f3f64739d3..c96ce2f81eff 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -596,57 +596,62 @@ static void update_global_thread_stats_with_thread(THD* thd, thread_stats->empty_queries+= thd->diff_empty_queries; } -// Updates the global stats of a user or client void update_global_user_stats(THD* thd, bool create_user, time_t now) { - const char* user_string= - get_valid_user_string(thd->m_main_security_ctx.user().str); - const char* client_string= get_client_host(thd); + update_global_user_stats(thd, create_user, now, + get_valid_user_string(thd->security_context()->user().str), + get_client_host(thd), thd->security_context()->ip().str); +} +// Updates the global stats of a user or client +void update_global_user_stats(THD* thd, bool create_user, time_t now, const char* user_string, const char* client_string, const char* ip) +{ USER_STATS* user_stats; THREAD_STATS* thread_stats; - if (acl_is_utility_user(thd->security_context()->user().str, - thd->security_context()->host().str, - thd->security_context()->ip().str)) + if (acl_is_utility_user(user_string, client_string, ip)) return; mysql_mutex_lock(&LOCK_global_user_client_stats); // Update by user name - if ((user_stats = (USER_STATS *) my_hash_search(&global_user_stats, - (uchar *) user_string, - strlen(user_string)))) - { - // Found user. - update_global_user_stats_with_user(thd, user_stats, now); - } - else - { - // Create the entry - if (create_user) + if (user_string != NULL) { + if ((user_stats = (USER_STATS *) my_hash_search(&global_user_stats, + (uchar *) user_string, + strlen(user_string)))) { - increment_count_by_name(user_string, user_string, - &global_user_stats, thd); + // Found user. + update_global_user_stats_with_user(thd, user_stats, now); + } + else + { + // Create the entry + if (create_user) + { + increment_count_by_name(user_string, user_string, + &global_user_stats, thd); + } } } // Update by client IP - if ((user_stats = (USER_STATS *) my_hash_search(&global_client_stats, - (uchar *) client_string, - strlen(client_string)))) - { - // Found by client IP - update_global_user_stats_with_user(thd, user_stats, now); - } - else - { - // Create the entry - if (create_user) + if (client_string != NULL) { + if ((user_stats = (USER_STATS *) my_hash_search(&global_client_stats, + (uchar *) client_string, + strlen(client_string)))) { - increment_count_by_name(client_string, - user_string, - &global_client_stats, thd); + // Found by client IP + update_global_user_stats_with_user(thd, user_stats, now); + } + else + { + // Create the entry + if (create_user) + { + increment_count_by_name(client_string, + user_string, + &global_client_stats, thd); + } } } @@ -1359,7 +1364,6 @@ static bool login_connection(THD *thd, bool extra_port_connection) VIO_TYPE_NAMEDPIPE) my_sleep(1000); /* must wait after eof() */ #endif - thd->diff_denied_connections++; DBUG_RETURN(1); } /* Connect completed, set read/write timeouts back to default */ diff --git a/sql/sql_connect.h b/sql/sql_connect.h index 66f5e4e49769..d9856cd574a8 100644 --- a/sql/sql_connect.h +++ b/sql/sql_connect.h @@ -143,5 +143,6 @@ int get_or_create_user_conn(THD *thd, const char *user, int check_for_max_user_connections(THD *thd, const USER_CONN *uc); // Uses the THD to update the global stats by user name and client IP void update_global_user_stats(THD* thd, bool create_user, time_t now); +void update_global_user_stats(THD* thd, bool create_user, time_t now, const char* user_string, const char* client_string, const char* ip); #endif /* SQL_CONNECT_INCLUDED */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b585bfd4a063..99ef9176a488 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2776,6 +2776,7 @@ mysql_execute_command(THD *thd, bool first_level) */ if (deny_updates_if_read_only_option(thd, all_tables)) { + thd->diff_access_denied_errors++; err_readonly(thd); DBUG_RETURN(-1); } @@ -2869,6 +2870,7 @@ mysql_execute_command(THD *thd, bool first_level) if (thd->tx_read_only && (sql_command_flags[lex->sql_command] & CF_DISALLOW_IN_RO_TRANS)) { + thd->diff_access_denied_errors++; my_error(ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION, MYF(0)); goto error; } From 45e145f8771fa3f45ea41ad15138676197afbc41 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Mon, 28 Jan 2019 21:18:22 +0200 Subject: [PATCH 200/214] PS-5250: SELinux - update installation --- doc/source/installation/yum_repo.rst | 29 +++++++++++++--------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/doc/source/installation/yum_repo.rst b/doc/source/installation/yum_repo.rst index 9c70020fe3eb..de7de7bc463f 100644 --- a/doc/source/installation/yum_repo.rst +++ b/doc/source/installation/yum_repo.rst @@ -51,25 +51,22 @@ Installing |Percona Server| from Percona ``yum`` repository .. code-block:: bash - yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm + + $ yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm - You should see some output such as the following: + .. admonition:: Output example - .. code-block:: bash - - Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm - Preparing... ########################################### [100%] - 1:percona-release ########################################### [100%] - -.. note:: + .. code-block:: guess - *RHEL*/*Centos* 5 doesn't support installing the packages directly from the remote location so you'll need to download the package first and install it manually with :program:`rpm`: + Retrieving https://repo.percona.com/yum/percona-release-latest.noarch.rpm + Preparing... ########################################### [100%] + 1:percona-release ########################################### [100%] - .. code-block:: bash + To install |Percona Server| with SELinux policies, you also need the :program:`Percona-Server-selinux-*.noarch.rpm` package: - wget http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm - rpm -ivH percona-release-0.1-6.noarch.rpm + .. code-block:: bash + $ yum install http://repo.percona.com/centos/7/RPMS/x86_64/Percona-Server-selinux-56-5.6.42-rel84.2.el7.noarch.rpm 2. Testing the repository @@ -148,13 +145,13 @@ Installing |Percona Server| using downloaded rpm packages This will install only packages required to run the |Percona Server|. To install all the packages (for debugging, testing, etc.) you should run: - .. code-block:: bash +.. code-block:: bash - rpm -ivh *.rpm + $ rpm -ivh *.rpm .. note:: - When installing packages manually like this, you'll need to make sure to resolve all the dependencies and install missing packages yourself. + When installing packages manually like this, you'll need to make sure to resolve all the dependencies and install missing packages yourself. Running |Percona Server| ======================== From 1cd18a5bf8a7472bd01ce66f1c157b13e58abd74 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Mon, 28 Jan 2019 19:37:04 +0200 Subject: [PATCH 201/214] PS-5254: version_suffix, version_comment - add definition --- doc/source/glossary.rst | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/doc/source/glossary.rst b/doc/source/glossary.rst index de6da70f606c..197f0099cab6 100644 --- a/doc/source/glossary.rst +++ b/doc/source/glossary.rst @@ -59,7 +59,7 @@ The file name of the default MySQL configuration file. MyISAM - A :term:`MySQL` :term:`Storage Engine` that was the default until + A :term:`MySQL` :term:`storage engine` that was the default until MySQL 5.5. MySQL @@ -74,6 +74,34 @@ Percona Server Percona's branch of :term:`MySQL` with performance and management improvements. + .. variable:: version_suffix + :version 5.6.40-84.0: Implemented + :cli: Yes + :scope: Global + :dyn: Yes + :vartype: String + :default: + + This variable allows to change the suffix for the |Percona Server| + version string returned by the read-only :variable:`version` variable. + This allows to append the version number for the server with a custom + suffix to reflect some build or configuration specifics. + + .. code-block:: mysql + + SET GLOBAL version_suffix = '-new-suffix'; + + .. variable:: version_comment + :version 5.6.20-68.0: Implemented + :cli: No + :scope: Global + :dyn: Yes + :vartype: String + :default: The value of the CMake ``COMPILATION_COMMENT`` option + + This variable is converted from a global read-only to a global read-write + variable and thereby it can now be customized. + Storage Engine A :term:`Storage Engine` is a piece of software that implements the details of data storage and retrieval for a database system. This From 1b29b571851f6bdaa4f4902c4a1cc2df5bdf6e5b Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Mon, 28 Jan 2019 17:54:30 +0200 Subject: [PATCH 202/214] Release notes for 5.6.43-84.3 --- doc/source/conf.py | 4 +- .../Percona-Server-5.6.43-84.3.rst | 64 +++++++++++++++++++ .../release-notes/release-notes_index.rst | 1 + doc/source/upstream-bug-fixes.rst | 18 ++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 doc/source/release-notes/Percona-Server-5.6.43-84.3.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index fc0cb4720e9a..700f831d9ff1 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -55,7 +55,7 @@ version = '5.6' # The full version, including alpha/beta/rc tags. -release = '5.6.41-84.1' +release = '5.6.43-84.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -117,7 +117,7 @@ .. |Percona Toolkit| replace:: *Percona Toolkit* -.. |Percona Server| replace:: *Percona Server* +.. |Percona Server| replace:: *Percona Server for MySQL* .. |Percona| replace:: *Percona* diff --git a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst new file mode 100644 index 000000000000..1b2d91f49798 --- /dev/null +++ b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst @@ -0,0 +1,64 @@ +.. rn:: 5.6.43-84.3 + +================================================================================ +|Percona Server| |release| +================================================================================ + +Percona is glad to announce the release of |Percona Server| |release| on |date| +(Downloads are available `here +`_ +and from the :doc:`Percona Software Repositories `). + +This release merges changes of `MySQL 5.6.43 +`_, including +all the bug fixes in it. |Percona Server| |release| is now the current GA +release in the 5.6 series. All of Percona’s software is open-source and free. + +Bugs Fixed +================================================================================ + +- A sequence of LOCK TABLES FOR BACKUP and STOP SLAVE SQL_THREAD could cause + replication to be blocked and not possible to be restarted normally. Bug fixed + :psbug:`4758` (upstream :mysqlbug:`93649`). +- **http** was replaced with **https** in http://bugs.percona.com in server + crash messages. Bug fixed :psbug:`4855`. +- Wrong query results could be received in semi-join subqueries with + materialization-scan that allowed inner tables of different semijoin + nests to interleave. Bug fixed :psbug:`4907` (upstream bug + :mysqlbug:`92809`). +- The audit logs could be corrupted when the :option:`audit_log_rotations` + option was changed at runtime. Bug fixed :psbug:`4950`. +- There was a typo in ``mysqld_safe.sh``: **trottling** was replaced with + **throttling**. Bug fixed :psbug:`240`. Thanks to Michael Coburn for the + patch. + +Other bugs fixed: +:psbug:`2477`, +:psbug:`3535`, +:psbug:`3568`, +:psbug:`3672`, +:psbug:`3673`, +:psbug:`4791`, +:psbug:`4989`, +:psbug:`5100`, +:psbug:`5118`, +:psbug:`5163`, +:psbug:`5268`, +:psbug:`5270`, +:psbug:`5271`. + +This release also contains fixes for the following CVE issues: +CVE-2019-2534, +CVE-2019-2529, +CVE-2019-2482, +CVE-2019-2455, +CVE-2019-2503, +CVE-2018-0734. + +Find the release notes for |Percona Server| |release| in our `online +documentation +`_. +Report bugs in the `Jira bug tracker `_. + +.. |release| replace:: 5.6.43-84.3 +.. |date| replace:: January 29, 2019 diff --git a/doc/source/release-notes/release-notes_index.rst b/doc/source/release-notes/release-notes_index.rst index 42985a9a3e79..6833920f5207 100644 --- a/doc/source/release-notes/release-notes_index.rst +++ b/doc/source/release-notes/release-notes_index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 :glob: + Percona-Server-5.6.42-84.2 Percona-Server-5.6.41-84.1 Percona-Server-5.6.40-84.0 Percona-Server-5.6.39-83.1 diff --git a/doc/source/upstream-bug-fixes.rst b/doc/source/upstream-bug-fixes.rst index c273c6452292..738858bdd223 100644 --- a/doc/source/upstream-bug-fixes.rst +++ b/doc/source/upstream-bug-fixes.rst @@ -4,6 +4,24 @@ List of upstream |MySQL| bugs fixed in |Percona Server| 5.6 ============================================================= ++-------------------------------------------------------------------------------------------------------------+ +|:Upstream bug: :mysqlbug:`93649` - STOP SLAVE SQL_THREAD deadlocks if done while holding LOCK INSTANCE ... | +|:JIRA bug: :psbug:`4758` | +|:Upstream state: Open (checked on 2018-05-29) | +|:Fix Released: :rn:`5.6.43-84.3` | +|:Upstream fix: N/A | ++-------------------------------------------------------------------------------------------------------------+ +|:Upstream bug: :mysqlbug:`92809` - Inconsistent ResultSet for different Execution Plans | +|:JIRA bug: :psbug:`4907` | +|:Upstream state: Verified (checked on 2018-05-29) | +|:Fix Released: :rn:`5.6.43-84.3` | +|:Upstream fix: N/A | ++-------------------------------------------------------------------------------------------------------------+ +|:Upstream bug: :mysqlbug:`92227` - SQL injection on slave due to non-quoting in binlogged ROLLBACK TO ... | +|:JIRA bug: :psbug:`4791` | +|:Upstream state: N/A | +|:Fix Released: :rn:`5.6.43-84.3` | +|:Upstream fix: N/A | +-------------------------------------------------------------------------------------------------------------+ |:Upstream bug: :mysqlbug:`90351` - GLOBAL STATUS variables drift after rollback | |:JIRA bug: :psbug:`3951` | From 70d8d1b96fe6572ed4942113f924c152b1590086 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 29 Jan 2019 17:51:21 +0200 Subject: [PATCH 203/214] Release notes for 5.6.43-84.3: internal ticket - remove --- doc/source/release-notes/Percona-Server-5.6.43-84.3.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst index 1b2d91f49798..92eb98f3abf7 100644 --- a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst +++ b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst @@ -38,7 +38,6 @@ Other bugs fixed: :psbug:`3568`, :psbug:`3672`, :psbug:`3673`, -:psbug:`4791`, :psbug:`4989`, :psbug:`5100`, :psbug:`5118`, From 4e5cb6e9c8e5c481e30d5b25ef1405bbe3c37b01 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 29 Jan 2019 18:00:14 +0200 Subject: [PATCH 204/214] Release notes for 5.6.43-84.3: missing entry - add --- doc/source/release-notes/release-notes_index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/release-notes/release-notes_index.rst b/doc/source/release-notes/release-notes_index.rst index 6833920f5207..b309de86df08 100644 --- a/doc/source/release-notes/release-notes_index.rst +++ b/doc/source/release-notes/release-notes_index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 :glob: + Percona-Server-5.6.43-84.3 Percona-Server-5.6.42-84.2 Percona-Server-5.6.41-84.1 Percona-Server-5.6.40-84.0 From eb8cd8ea89b43befad786616747fa4128a2b34a6 Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 29 Jan 2019 19:37:02 +0200 Subject: [PATCH 205/214] Release notes for 5.6.43-84.3: Link to online documentation: fix --- doc/source/release-notes/Percona-Server-5.6.43-84.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst index 92eb98f3abf7..4a126dcbda98 100644 --- a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst +++ b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst @@ -56,7 +56,7 @@ CVE-2018-0734. Find the release notes for |Percona Server| |release| in our `online documentation -`_. +`_. Report bugs in the `Jira bug tracker `_. .. |release| replace:: 5.6.43-84.3 From 79a1211269ac6f528d04202aa125699db8e3683e Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Tue, 8 Jan 2019 08:13:18 +0100 Subject: [PATCH 206/214] PS-3839: Removing unneccessary scrubbing debug variable Also fixed the innodb_redo_log_encrypt_basic testcase, which needed another warning suppression. --- .../suite/perfschema/r/show_sanity.result | 2 - .../innodb_debug_force_scrubbing_basic.result | 54 ------------------- .../t/innodb_debug_force_scrubbing_basic.test | 42 --------------- .../t/innodb_redo_log_encrypt_basic.test | 5 +- storage/innobase/btr/btr0scrub.cc | 26 --------- storage/innobase/handler/ha_innodb.cc | 14 ----- 6 files changed, 3 insertions(+), 140 deletions(-) delete mode 100644 mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result delete mode 100644 mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test diff --git a/mysql-test/suite/perfschema/r/show_sanity.result b/mysql-test/suite/perfschema/r/show_sanity.result index cf043d997e46..77539ebeb76d 100644 --- a/mysql-test/suite/perfschema/r/show_sanity.result +++ b/mysql-test/suite/perfschema/r/show_sanity.result @@ -418,7 +418,6 @@ SHOW_MODE SOURCE VARIABLE_NAME 5.6 I_S.SESSION_VARIABLES INNODB_COMPRESSED_COLUMNS_THRESHOLD 5.6 I_S.SESSION_VARIABLES INNODB_COMPRESSED_COLUMNS_ZIP_LEVEL 5.6 I_S.SESSION_VARIABLES INNODB_DEADLOCK_DETECT -5.6 I_S.SESSION_VARIABLES INNODB_DEBUG_FORCE_SCRUBBING 5.6 I_S.SESSION_VARIABLES INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED 5.6 I_S.SESSION_VARIABLES INNODB_SCRUB_LOG 5.6 I_S.SESSION_VARIABLES INNODB_SCRUB_LOG_SPEED @@ -458,7 +457,6 @@ SHOW_MODE SOURCE VARIABLE_NAME 5.6 I_S.SESSION_VARIABLES INNODB_COMPRESSED_COLUMNS_THRESHOLD 5.6 I_S.SESSION_VARIABLES INNODB_COMPRESSED_COLUMNS_ZIP_LEVEL 5.6 I_S.SESSION_VARIABLES INNODB_DEADLOCK_DETECT -5.6 I_S.SESSION_VARIABLES INNODB_DEBUG_FORCE_SCRUBBING 5.6 I_S.SESSION_VARIABLES INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED 5.6 I_S.SESSION_VARIABLES INNODB_SCRUB_LOG 5.6 I_S.SESSION_VARIABLES INNODB_SCRUB_LOG_SPEED diff --git a/mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result b/mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result deleted file mode 100644 index 09da7d75e5ab..000000000000 --- a/mysql-test/suite/sys_vars/r/innodb_debug_force_scrubbing_basic.result +++ /dev/null @@ -1,54 +0,0 @@ -SET @start_global_value = @@global.innodb_debug_force_scrubbing; -# -# exists as global only -# -select @@global.innodb_debug_force_scrubbing; -@@global.innodb_debug_force_scrubbing -0 -select @@session.innodb_debug_force_scrubbing; -ERROR HY000: Variable 'innodb_debug_force_scrubbing' is a GLOBAL variable -show global variables like 'innodb_debug_force_scrubbing'; -Variable_name Value -innodb_debug_force_scrubbing OFF -show session variables like 'innodb_debug_force_scrubbing'; -Variable_name Value -innodb_debug_force_scrubbing OFF -select * from information_schema.global_variables -where variable_name='innodb_debug_force_scrubbing'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_DEBUG_FORCE_SCRUBBING OFF -Warnings: -Warning 1287 'INFORMATION_SCHEMA.GLOBAL_VARIABLES' is deprecated and will be removed in a future release. Please use performance_schema.global_variables instead -select * from information_schema.session_variables -where variable_name='innodb_debug_force_scrubbing'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_DEBUG_FORCE_SCRUBBING OFF -Warnings: -Warning 1287 'INFORMATION_SCHEMA.SESSION_VARIABLES' is deprecated and will be removed in a future release. Please use performance_schema.session_variables instead -# -# show that it's writable -# -set global innodb_debug_force_scrubbing=ON; -select @@global.innodb_debug_force_scrubbing; -@@global.innodb_debug_force_scrubbing -1 -set global innodb_debug_force_scrubbing=OFF; -select @@global.innodb_debug_force_scrubbing; -@@global.innodb_debug_force_scrubbing -0 -set global innodb_debug_force_scrubbing=1; -select @@global.innodb_debug_force_scrubbing; -@@global.innodb_debug_force_scrubbing -1 -set session innodb_debug_force_scrubbing=1; -ERROR HY000: Variable 'innodb_debug_force_scrubbing' is a GLOBAL variable and should be set with SET GLOBAL -# -# incorrect types -# -set global innodb_debug_force_scrubbing=1.1; -ERROR 42000: Incorrect argument type to variable 'innodb_debug_force_scrubbing' -set global innodb_debug_force_scrubbing=1e1; -ERROR 42000: Incorrect argument type to variable 'innodb_debug_force_scrubbing' -set global innodb_debug_force_scrubbing="foo"; -ERROR 42000: Variable 'innodb_debug_force_scrubbing' can't be set to the value of 'foo' -SET @@global.innodb_debug_force_scrubbing = @start_global_value; diff --git a/mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test b/mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test deleted file mode 100644 index cc00f0f6f3d5..000000000000 --- a/mysql-test/suite/sys_vars/t/innodb_debug_force_scrubbing_basic.test +++ /dev/null @@ -1,42 +0,0 @@ -# bool global ---source include/have_innodb.inc ---source include/have_debug.inc - -SET @start_global_value = @@global.innodb_debug_force_scrubbing; - ---echo # ---echo # exists as global only ---echo # -select @@global.innodb_debug_force_scrubbing; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.innodb_debug_force_scrubbing; -show global variables like 'innodb_debug_force_scrubbing'; -show session variables like 'innodb_debug_force_scrubbing'; -select * from information_schema.global_variables -where variable_name='innodb_debug_force_scrubbing'; -select * from information_schema.session_variables -where variable_name='innodb_debug_force_scrubbing'; - ---echo # ---echo # show that it's writable ---echo # -set global innodb_debug_force_scrubbing=ON; -select @@global.innodb_debug_force_scrubbing; -set global innodb_debug_force_scrubbing=OFF; -select @@global.innodb_debug_force_scrubbing; -set global innodb_debug_force_scrubbing=1; -select @@global.innodb_debug_force_scrubbing; ---error ER_GLOBAL_VARIABLE -set session innodb_debug_force_scrubbing=1; - ---echo # ---echo # incorrect types ---echo # ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_debug_force_scrubbing=1.1; ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_debug_force_scrubbing=1e1; ---error ER_WRONG_VALUE_FOR_VAR -set global innodb_debug_force_scrubbing="foo"; - -SET @@global.innodb_debug_force_scrubbing = @start_global_value; diff --git a/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test b/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test index 9093c7702775..2a8da4d34719 100644 --- a/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test @@ -1,6 +1,7 @@ --disable_query_log -call mtr.add_suppression("\\[Error\\] .*MY-\\d+.* Encryption can't find master key, please check the keyring plugin is loaded."); -call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.* Can't set redo log tablespace to be encrypted."); +call mtr.add_suppression("Encryption can't find master key, please check the keyring plugin is loaded."); +call mtr.add_suppression("Can't set redo log tablespace to be encrypted."); +call mtr.add_suppression("Redo log key generation failed."); --enable_query_log SET @start_global_value = @@global.innodb_redo_log_encrypt; diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc index dcbb448485b9..e02d739c2f3e 100644 --- a/storage/innobase/btr/btr0scrub.cc +++ b/storage/innobase/btr/btr0scrub.cc @@ -52,22 +52,6 @@ static btr_scrub_stat_t scrub_stat; static ib_mutex_t scrub_stat_mutex; mysql_pfs_key_t scrub_stat_mutex_key; -#ifdef UNIV_DEBUG -/** -* srv_scrub_force_testing -* -* - force scrubbing using background threads even for uncompressed tables -* - force pessimistic scrubbing (page split) even if not needed -* (see test_pessimistic_scrub_pct) -*/ -my_bool srv_scrub_force_testing = true; - -/** -* Force pessimistic scrubbing in 50% of the cases (UNIV_DEBUG only) -*/ -static int test_pessimistic_scrub_pct = 50; - -#endif static uint scrub_compression_level = page_zip_level; /**************************************************************//** @@ -360,16 +344,6 @@ btr_optimistic_scrub( dict_index_t* index, /*!< in: index */ mtr_t* mtr) /*!< in: mtr */ { -#ifdef UNIV_DEBUG - if (srv_scrub_force_testing && - page_get_n_recs(buf_block_get_frame(block)) > 2 && - (rand() % 100) < test_pessimistic_scrub_pct) { - - log_scrub_failure(index, scrub_data, block, DB_OVERFLOW); - return DB_OVERFLOW; - } -#endif - page_cur_t cur; page_cur_set_before_first(block, &cur); bool recovery = false; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 117b9e8df59f..b1b4a08f6a23 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -206,9 +206,6 @@ extern my_bool srv_background_scrub_data_uncompressed; extern my_bool srv_background_scrub_data_compressed; extern uint srv_background_scrub_data_interval; extern uint srv_background_scrub_data_check_interval; -#ifdef UNIV_DEBUG -extern my_bool srv_scrub_force_testing; -#endif extern mysql_pfs_key_t scrub_stat_mutex_key; @@ -22697,14 +22694,6 @@ static MYSQL_SYSVAR_UINT(background_scrub_data_interval, 1, UINT_MAX32, 0); -#ifdef UNIV_DEBUG -static MYSQL_SYSVAR_BOOL(debug_force_scrubbing, - srv_scrub_force_testing, - 0, - "Perform extra scrubbing to increase test exposure", - NULL, NULL, FALSE); -#endif /* UNIV_DEBUG */ - static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(api_trx_level), MYSQL_SYSVAR(api_bk_commit_interval), @@ -22922,9 +22911,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(background_scrub_data_compressed), MYSQL_SYSVAR(background_scrub_data_interval), MYSQL_SYSVAR(background_scrub_data_check_interval), -#ifdef UNIV_DEBUG - MYSQL_SYSVAR(debug_force_scrubbing), -#endif NULL }; From c2c524a4c75725495ca6b6d9e94408c410b09a4d Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Wed, 30 Jan 2019 10:16:55 +0200 Subject: [PATCH 207/214] Fix PS-5388 (Enable hardware CRC32 under Valgrind) Valgrind started supporting CRC32 instruction starting with version 3.6.1, released in 2011. Thus remove the fallback to software implementation in case running under Valgrind. --- storage/innobase/ut/ut0crc32.cc | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 1caf27ebae38..bd922993b870 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -287,26 +287,7 @@ ut_crc32_init() ut_cpuid(vend, &model, &family, &stepping, &features_ecx, &features_edx); - /* Valgrind does not understand the CRC32 instructions: - - vex amd64->IR: unhandled instruction bytes: 0xF2 0x48 0xF 0x38 0xF0 0xA - valgrind: Unrecognised instruction at address 0xad3db5. - Your program just tried to execute an instruction that Valgrind - did not recognise. There are two possible reasons for this. - 1. Your program has a bug and erroneously jumped to a non-code - location. If you are running Memcheck and you just saw a - warning about a bad jump, it's probably your program's fault. - 2. The instruction is legitimate but Valgrind doesn't handle it, - i.e. it's Valgrind's fault. If you think this is the case or - you are not sure, please let us know and we'll try to fix it. - Either way, Valgrind will now raise a SIGILL signal which will - probably kill your program. - - */ -#ifndef UNIV_DEBUG_VALGRIND ut_crc32_sse2_enabled = (features_ecx >> 20) & 1; -#endif /* UNIV_DEBUG_VALGRIND */ - #endif /* defined(__GNUC__) && defined(__x86_64__) */ if (ut_crc32_sse2_enabled) { From 0426bd3ecde19eb962508c13af44b0bc00ae20bd Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Tue, 29 Jan 2019 17:51:21 +0200 Subject: [PATCH 208/214] Release notes: other fixed bugs: add item --- doc/source/release-notes/Percona-Server-5.6.43-84.3.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst index 4a126dcbda98..50a24cdc23ee 100644 --- a/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst +++ b/doc/source/release-notes/Percona-Server-5.6.43-84.3.rst @@ -38,6 +38,7 @@ Other bugs fixed: :psbug:`3568`, :psbug:`3672`, :psbug:`3673`, +:psbug:`4791`, :psbug:`4989`, :psbug:`5100`, :psbug:`5118`, From 4f8ebbdab406d2f92543e0734e9e497c9dc4863e Mon Sep 17 00:00:00 2001 From: Borys Belinsky Date: Thu, 31 Jan 2019 12:06:53 +0200 Subject: [PATCH 209/214] PS-4668: information schema tables - add section --- doc/source/myrocks/index.rst | 2 +- .../myrocks/information-schema-tables.rst | 323 ++++++++++++++++++ 2 files changed, 324 insertions(+), 1 deletion(-) create mode 100644 doc/source/myrocks/information-schema-tables.rst diff --git a/doc/source/myrocks/index.rst b/doc/source/myrocks/index.rst index 05c4bf7f4543..692b6b5ff55c 100644 --- a/doc/source/myrocks/index.rst +++ b/doc/source/myrocks/index.rst @@ -29,4 +29,4 @@ if your workload uses fast storage, such as SSD: limitations differences variables - + information-schema-tables diff --git a/doc/source/myrocks/information-schema-tables.rst b/doc/source/myrocks/information-schema-tables.rst new file mode 100644 index 000000000000..b0af01fcc4f2 --- /dev/null +++ b/doc/source/myrocks/information-schema-tables.rst @@ -0,0 +1,323 @@ +.. _ps.myrocks.information-schema-table: + +================================================================================ +|myrocks| |information-schema| Tables +================================================================================ + +When you install the |myrocks| plugin for |MySQL|, the +|information-schema| is extended to include the following tables: + +.. contents:: + :local: + :depth: 1 + +.. _ps.myrocks.information-schema-table.rocksdb-global-info: + +ROCKSDB_GLOBAL_INFO +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - TYPE + - varchar(513) + * - NAME + - varchar(513) + * - VALUE + - varchar(513) + +.. _ps.myrocks.information-schema-table.rocksdb-cfstats: + +ROCKSDB_CFSTATS +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - CF_NAME + - varchar(193) + * - STAT_TYPE + - varchar(193) + * - VALUE + - bigint(8) + +.. _ps.myrocks.information-schema-table.rocksdb-trx: + +ROCKSDB_TRX +================================================================================ + +This table stores mappings of |rocksdb| transaction identifiers to |MySQL| +client identifiers to enable associating a |rocksdb| transaction with a |MySQL| +client operation. + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - TRANSACTION_ID + - bigint(8) + * - STATE + - varchar(193) + * - NAME + - varchar(193) + * - WRITE_COUNT + - bigint(8) + * - LOCK_COUNT + - bigint(8) + * - TIMEOUT_SEC + - int(4) + * - WAITING_KEY + - varchar(513) + * - WAITING_COLUMN_FAMILY_ID + - int(4) + * - IS_REPLICATION + - int(4) + * - SKIP_TRX_API + - int(4) + * - READ_ONLY + - int(4) + * - HAS_DEADLOCK_DETECTION + - int(4) + * - NUM_ONGOING_BULKLOAD + - int(4) + * - THREAD_ID + - int(8) + * - QUERY + - varchar(193) + +.. _ps.myrocks.information-schema-table.rocksdb-cf-options: + +ROCKSDB_CF_OPTIONS +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - CF_NAME + - varchar(193) + * - OPTION_TYPE + - varchar(193) + * - VALUE + - varchar(193) + +.. _ps.myrocks.information-schema-table.rocksdb-compaction-stats: + +ROCKSDB_COMPACTION_STATS +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - CF_NAME + - varchar(193) + * - LEVEL + - varchar(513) + * - TYPE + - varchar(513) + * - VALUE + - double + + +.. _ps.myrocks.information-schema-table.rocksdb-dbstats: + +ROCKSDB_DBSTATS +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - STAT_TYPE + - varchar(193) + * - VALUE + - bigint(8) + +.. _ps.myrocks.information-schema-table.rocksdb-ddl: + +ROCKSDB_DDL +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - TABLE_SCHEMA + - varchar(193) + * - TABLE_NAME + - varchar(193) + * - PARTITION_NAME + - varchar(193) + * - INDEX_NAME + - varchar(193) + * - COLUMN_FAMILY + - int(4) + * - INDEX_NUMBER + - int(4) + * - INDEX_TYPE + - smallint(2) + * - KV_FORMAT_VERSION + - smallint(2) + * - TTL_DURATION + - bigint(8) + * - INDEX_FLAGS + - bigint(8) + * - CF + - varchar(193) + * - AUTO_INCREMENT + - bigint(8) unsigned + +.. _ps.myrocks.information-schema-table.rocksdb-index-file-map: + +ROCKSDB_INDEX_FILE_MAP +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - COLUMN_FAMILY + - int(4) + * - INDEX_NUMBER + - int(4) + * - SST_NAME + - varchar(193) + * - NUM_ROWS + - bigint(8) + * - DATA_SIZE + - bigint(8) + * - ENTRY_DELETES + - bigint(8) + * - ENTRY_SINGLEDELETES + - bigint(8) + * - ENTRY_MERGES + - bigint(8) + * - ENTRY_OTHERS + - bigint(8) + * - DISTINCT_KEYS_PREFIX + - varchar(400) + +.. _ps.myrocks.information-schema-table.rocksdb-locks: + +ROCKSDB_LOCKS +================================================================================ + +This table contains the set of locks granted to |myrocks| transactions. + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - COLUMN_FAMILY_ID + - int(4) + * - TRANSACTION_ID + - int(4) + * - KEY + - varchar(513) + * - MODE + - varchar(32) + +.. _ps.myrocks.information-schema-table.rocksdb-perf-context: + +ROCKSDB_PERF_CONTEXT +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - TABLE_SCHEMA + - varchar(193) + * - TABLE_NAME + - varchar(193) + * - PARTITION_NAME + - varchar(193) + * - STAT_TYPE + - varchar(193) + * - VALUE + - bigint(8) + +.. _ps.myrocks.information-schema-table.rocksdb-perf-context-global: + +ROCKSDB_PERF_CONTEXT_GLOBAL +================================================================================ + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - STAT_TYPE + - varchar(193) + * - VALUE + - bigint(8) + +.. _ps.myrocks.information-schema-table.rocksdb-deadlock: + +ROCKSDB_DEADLOCK +================================================================================ + +This table records information about deadlocks. + +.. rubric:: Columns + +.. list-table:: + :header-rows: 1 + + * - Column Name + - Type + * - DEADLOCK_ID + - bigint(8) + * - TRANSACTION_ID + - bigint(8) + * - CF_NAME + - varchar(193) + * - WAITING_KEY + - varchar(513) + * - LOCK_TYPE + - varchar(193) + * - INDEX_NAME + - varchar(193) + * - TABLE_NAME + - varchar(193) + * - ROLLED_BACK + - bigint(8) + +.. |myrocks| replace:: MyRocks +.. |rocksdb| replace:: RocksDB +.. |information-schema| replace:: Information Schema From e10a45b3014b959ee1d9da396db953b32270630e Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Thu, 31 Jan 2019 15:29:02 +0200 Subject: [PATCH 210/214] Implemented PS-4833 (Merge MySQL 5.7.25) (conflicts resolved) https://jira.percona.com/browse/PS-4833 *** Our fix for PS-3925 "MSAN: do not compare uninitailized memory in log_in_use" (https://jira.percona.com/browse/PS-3925) (commit 96f907b) left intact as it is identical to the upstream fix for Bug #28178776 / #90238 "Comparison of uninitailized memory in log_in_use" (https://bugs.mysql.com/bug.php?id=90238) (commit mysql/mysql-server@d3b0f81). *** Reverted our source code fixes for PS-964 "LP #1539504: CREATE TEMPORARY TABLE creates a transaction in binary log on read only server" (https://jira.percona.com/browse/PS-964) (commit 9d652c2) and for PS-1071 "LP #1671013: CREATE TEMPORARY TABLE ... SELECT ... gets a DROP binlogged on disconnect in mixed" (https://jira.percona.com/browse/PS-1071) (commit ae47091) in favor of the upstream fix for the Bug #28606948 / #83003 (https://bugs.mysql.com/bug.php?id=83003) (commit mysql/mysql-server@9827f13). Our MTR test cases improvements left intact: - 'mysql-test/extra/binlog_tests/drop_temp_table.test'; - 'mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test'. 'rpl.rpl_row_gtid_disconnect_drop_temporary_table' MTR test case renamed to 'rpl.rpl_row_mix_gtid_disconnect_drop_temporary_table' ('--source' directive changed to 'include/have_binlog_format_mixed_or_row.inc'). 'rpl.rpl_stm_mix_gtid_disconnect_drop_temporary_table' MTR test case renamed to 'rpl.rpl_stm_gtid_disconnect_drop_temporary_table' ('--source' directive changed to 'include/have_binlog_format_statement.inc'). *** Re-recorded 'main.mysql_config_editor' MTR test case because of the changed copyright notice (2018->2019). *** Re-recorded 'binlog_encryption.binlog_index' MTR test case because of the extensions added to 'binlog.binlog_index' MTR test case made in the fix for the upstream Bug #25839610 "ABORT OCCUR DURING SLAVE BACKUP WHEN RELAY LOG INDEX IS LOCK" (commit mysql/mysql-server@e76d513). *** Re-recorded 'tokudb.type_temporal_fractional' MTR test case because of the fix for the upstream Bug #28022129 "NOW() DOESN'T HONOR NO_ZERO_DATE SQL_MODE" (commit mysql/mysql-server@fd0abb1) (commit mysql/mysql-server@ade9927). *** The following MTR test cases re-recorded because of the combination of different optimizer improvements both Oracle and Percona made: - 'main.opt_hints'; - 'main.range_all'; - 'main.range_icp'; - 'main.range_icp_mrr'; - 'main.range_mrr'; - 'main.range_mrr_cost'; - 'main.range_none'; - 'main.subquery_bugs'; - 'innodb.innodb_mysql'. See PS-4949 "Bad select+order by+limit performance in 5.7" (https://jira.percona.com/browse/PS-4949) (commit 37fb60e) and Oracle Bug #28086754 "OPTIMIZER SKIP THE RANGE SCAN ON SECOND COLUMN IN A COMPOSITE INDEX" (commit mysql/mysql-server@4736e3b). *** VERSION raised to "5.7.25-28". univ.i version raised to "28". *** This merge also fixes PS-4791 "SQL injection on slave due to non-quoting in binlogged ROLLBACK TO SAVEPOINT" (https://jira.percona.com/browse/PS-4791) as corresponding upstream Bug #28569645 "SQL INJECTION ON SLAVE DUE TO NON-QUOTING IN BINLOGGED ROLLBACK TO SAVEPOINT" was fixed in 5.7.25 (commit mysql/mysql-server@3dadc95). Replication: A patch to correct the handling of quotes for identifiers in ROLLBACK TO SAVEPOINT statements in the binary log was not correctly applied to subsequent MySQL versions. *** This merge also fixes PS-4878 "Deadlock by concurrent show binlogs, pfs session_variables table & binlog purge" (https://jira.percona.com/browse/PS-4878) and PS-4716 "MySQL connection exhaustion due to too many in CLOSE_WAIT state" (https://jira.percona.com/browse/PS-4716) as corresponding upstream Bugs #28511326 / #91941, #92108, #92858 "Deadlock during purge_logs_before_date" (https://bugs.mysql.com/bug.php?id=91941) (https://bugs.mysql.com/bug.php?id=92108) (https://bugs.mysql.com/bug.php?id=92858) was fixed in 5.7.25 (commit mysql/mysql-server@38a6d1d) (commit mysql/mysql-server@aedab91). Replication: When the system variables binlog_transaction_dependency_tracking and binlog_transaction_dependency_history_size were set or read, the types of lock that were required could result in a deadlock scenario, because the same locks were also required for working with the active binary logs. A new lock type is now used instead for access to the transaction dependency tracking system variables, so that this deadlock cannot occur. *** This merge also fixes PS-4763 "ASan: Direct leak of 272 byte(s) in main.mysqlpump_partial_bkp MTR test case" (https://jira.percona.com/browse/PS-4763) as corresponding upstream Bugs #28538971 / #92131 "ASan: Direct leak of 272 byte(s) in main.mysqlpump_partial_bkp MTR test case" (https://bugs.mysql.com/bug.php?id=92131) was fixed in 5.7.25 (commit mysql/mysql-server@da632a9). mysqlpump did not free all allocated resources when it encountered an error, resulting in memory leaks. --- README | 6 - VERSION | 10 +- .../extra/binlog_tests/drop_temp_table.test | 105 ---- .../gtid_disconnect_drop_temporary_table.test | 24 - mysql-test/r/mysql_config_editor.result | 8 +- mysql-test/r/opt_hints.result | 30 - mysql-test/r/range_all.result | 4 +- mysql-test/r/range_icp.result | 10 +- mysql-test/r/range_icp_mrr.result | 4 +- mysql-test/r/range_mrr.result | 4 +- mysql-test/r/range_mrr_cost.result | 10 +- mysql-test/r/range_none.result | 10 +- mysql-test/r/subquery_bugs.result | 4 +- .../binlog_encryption/r/binlog_index.result | 11 + mysql-test/suite/innodb/r/innodb_mysql.result | 2 +- .../suite/opt_trace/r/range_no_prot.result | 534 ------------------ .../perfschema/r/dml_setup_instruments.result | 10 +- .../perfschema/t/dml_setup_instruments.test | 10 +- ...id_disconnect_drop_temporary_table.result} | 0 ...id_disconnect_drop_temporary_table.result} | 0 ...gtid_disconnect_drop_temporary_table.test} | 4 +- ...gtid_disconnect_drop_temporary_table.test} | 4 +- .../t/innodb_redo_log_encrypt_basic.test | 5 +- .../type_temporal_fractional.result | 30 +- .../tokudb/r/type_temporal_fractional.result | 30 +- .../connection_handler_per_thread.cc | 2 +- sql/mysqld.cc | 6 - sql/mysqld.h | 8 +- sql/rpl_slave.cc | 10 +- sql/sql_base.cc | 50 -- sql/sys_vars.cc | 6 +- sql/table.h | 14 - storage/innobase/handler/ha_innodb.cc | 90 ++- storage/innobase/include/row0upd.h | 12 +- storage/innobase/include/univ.i | 2 +- storage/innobase/row/row0ins.cc | 8 +- storage/innobase/row/row0log.cc | 8 +- storage/innobase/row/row0upd.cc | 18 +- 38 files changed, 115 insertions(+), 988 deletions(-) rename mysql-test/suite/rpl/r/{rpl_row_gtid_disconnect_drop_temporary_table.result => rpl_row_mix_gtid_disconnect_drop_temporary_table.result} (100%) rename mysql-test/suite/rpl/r/{rpl_stm_mix_gtid_disconnect_drop_temporary_table.result => rpl_stm_gtid_disconnect_drop_temporary_table.result} (100%) rename mysql-test/suite/rpl/t/{rpl_stm_mix_gtid_disconnect_drop_temporary_table.test => rpl_row_mix_gtid_disconnect_drop_temporary_table.test} (64%) rename mysql-test/suite/rpl/t/{rpl_row_gtid_disconnect_drop_temporary_table.test => rpl_stm_gtid_disconnect_drop_temporary_table.test} (66%) diff --git a/README b/README index f1f1797ced52..1b4589dbb799 100644 --- a/README +++ b/README @@ -4,13 +4,7 @@ Percona Server 5.7 Percona Server is a branch of MySQL 5.7 bringing higher performance, reliability and more features. -<<<<<<< HEAD http://www.percona.com/software/percona-server/ -||||||| merged common ancestors -Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. -======= -Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. ->>>>>>> mysql-5.7.25 Documentation: http://www.percona.com/doc/percona-server/5.7 diff --git a/VERSION b/VERSION index 2efd6166aa46..06a605a2b293 100644 --- a/VERSION +++ b/VERSION @@ -1,12 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=7 -<<<<<<< HEAD -MYSQL_VERSION_PATCH=24 -MYSQL_VERSION_EXTRA=-27 -||||||| merged common ancestors -MYSQL_VERSION_PATCH=24 -MYSQL_VERSION_EXTRA= -======= MYSQL_VERSION_PATCH=25 -MYSQL_VERSION_EXTRA= ->>>>>>> mysql-5.7.25 +MYSQL_VERSION_EXTRA=-28 diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 15c89f54daae..2d624c7f32ff 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -67,22 +67,11 @@ connection con2; SELECT GET_LOCK("a",10); let $VERSION=`SELECT VERSION()`; -<<<<<<< HEAD if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) { let $wait_binlog_event=DROP /*!40005 TEMPORARY */ TABLE IF EXISTS; source include/wait_for_binlog_event.inc; } -||||||| merged common ancestors -let $wait_binlog_event=DROP /*!40005 TEMPORARY */ TABLE IF EXISTS; -source include/wait_for_binlog_event.inc; -======= -if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) -{ - let $wait_binlog_event=DROP /*!40005 TEMPORARY */ TABLE IF EXISTS; - source include/wait_for_binlog_event.inc; -} ->>>>>>> mysql-5.7.25 source include/show_binlog_events.inc; DROP DATABASE `drop-temp+table-test`; @@ -121,74 +110,16 @@ if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) RESET MASTER; } -<<<<<<< HEAD # End of 4.1 tests -||||||| merged common ancestors -CREATE TABLE t1 ( i text ); -======= -if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) -{ - CREATE TABLE t1 ( i text ); - --connect(con1,localhost,root,,) - CREATE TEMPORARY TABLE ttmp1 ( i text ); - SET @@session.binlog_format=ROW; - INSERT INTO t1 VALUES ('1'); - SELECT @@session.binlog_format; - --disconnect con1 - - -- connection default - --let $wait_binlog_event= DROP - --source include/wait_for_binlog_event.inc - --let $mask_binlog_commit_events= 1 - -- source include/show_binlog_events.inc - --let $mask_binlog_commit_events= 0 - DROP TABLE t1; - RESET MASTER; -} ->>>>>>> mysql-5.7.25 - -<<<<<<< HEAD --echo # --echo # Bug 83003: Using temporary tables on slaves increases GTID sequence number --echo # -||||||| merged common ancestors ---connect(con1,localhost,root,,) -CREATE TEMPORARY TABLE ttmp1 ( i text ); -SET @@session.binlog_format=ROW; -INSERT INTO t1 VALUES ('1'); -SELECT @@session.binlog_format; ---disconnect con1 -======= -# End of 4.1 tests ->>>>>>> mysql-5.7.25 -<<<<<<< HEAD --source include/count_sessions.inc -||||||| merged common ancestors --- connection default ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc ---let $mask_binlog_commit_events= 1 --- source include/show_binlog_events.inc ---let $mask_binlog_commit_events= 0 -RESET MASTER; -======= ---echo # ---echo # Bug 83003: Using temporary tables on slaves increases GTID sequence number ---echo # ->>>>>>> mysql-5.7.25 -<<<<<<< HEAD --connect (con1,localhost,root,,) -||||||| merged common ancestors -DROP TABLE t1; -======= ---source include/count_sessions.inc ---connect (con1,localhost,root,,) ->>>>>>> mysql-5.7.25 -<<<<<<< HEAD SET @saved_binlog_format= @@SESSION.binlog_format; SET SESSION binlog_format= STATEMENT; CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB; @@ -211,32 +142,7 @@ SET SESSION sql_log_bin= 1; --source include/show_binlog_events.inc # End of 5.6 tests -||||||| merged common ancestors -# End of 4.1 tests -======= -SET @saved_binlog_format= @@SESSION.binlog_format; -SET SESSION binlog_format= STATEMENT; -CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB; -SET SESSION binlog_format= @saved_binlog_format; - -# Check with both transactional and non-transactional tables as those are logged -# separately in close_temporary_tables. -CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB; -CREATE TEMPORARY TABLE temp_non_trx(a INT) ENGINE=MyISAM; ->>>>>>> mysql-5.7.25 - -CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB; -SET SESSION sql_log_bin= 0; -CREATE TEMPORARY TABLE temp_binlog_disabled(a INT) ENGINE=InnoDB; -SET SESSION sql_log_bin= 1; - ---disconnect con1 ---connection default ---source include/wait_until_count_sessions.inc ---source include/show_binlog_events.inc - -# End of 5.6 tests --echo # --echo # BUG#21638823: ASSERTION FAILED: --echo # THD->GET_TRANSACTION()->IS_EMPTY(TRANSACTION_CTX::STMT) || THD @@ -263,22 +169,11 @@ XA END 'idle_at_disconnect'; --disconnect con3 --source include/wait_until_disconnected.inc --connection default -<<<<<<< HEAD if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) { --let $wait_binlog_event= DROP --source include/wait_for_binlog_event.inc } -||||||| merged common ancestors ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc -======= -if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) -{ - --let $wait_binlog_event= DROP - --source include/wait_for_binlog_event.inc -} ->>>>>>> mysql-5.7.25 --echo # Dump binlog to show that, either the generated DROP comes after tx --echo # commit (stmt), or there is no trace of the XA txn and --echo # the temp table (row or mixed) diff --git a/mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test b/mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test index b316e6b279a9..ab61675732ff 100644 --- a/mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test +++ b/mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test @@ -92,7 +92,6 @@ while ($i <= 4) --echo # Disconnecting. --disconnect con1 -<<<<<<< HEAD:mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) { # Verify that the binlog contains the expected events. @@ -100,20 +99,6 @@ while ($i <= 4) --let $wait_for_binlog_events= 1 --source include/assert_binlog_events.inc } -||||||| merged common ancestors:mysql-test/suite/rpl/t/rpl_gtid_disconnect_drop_temporary_table.test - # Verify that the binlog contains the expected events. - --let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) - --let $wait_for_binlog_events= 1 - --source include/assert_binlog_events.inc -======= - if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) - { - # Verify that the binlog contains the expected events. - --let $event_sequence= (Anonymous_)?Gtid # !Q(DROP.*TEMPORARY.*) - --let $wait_for_binlog_events= 1 - --source include/assert_binlog_events.inc - } ->>>>>>> mysql-5.7.25:mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test # Sync with slave and assert slave has dropped the temp table. --source include/sync_slave_sql_with_master.inc @@ -124,20 +109,11 @@ while ($i <= 4) # Verify that one gtid was added if gtid_mode=on --connection master --let $gtid_step_gtid_mode_agnostic= 1 -<<<<<<< HEAD:mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test --let $gtid_step_count= 0 if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) { --let $gtid_step_count= 1 } -||||||| merged common ancestors:mysql-test/suite/rpl/t/rpl_gtid_disconnect_drop_temporary_table.test -======= - --let $gtid_step_count= 0 - if (`SELECT @@GLOBAL.binlog_format != 'ROW'`) - { - --let $gtid_step_count= 1 - } ->>>>>>> mysql-5.7.25:mysql-test/extra/rpl_tests/gtid_disconnect_drop_temporary_table.test --source include/gtid_step_assert.inc --inc $i diff --git a/mysql-test/r/mysql_config_editor.result b/mysql-test/r/mysql_config_editor.result index 0aae10d6050e..a15cbdba6fe2 100644 --- a/mysql-test/r/mysql_config_editor.result +++ b/mysql-test/r/mysql_config_editor.result @@ -100,14 +100,8 @@ user = test_user4 ############################################## # Tests for mysql_config_editor's help command ############################################## -<<<<<<< HEAD -Copyright (c) 2009-2018 Percona LLC and/or its affiliates -Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. -||||||| merged common ancestors -Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. -======= +Copyright (c) 2009-2019 Percona LLC and/or its affiliates Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. ->>>>>>> mysql-5.7.25 Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective diff --git a/mysql-test/r/opt_hints.result b/mysql-test/r/opt_hints.result index eac4aa727f73..9b6b95038247 100644 --- a/mysql-test/r/opt_hints.result +++ b/mysql-test/r/opt_hints.result @@ -102,39 +102,21 @@ EXPLAIN SELECT f2 FROM (SELECT f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where -||||||| merged common ancestors -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using index condition -======= -1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using index condition ->>>>>>> mysql-5.7.25 Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) EXPLAIN SELECT /*+ NO_ICP(t3@qb1 f3_idx) */ f2 FROM (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where -||||||| merged common ancestors -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where -======= -1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using where ->>>>>>> mysql-5.7.25 Warnings: Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1` `f3_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) EXPLAIN SELECT /*+ NO_ICP(t3@qb1) */ f2 FROM (SELECT /*+ QB_NAME(QB1) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where -||||||| merged common ancestors -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where -======= -1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using where ->>>>>>> mysql-5.7.25 Warnings: Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`QB1`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) # Expected warning for f1_idx key, unresolved name. @@ -142,13 +124,7 @@ EXPLAIN SELECT f2 FROM (SELECT /*+ NO_ICP(t3 f3_idx, f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where -||||||| merged common ancestors -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using where -======= -1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using where ->>>>>>> mysql-5.7.25 Warnings: Warning 3128 Unresolved name `t3`@`select#2` `f1_idx` for NO_ICP hint Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f3_idx`) NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) @@ -157,13 +133,7 @@ EXPLAIN SELECT f2 FROM (SELECT /*+ NO_ICP(t3 f1_idx, f2_idx) */ f2, f3, f1 FROM t3 WHERE f1 > 27 AND f3 = 'poiu') AS TD WHERE TD.f1 > 27 AND TD.f3 = 'poiu'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx PRIMARY 4 NULL 35 20.00 Using where -||||||| merged common ancestors -1 SIMPLE t3 NULL ref PRIMARY,f2_idx,f3_idx f3_idx 35 const 16 96.43 Using index condition -======= -1 SIMPLE t3 NULL range PRIMARY,f2_idx,f3_idx f3_idx 39 NULL 16 100.00 Using index condition ->>>>>>> mysql-5.7.25 Warnings: Warning 3128 Unresolved name `t3`@`select#2` `f1_idx` for NO_ICP hint Note 1003 /* select#1 */ select /*+ NO_ICP(`t3`@`select#2` `f2_idx`) */ `test`.`t3`.`f2` AS `f2` from `test`.`t3` where ((`test`.`t3`.`f3` = 'poiu') and (`test`.`t3`.`f1` > 27) and (`test`.`t3`.`f1` > 27)) diff --git a/mysql-test/r/range_all.result b/mysql-test/r/range_all.result index 4919353476f1..8469177fecdf 100644 --- a/mysql-test/r/range_all.result +++ b/mysql-test/r/range_all.result @@ -3707,7 +3707,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 SELECT * @@ -3723,7 +3723,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c DESC LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 SELECT * diff --git a/mysql-test/r/range_icp.result b/mysql-test/r/range_icp.result index 4e4ba5416708..90f2a025c35d 100644 --- a/mysql-test/r/range_icp.result +++ b/mysql-test/r/range_icp.result @@ -1360,13 +1360,7 @@ Access method can be range/ALL with #rows >= 500. Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t2 NULL ALL a NULL NULL NULL 1000 50.20 Using where -||||||| merged common ancestors -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using index condition -======= -1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using index condition ->>>>>>> mysql-5.7.25 Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3713,7 +3707,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 SELECT * @@ -3729,7 +3723,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c DESC LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 SELECT * diff --git a/mysql-test/r/range_icp_mrr.result b/mysql-test/r/range_icp_mrr.result index b092cfd74b1f..70492679a19f 100644 --- a/mysql-test/r/range_icp_mrr.result +++ b/mysql-test/r/range_icp_mrr.result @@ -3707,7 +3707,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 SELECT * @@ -3723,7 +3723,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c DESC LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using index condition +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 SELECT * diff --git a/mysql-test/r/range_mrr.result b/mysql-test/r/range_mrr.result index 26f0dac5216f..9c63a84cb6ca 100644 --- a/mysql-test/r/range_mrr.result +++ b/mysql-test/r/range_mrr.result @@ -3707,7 +3707,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 SELECT * @@ -3723,7 +3723,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c DESC LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 SELECT * diff --git a/mysql-test/r/range_mrr_cost.result b/mysql-test/r/range_mrr_cost.result index df15c6ee82ca..1cd1c027666a 100644 --- a/mysql-test/r/range_mrr_cost.result +++ b/mysql-test/r/range_mrr_cost.result @@ -1360,13 +1360,7 @@ Access method can be range/ALL with #rows >= 500. Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t2 NULL ALL a NULL NULL NULL 1000 50.20 Using where -||||||| merged common ancestors -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using where -======= -1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using where ->>>>>>> mysql-5.7.25 Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3713,7 +3707,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 SELECT * @@ -3729,7 +3723,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c DESC LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 SELECT * diff --git a/mysql-test/r/range_none.result b/mysql-test/r/range_none.result index e0a008d95d64..589cc5cef341 100644 --- a/mysql-test/r/range_none.result +++ b/mysql-test/r/range_none.result @@ -1359,13 +1359,7 @@ Access method can be range/ALL with #rows >= 500. Or it can be ref with #rows = 2, only when there is memory limit. explain select * from t2 where a=1000 and b<11; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -<<<<<<< HEAD 1 SIMPLE t2 NULL ALL a NULL NULL NULL 1000 50.20 Using where -||||||| merged common ancestors -1 SIMPLE t2 NULL ref a a 5 const 502 33.33 Using where -======= -1 SIMPLE t2 NULL range a a 10 NULL 502 100.00 Using where ->>>>>>> mysql-5.7.25 Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`filler` AS `filler` from `test`.`t2` where ((`test`.`t2`.`a` = 1000) and (`test`.`t2`.`b` < 11)) drop table t1, t2; @@ -3712,7 +3706,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` limit 1 SELECT * @@ -3728,7 +3722,7 @@ WHERE id=3 AND c LIKE 'gh%' ORDER BY c DESC LIMIT 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE test_ref NULL range idx1,idx2 idx1 28 NULL 27 100.00 Using where +1 SIMPLE test_ref NULL ref idx1,idx2 idx1 5 const 48 11.11 Using where Warnings: Note 1003 /* select#1 */ select `test`.`test_ref`.`a` AS `a`,`test`.`test_ref`.`b` AS `b`,`test`.`test_ref`.`c` AS `c`,`test`.`test_ref`.`d` AS `d`,`test`.`test_ref`.`id` AS `id` from `test`.`test_ref` where ((`test`.`test_ref`.`id` = 3) and (`test`.`test_ref`.`c` like 'gh%')) order by `test`.`test_ref`.`c` desc limit 1 SELECT * diff --git a/mysql-test/r/subquery_bugs.result b/mysql-test/r/subquery_bugs.result index 3c52d459de88..b6d9aba09bf9 100644 --- a/mysql-test/r/subquery_bugs.result +++ b/mysql-test/r/subquery_bugs.result @@ -34,14 +34,14 @@ EXPLAIN SELECT p.Id FROM (p) WHERE p.Id IN ( SELECT s1.Id FROM s1 WHERE Id=1 AND u IS NOT NULL) ORDER BY Id DESC; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE p NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index -1 SIMPLE s1 NULL ref o o 5 const 2 50.00 Using where; Using index; FirstMatch(p) +1 SIMPLE s1 NULL index o o 10 NULL 2 100.00 Using where; Using index; FirstMatch(p) Warnings: Note 1003 /* select#1 */ select '1' AS `Id` from `test`.`p` semi join (`test`.`s1`) where ((`test`.`s1`.`Id` = 1) and (`test`.`s1`.`u` is not null)) order by '1' desc EXPLAIN SELECT p.Id FROM (p) WHERE p.Id IN ( SELECT s1.Id FROM s1 WHERE Id=1 AND u != 1) ORDER BY Id DESC; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE p NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index -1 SIMPLE s1 NULL ref o o 5 const 3 50.00 Using where; Using index; FirstMatch(p) +1 SIMPLE s1 NULL index o o 10 NULL 2 100.00 Using where; Using index; FirstMatch(p) Warnings: Note 1003 /* select#1 */ select '1' AS `Id` from `test`.`p` semi join (`test`.`s1`) where ((`test`.`s1`.`Id` = 1) and (`test`.`s1`.`u` <> 1)) order by '1' desc SELECT p.Id FROM (p) WHERE p.Id IN ( diff --git a/mysql-test/suite/binlog_encryption/r/binlog_index.result b/mysql-test/suite/binlog_encryption/r/binlog_index.result index cc705e389762..4804916e5f0d 100644 --- a/mysql-test/suite/binlog_encryption/r/binlog_index.result +++ b/mysql-test/suite/binlog_encryption/r/binlog_index.result @@ -389,8 +389,19 @@ master-bin.000020 # master-bin.000021 # master-bin.000022 # DROP TABLE t1; +SET SESSION debug=""; # Test case11: Ends +# Test case12: Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP +# WHEN RELAY LOG INDEX IS LOCK +# This test verifies that serveral retries are performed +# if there is a failure while deleting/renaming index files. +SET SESSION debug="+d,simulate_index_file_delete_failure"; +SET SESSION debug="+d,simulate_crash_safe_index_file_rename_failure"; +FLUSH LOGS; +include/assert_grep.inc [Retried for delete.] +include/assert_grep.inc [Retried for rename.] SET SESSION debug=""; +# Test case12: Ends SET GLOBAL binlog_error_action= ABORT_SERVER; RESET MASTER; End of tests diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 7596603ffac9..e4705065b1be 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -2834,7 +2834,7 @@ EXPLAIN SELECT * FROM t1 WHERE f1 IN 3784744,4180925,4559596,3963734,3856391,4494153) AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 NULL range PRIMARY,idx1,idx2 idx1 64 NULL 18 100.00 Using index condition +1 SIMPLE t1 NULL range PRIMARY,idx1,idx2 PRIMARY 4 NULL 18 0.28 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t1`.`f3` AS `f3`,`test`.`t1`.`f4` AS `f4`,`test`.`t1`.`f5` AS `f5` from `test`.`t1` where ((`test`.`t1`.`f4` = 0) and (`test`.`t1`.`f2` = 1221457) and (`test`.`t1`.`f5` = 'abcdefghijklmnopwrst') and (`test`.`t1`.`f1` in (3305028,3353871,3772880,3346860,4228206,3336022,3470988,3305175,3329875,3817277,3856380,3796193,3784744,4180925,4559596,3963734,3856391,4494153))) DROP TABLE t1; diff --git a/mysql-test/suite/opt_trace/r/range_no_prot.result b/mysql-test/suite/opt_trace/r/range_no_prot.result index e2abd91b74b5..f4a5fd38f17b 100644 --- a/mysql-test/suite/opt_trace/r/range_no_prot.result +++ b/mysql-test/suite/opt_trace/r/range_no_prot.result @@ -5428,138 +5428,6 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND v = 'a' AND pk < 3 { ] /* considered_execution_plans */ }, { -<<<<<<< HEAD -||||||| merged common ancestors - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "i1_idx", - "usable": true, - "key_parts": [ - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "v_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "v_idx", - "cost": 2.0063, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "i1_idx", - "ranges": [ - "1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { -======= - "check_if_range_uses_more_keyparts_than_ref": { - "rerunning_range_optimizer_for_single_index": { - "range_analysis": { - "table_scan": { - "rows": 5, - "cost": 2e308 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "i1_idx", - "usable": true, - "key_parts": [ - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "v_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "v_idx", - "cost": 2.0063, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "i1_idx", - "ranges": [ - "1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */ - } /* range_analysis */ - } /* rerunning_range_optimizer_for_single_index */ - } /* check_if_range_uses_more_keyparts_than_ref */ - }, - { ->>>>>>> mysql-5.7.25 "attaching_conditions_to_tables": { "original_condition": "((`t1`.`v` = 'a') and (`t1`.`i1` = 1) and (`t1`.`pk` < 3))", "attached_conditions_computation": [ @@ -5875,172 +5743,6 @@ EXPLAIN SELECT v FROM t1 WHERE i1 = 1 AND i2 = 1 AND v = 'a' AND pk < 3 { ] /* considered_execution_plans */ }, { -<<<<<<< HEAD -||||||| merged common ancestors - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 5, - "cost": 4.1 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "v_idx", - "usable": true, - "key_parts": [ - "v", - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "i1_i2_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "v_idx", - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "v_idx", - "rows": 1, - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 1, - "cost_for_plan": 2.21, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "v_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, - { -======= - "check_if_range_uses_more_keyparts_than_ref": { - "rerunning_range_optimizer_for_single_index": { - "range_analysis": { - "table_scan": { - "rows": 5, - "cost": 2e308 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "v_idx", - "usable": true, - "key_parts": [ - "v", - "i1", - "pk" - ] /* key_parts */ - }, - { - "index": "i1_i2_idx", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "v_idx", - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 2.21, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "v_idx", - "rows": 1, - "ranges": [ - "a <= v <= a AND 1 <= i1 <= 1 AND pk < 3" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 1, - "cost_for_plan": 2.21, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } /* rerunning_range_optimizer_for_single_index */ - } /* check_if_range_uses_more_keyparts_than_ref */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "v_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, - { ->>>>>>> mysql-5.7.25 "attaching_conditions_to_tables": { "original_condition": "((`t1`.`v` = 'a') and (`t1`.`i2` = 1) and (`t1`.`i1` = 1) and (`t1`.`pk` < 3))", "attached_conditions_computation": [ @@ -6307,242 +6009,6 @@ EXPLAIN SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a { ] /* considered_execution_plans */ }, { -<<<<<<< HEAD -||||||| merged common ancestors - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 4, - "cost": 3.9 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "b", - "cost": 1.8044, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "potential_group_range_indexes": [ - { - "index": "PRIMARY", - "covering": true, - "index_dives_for_eq_ranges": true, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "rows": 2, - "cost": 1.6 - } - ] /* potential_group_range_indexes */ - } /* group_index_range */, - "best_group_range_summary": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "chosen": true - } /* best_group_range_summary */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2, - "cost": 2.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 1.6, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "PRIMARY", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, - { -======= - "check_if_range_uses_more_keyparts_than_ref": { - "rerunning_range_optimizer_for_single_index": { - "range_analysis": { - "table_scan": { - "rows": 4, - "cost": 2e308 - } /* table_scan */, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b", - "usable": false, - "cause": "not_applicable" - } - ] /* potential_range_indexes */, - "best_covering_index_scan": { - "index": "b", - "cost": 1.8044, - "chosen": true - } /* best_covering_index_scan */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "potential_group_range_indexes": [ - { - "index": "PRIMARY", - "covering": true, - "index_dives_for_eq_ranges": true, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "rows": 2, - "cost": 1.6 - } - ] /* potential_group_range_indexes */ - } /* group_index_range */, - "best_group_range_summary": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "chosen": true - } /* best_group_range_summary */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2, - "cost": 2.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_group", - "index": "PRIMARY", - "group_attribute": "b", - "min_aggregate": false, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 2, - "cost": 1.6, - "key_parts_used_for_access": [ - "a" - ] /* key_parts_used_for_access */, - "ranges": [ - "1 <= a <= 1 AND b < 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 1.6, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } /* rerunning_range_optimizer_for_single_index */ - } /* check_if_range_uses_more_keyparts_than_ref */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "PRIMARY", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - }, - { ->>>>>>> mysql-5.7.25 "attaching_conditions_to_tables": { "original_condition": "((`t1`.`a` = 1) and (`t1`.`b` < 2))", "attached_conditions_computation": [ diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index 447652b9a019..0a3453596d3d 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -16,18 +16,10 @@ wait/synch/mutex/sql/LOCK_audit_mask YES YES wait/synch/mutex/sql/LOCK_compress_gtid_table YES YES select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' -<<<<<<< HEAD - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') -order by name limit 11; -||||||| merged common ancestors - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') -order by name limit 10; -======= and name not in ( 'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', 'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') -order by name limit 10; ->>>>>>> mysql-5.7.25 +order by name limit 11; NAME ENABLED TIMED wait/synch/rwlock/sql/Binlog_relay_IO_delegate::lock YES YES wait/synch/rwlock/sql/Binlog_storage_delegate::lock YES YES diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test index 3b2b2a01c2b7..c7e1ea01edff 100644 --- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -25,18 +25,10 @@ select * from performance_schema.setup_instruments select * from performance_schema.setup_instruments where name like 'Wait/Synch/Rwlock/sql/%' -<<<<<<< HEAD - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') - order by name limit 11; -||||||| merged common ancestors - and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock') - order by name limit 10; -======= and name not in ( 'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock', 'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group') - order by name limit 10; ->>>>>>> mysql-5.7.25 + order by name limit 11; # COND_handler_count is dependent on the build (Windows only) # DEBUG_SYNC::cond is dependent on the build (DEBUG only) diff --git a/mysql-test/suite/rpl/r/rpl_row_gtid_disconnect_drop_temporary_table.result b/mysql-test/suite/rpl/r/rpl_row_mix_gtid_disconnect_drop_temporary_table.result similarity index 100% rename from mysql-test/suite/rpl/r/rpl_row_gtid_disconnect_drop_temporary_table.result rename to mysql-test/suite/rpl/r/rpl_row_mix_gtid_disconnect_drop_temporary_table.result diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_gtid_disconnect_drop_temporary_table.result b/mysql-test/suite/rpl/r/rpl_stm_gtid_disconnect_drop_temporary_table.result similarity index 100% rename from mysql-test/suite/rpl/r/rpl_stm_mix_gtid_disconnect_drop_temporary_table.result rename to mysql-test/suite/rpl/r/rpl_stm_gtid_disconnect_drop_temporary_table.result diff --git a/mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test b/mysql-test/suite/rpl/t/rpl_row_mix_gtid_disconnect_drop_temporary_table.test similarity index 64% rename from mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test rename to mysql-test/suite/rpl/t/rpl_row_mix_gtid_disconnect_drop_temporary_table.test index f9d510af99b5..f57a49aae5a2 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_mix_gtid_disconnect_drop_temporary_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_mix_gtid_disconnect_drop_temporary_table.test @@ -1,8 +1,8 @@ # This is a wrapper for gtid_disconnect_drop_temporary_table.test -# so that the same test can be used for mix/statement and row mode +# so that the same test can be used for statement and mix/row mode # The o/p of the above mentioned test varies with binlog format due to # Bug#28606948 ---source include/have_binlog_format_mixed_or_statement.inc +--source include/have_binlog_format_mixed_or_row.inc --source extra/rpl_tests/gtid_disconnect_drop_temporary_table.test diff --git a/mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test b/mysql-test/suite/rpl/t/rpl_stm_gtid_disconnect_drop_temporary_table.test similarity index 66% rename from mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test rename to mysql-test/suite/rpl/t/rpl_stm_gtid_disconnect_drop_temporary_table.test index 29076f636a99..8d8b2a68e312 100644 --- a/mysql-test/suite/rpl/t/rpl_row_gtid_disconnect_drop_temporary_table.test +++ b/mysql-test/suite/rpl/t/rpl_stm_gtid_disconnect_drop_temporary_table.test @@ -1,8 +1,8 @@ # This is a wrapper for gtid_disconnect_drop_temporary_table.test -# so that the same test can be used for mix/statement and row mode +# so that the same test can be used for statement and mix/row mode # The o/p of the above mentioned test varies with binlog format due to # Bug#28606948 ---source include/have_binlog_format_row.inc +--source include/have_binlog_format_statement.inc --source extra/rpl_tests/gtid_disconnect_drop_temporary_table.test diff --git a/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test b/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test index 9093c7702775..00f24e454bed 100644 --- a/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_redo_log_encrypt_basic.test @@ -1,6 +1,7 @@ --disable_query_log -call mtr.add_suppression("\\[Error\\] .*MY-\\d+.* Encryption can't find master key, please check the keyring plugin is loaded."); -call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.* Can't set redo log tablespace to be encrypted."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded\\."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Can't set redo log tablespace to be encrypted\\."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Redo log key generation failed\\."); --enable_query_log SET @start_global_value = @@global.innodb_redo_log_encrypt; diff --git a/mysql-test/suite/tokudb/r-native-partitioning/type_temporal_fractional.result b/mysql-test/suite/tokudb/r-native-partitioning/type_temporal_fractional.result index b980c9165d4a..9bef63153627 100644 --- a/mysql-test/suite/tokudb/r-native-partitioning/type_temporal_fractional.result +++ b/mysql-test/suite/tokudb/r-native-partitioning/type_temporal_fractional.result @@ -74,13 +74,13 @@ NOW(0), NOW(1), NOW(2), NOW(3), NOW(4), NOW(5), NOW(6); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `NOW(0)` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `NOW(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `NOW(2)` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `NOW(3)` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `NOW(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `NOW(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `NOW(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `NOW(0)` datetime NOT NULL, + `NOW(1)` datetime(1) NOT NULL, + `NOW(2)` datetime(2) NOT NULL, + `NOW(3)` datetime(3) NOT NULL, + `NOW(4)` datetime(4) NOT NULL, + `NOW(5)` datetime(5) NOT NULL, + `NOW(6)` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @@ -90,13 +90,13 @@ SYSDATE(4), SYSDATE(5), SYSDATE(6); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `SYSDATE(0)` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SYSDATE(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `SYSDATE(2)` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `SYSDATE(3)` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `SYSDATE(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `SYSDATE(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `SYSDATE(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `SYSDATE(0)` datetime NOT NULL, + `SYSDATE(1)` datetime(1) NOT NULL, + `SYSDATE(2)` datetime(2) NOT NULL, + `SYSDATE(3)` datetime(3) NOT NULL, + `SYSDATE(4)` datetime(4) NOT NULL, + `SYSDATE(5)` datetime(5) NOT NULL, + `SYSDATE(6)` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @@ -9449,7 +9449,7 @@ CREATE TABLE t2 AS SELECT IF(1, a, b) AS a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `a` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; diff --git a/mysql-test/suite/tokudb/r/type_temporal_fractional.result b/mysql-test/suite/tokudb/r/type_temporal_fractional.result index f09934c2a252..f43811cac4d1 100644 --- a/mysql-test/suite/tokudb/r/type_temporal_fractional.result +++ b/mysql-test/suite/tokudb/r/type_temporal_fractional.result @@ -74,13 +74,13 @@ NOW(0), NOW(1), NOW(2), NOW(3), NOW(4), NOW(5), NOW(6); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `NOW(0)` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `NOW(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `NOW(2)` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `NOW(3)` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `NOW(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `NOW(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `NOW(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `NOW(0)` datetime NOT NULL, + `NOW(1)` datetime(1) NOT NULL, + `NOW(2)` datetime(2) NOT NULL, + `NOW(3)` datetime(3) NOT NULL, + `NOW(4)` datetime(4) NOT NULL, + `NOW(5)` datetime(5) NOT NULL, + `NOW(6)` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @@ -90,13 +90,13 @@ SYSDATE(4), SYSDATE(5), SYSDATE(6); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `SYSDATE(0)` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SYSDATE(1)` datetime(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0', - `SYSDATE(2)` datetime(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00', - `SYSDATE(3)` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000', - `SYSDATE(4)` datetime(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', - `SYSDATE(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', - `SYSDATE(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `SYSDATE(0)` datetime NOT NULL, + `SYSDATE(1)` datetime(1) NOT NULL, + `SYSDATE(2)` datetime(2) NOT NULL, + `SYSDATE(3)` datetime(3) NOT NULL, + `SYSDATE(4)` datetime(4) NOT NULL, + `SYSDATE(5)` datetime(5) NOT NULL, + `SYSDATE(6)` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @@ -9461,7 +9461,7 @@ CREATE TABLE t2 AS SELECT IF(1, a, b) AS a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `a` datetime(6) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; diff --git a/sql/conn_handler/connection_handler_per_thread.cc b/sql/conn_handler/connection_handler_per_thread.cc index 2ab9b035184e..018d864e1481 100644 --- a/sql/conn_handler/connection_handler_per_thread.cc +++ b/sql/conn_handler/connection_handler_per_thread.cc @@ -356,7 +356,7 @@ extern "C" void *handle_connection(void *arg) channel_info->send_error_and_close_channel(ER_SERVER_SHUTDOWN, 0, false); delete channel_info; channel_info = NULL; - Connection_handler_manager::dec_connection_count(); + Connection_handler_manager::dec_connection_count(extra_port_connection); break; } } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 60368f65d8ae..fe2f1f972dca 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9297,16 +9297,10 @@ static PSI_rwlock_info all_server_rwlocks[]= { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL}, { &key_rwlock_LOCK_consistent_snapshot, "LOCK_consistent_snapshot", PSI_FLAG_GLOBAL}, { &key_rwlock_Server_state_delegate_lock, "Server_state_delegate::lock", PSI_FLAG_GLOBAL}, -<<<<<<< HEAD - { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL}, -||||||| merged common ancestors - { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL} -======= { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL}, #if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) { &key_rwlock_LOCK_named_pipe_full_access_group, "LOCK_named_pipe_full_access_group", PSI_FLAG_GLOBAL}, #endif /* _WIN32 && !EMBEDDED_LIBRARY */ ->>>>>>> mysql-5.7.25 }; PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; diff --git a/sql/mysqld.h b/sql/mysqld.h index d4fb0be654ef..cb4c0893ce1f 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -872,16 +872,10 @@ extern mysql_mutex_t LOCK_global_system_variables, LOCK_user_conn, LOCK_log_throttle_qni, LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_sql_slave_skip_counter, LOCK_slave_net_timeout, -<<<<<<< HEAD + LOCK_slave_trans_dep_tracker, LOCK_offline_mode, LOCK_default_password_lifetime, LOCK_global_user_client_stats, LOCK_global_table_stats, LOCK_global_index_stats; -||||||| merged common ancestors - LOCK_offline_mode, LOCK_default_password_lifetime; -======= - LOCK_slave_trans_dep_tracker, - LOCK_offline_mode, LOCK_default_password_lifetime; ->>>>>>> mysql-5.7.25 #ifdef HAVE_OPENSSL extern char* des_key_file; extern mysql_mutex_t LOCK_des_key_file; diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc index e4aaf3141129..c1d09dcf8e95 100644 --- a/sql/rpl_slave.cc +++ b/sql/rpl_slave.cc @@ -3452,16 +3452,8 @@ static int write_ignored_events_info_to_relay_log(THD *thd, "failed to write a Rotate event" " to the relay log, SHOW SLAVE STATUS may be" " inaccurate"); -<<<<<<< HEAD - rli->relay_log.harvest_bytes_written(&rli->log_space_total); - if (flush_master_info(mi, force_mi_flush)) -||||||| merged common ancestors - rli->relay_log.harvest_bytes_written(&rli->log_space_total); - if (flush_master_info(mi, TRUE)) -======= rli->relay_log.harvest_bytes_written(rli, true/*need_log_space_lock=true*/); - if (flush_master_info(mi, TRUE)) ->>>>>>> mysql-5.7.25 + if (flush_master_info(mi, force_mi_flush)) { error= 1; sql_print_error("Failed to flush master info file."); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index eadec111144c..5508dd510e6b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1977,55 +1977,6 @@ bool close_temporary_tables(THD *thd) table= next) { /* Separate transactional from non-transactional temp tables */ -<<<<<<< HEAD - if (!table->should_binlog_drop_if_temp()) - { - /* Nothing, do not binlog this one */ - } - else if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) - { - found_trans_table= true; - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query_trans, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query_trans.append(','); - } - else if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) - { - found_non_trans_table= true; - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query_non_trans, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query_non_trans.append(','); -||||||| merged common ancestors - if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) - { - found_trans_table= true; - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query_trans, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query_trans.append(','); - } - else if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) - { - found_non_trans_table= true; - /* - We are going to add ` around the table names and possible more - due to special characters - */ - append_identifier(thd, &s_query_non_trans, table->s->table_name.str, - strlen(table->s->table_name.str)); - s_query_non_trans.append(','); -======= if (table->should_binlog_drop_if_temp()) { if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) { found_trans_table= true; @@ -2048,7 +1999,6 @@ bool close_temporary_tables(THD *thd) strlen(table->s->table_name.str)); s_query_non_trans.append(','); } ->>>>>>> mysql-5.7.25 } next= table->next; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index e44dfa18f20f..ae29f598e901 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -61,14 +61,10 @@ #include "transaction.h" // trans_commit_stmt #include "rpl_write_set_handler.h" // transaction_write_set_hashing_algorithms #include "rpl_group_replication.h" // is_group_replication_running -<<<<<<< HEAD -#include "threadpool.h" -||||||| merged common ancestors -======= #ifdef _WIN32 #include "named_pipe.h" #endif ->>>>>>> mysql-5.7.25 +#include "threadpool.h" #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" diff --git a/sql/table.h b/sql/table.h index c7a9b151b441..511099388874 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1492,20 +1492,6 @@ struct TABLE */ void update_compressed_columns_info(const List& fields); -private: - bool should_binlog_drop_if_temp_flag; - -public: - void set_binlog_drop_if_temp(bool should_binlog) - { - should_binlog_drop_if_temp_flag= should_binlog; - } - - bool should_binlog_drop_if_temp(void) const - { - return should_binlog_drop_if_temp_flag; - } - /** Check if table contains any records. diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4833b3e5ddab..f8e623caaf67 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1662,7 +1662,17 @@ innobase_fts_store_docid( dbug_tmp_restore_column_map(tbl->write_set, old_map); } -<<<<<<< HEAD +/*****************************************************************//** +Checks if the filename name is reserved in InnoDB. +@return true if the name is reserved */ +static +bool +innobase_check_reserved_file_name( +/*===================*/ + handlerton* hton, /*!< in: handlerton of Innodb */ + const char* name); /*!< in: Name of the database */ + + /** Sync innodb_kill_idle_transaction and kill_idle_transaction values. @param[in,out] thd thread handle @@ -1680,20 +1690,6 @@ static void innodb_kill_idle_transaction_update( srv_kill_idle_transaction= in_val; } -||||||| merged common ancestors -======= -/*****************************************************************//** -Checks if the filename name is reserved in InnoDB. -@return true if the name is reserved */ -static -bool -innobase_check_reserved_file_name( -/*===================*/ - handlerton* hton, /*!< in: handlerton of Innodb */ - const char* name); /*!< in: Name of the database */ - - ->>>>>>> mysql-5.7.25 /*************************************************************//** Check for a valid value of innobase_commit_concurrency. @return 0 for valid innodb_commit_concurrency */ @@ -4153,16 +4149,12 @@ innobase_init( innobase_hton->replace_native_transaction_in_thd = innodb_replace_trx_in_thd; innobase_hton->data = &innodb_api_cb; -<<<<<<< HEAD + innobase_hton->is_reserved_db_name= innobase_check_reserved_file_name; innobase_hton->flush_changed_page_bitmaps = innobase_flush_changed_page_bitmaps; innobase_hton->purge_changed_page_bitmaps = innobase_purge_changed_page_bitmaps; innobase_hton->get_parent_fk_list = innobase_get_parent_fk_list; -||||||| merged common ancestors -======= - innobase_hton->is_reserved_db_name= innobase_check_reserved_file_name; ->>>>>>> mysql-5.7.25 innobase_hton->is_supported_system_table= innobase_is_supported_system_table; @@ -23874,7 +23866,33 @@ innodb_buffer_pool_size_validate( return(0); } -<<<<<<< HEAD + +/*****************************************************************//** +Checks if the file name is reserved in InnoDB. Currently +redo log files(ib_logfile*) is reserved. +@return true if the name is reserved */ +static +bool +innobase_check_reserved_file_name( +/*===================*/ + handlerton* hton, /*!< in: handlerton of Innodb */ + const char* name) /*!< in: Name of the database */ +{ + CHARSET_INFO *ci= system_charset_info; + size_t logname_size = strlen(ib_logfile_basename); + + /* Name is smaller than reserved name */ + if (strlen(name) < logname_size) { + return (false); + } + /* Do case insensitive comparison for name. */ + for (uint i=0; i < logname_size; i++) { + if (my_tolower(ci, name[i]) != ib_logfile_basename[i]){ + return (false); + } + } + return (true); +} static int @@ -23915,33 +23933,3 @@ innodb_encrypt_tables_validate( return 0; } -||||||| merged common ancestors -======= - -/*****************************************************************//** -Checks if the file name is reserved in InnoDB. Currently -redo log files(ib_logfile*) is reserved. -@return true if the name is reserved */ -static -bool -innobase_check_reserved_file_name( -/*===================*/ - handlerton* hton, /*!< in: handlerton of Innodb */ - const char* name) /*!< in: Name of the database */ -{ - CHARSET_INFO *ci= system_charset_info; - size_t logname_size = strlen(ib_logfile_basename); - - /* Name is smaller than reserved name */ - if (strlen(name) < logname_size) { - return (false); - } - /* Do case insensitive comparison for name. */ - for (uint i=0; i < logname_size; i++) { - if (my_tolower(ci, name[i]) != ib_logfile_basename[i]){ - return (false); - } - } - return (true); -} ->>>>>>> mysql-5.7.25 diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h index 31aeb1f66be6..2323ed6089e2 100644 --- a/storage/innobase/include/row0upd.h +++ b/storage/innobase/include/row0upd.h @@ -227,12 +227,8 @@ the equal ordering fields. NOTE: we compare the fields as binary strings! @param[in] heap memory heap from which allocated @param[in,out] mysql_table NULL, or mysql table object when user thread invokes dml -<<<<<<< HEAD @param[in] prebuilt compress_heap must be taken from here -||||||| merged common ancestors -======= @param[out] error error number in case of failure ->>>>>>> mysql-5.7.25 @return own: update vector of differing fields, excluding roll ptr and trx id */ upd_t* @@ -244,15 +240,9 @@ row_upd_build_difference_binary( bool no_sys, trx_t* trx, mem_heap_t* heap, -<<<<<<< HEAD - TABLE* mysql_table, - row_prebuilt_t* prebuilt) -||||||| merged common ancestors - TABLE* mysql_table) -======= TABLE* mysql_table, + row_prebuilt_t* prebuilt, dberr_t* error) ->>>>>>> mysql-5.7.25 MY_ATTRIBUTE((warn_unused_result)); /***********************************************************//** Replaces the new column values stored in the update vector to the index entry diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index a82bf07f84e6..7c14a45c4c04 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 27 +#define PERCONA_INNODB_VERSION 28 #endif /* The following is the InnoDB version as shown in diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index e23555e53e56..a668a36f9b36 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -366,17 +366,11 @@ row_ins_clust_index_entry_by_modify( update = row_upd_build_difference_binary( cursor->index, entry, rec, NULL, true, -<<<<<<< HEAD - thr_get_trx(thr), heap, mysql_table, thr->prebuilt); -||||||| merged common ancestors - thr_get_trx(thr), heap, mysql_table); -======= - thr_get_trx(thr), heap, mysql_table, &err); + thr_get_trx(thr), heap, mysql_table, thr->prebuilt, &err); if (err != DB_SUCCESS) { return(err); } ->>>>>>> mysql-5.7.25 if (mode != BTR_MODIFY_TREE) { ut_ad((mode & ~BTR_ALREADY_S_LATCHED) == BTR_MODIFY_LEAF); diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 917551be88fe..1a21555569a4 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -2408,16 +2408,10 @@ row_log_table_apply_update( row, NULL, index, heap, ROW_BUILD_FOR_INSERT); upd_t* update = row_upd_build_difference_binary( index, entry, btr_pcur_get_rec(&pcur), cur_offsets, -<<<<<<< HEAD - false, NULL, heap, dup->table, thr->prebuilt); -||||||| merged common ancestors - false, NULL, heap, dup->table); -======= - false, NULL, heap, dup->table, &error); + false, NULL, heap, dup->table, thr->prebuilt, &error); if (error != DB_SUCCESS) { goto func_exit; } ->>>>>>> mysql-5.7.25 if (!update->n_fields) { /* Nothing to do. */ diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index a04fdc8aeac9..6d59543c565a 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -877,12 +877,8 @@ the equal ordering fields. NOTE: we compare the fields as binary strings! @param[in] heap memory heap from which allocated @param[in] mysql_table NULL, or mysql table object when user thread invokes dml -<<<<<<< HEAD @param[in] prebuilt compress_heap must be taken from here -||||||| merged common ancestors -======= @param[out] error error number in case of failure ->>>>>>> mysql-5.7.25 @return own: update vector of differing fields, excluding roll ptr and trx id,if error is not equal to DB_SUCCESS, return NULL */ upd_t* @@ -894,15 +890,9 @@ row_upd_build_difference_binary( bool no_sys, trx_t* trx, mem_heap_t* heap, -<<<<<<< HEAD - TABLE* mysql_table, - row_prebuilt_t* prebuilt) -||||||| merged common ancestors - TABLE* mysql_table) -======= TABLE* mysql_table, + row_prebuilt_t* prebuilt, dberr_t* error) ->>>>>>> mysql-5.7.25 { upd_field_t* upd_field; dfield_t* dfield; @@ -1007,17 +997,11 @@ row_upd_build_difference_binary( dfield_t* vfield = innobase_get_computed_value( update->old_vrow, col, index, &v_heap, heap, NULL, thd, mysql_table, -<<<<<<< HEAD NULL, NULL, NULL, prebuilt); -||||||| merged common ancestors - NULL, NULL, NULL); -======= - NULL, NULL, NULL); if (vfield == NULL) { *error = DB_COMPUTE_VALUE_FAILED; return(NULL); } ->>>>>>> mysql-5.7.25 if (!dfield_data_is_binary_equal( dfield, vfield->len, From 93d991832d55102b8a8aab8363b3526d3faee013 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Tue, 5 Feb 2019 11:04:27 +0200 Subject: [PATCH 211/214] Fix rpm patch --- build-ps/rpm/mysql-5.7-sharedlib-rename.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-ps/rpm/mysql-5.7-sharedlib-rename.patch b/build-ps/rpm/mysql-5.7-sharedlib-rename.patch index 700db44b5f4b..ee8ac88f76fd 100644 --- a/build-ps/rpm/mysql-5.7-sharedlib-rename.patch +++ b/build-ps/rpm/mysql-5.7-sharedlib-rename.patch @@ -266,15 +266,15 @@ diff -rup old/libmysql/libmysql.ver.in new/libmysql/libmysql.ver.in diff -rup old/plugin/percona-pam-for-mysql/CMakeLists.txt new/plugin/percona-pam-for-mysql/CMakeLists.txt --- old/plugin/percona-pam-for-mysql/CMakeLists.txt 2016-03-09 09:25:25.000000000 +0100 +++ new/plugin/percona-pam-for-mysql/CMakeLists.txt 2016-03-09 11:41:15.163325622 +0100 -@@ -37,7 +37,7 @@ IF(HAVE_PAM AND HAVE_GETPWNAM_R AND HAVE +@@ -37,7 +37,7 @@ MYSQL_ADD_PLUGIN(dialog src/dialog.c ../../client/get_password.c - LINK_LIBRARIES perconaserverclient + LINK_LIBRARIES mysqlclient MODULE_ONLY) - ENDIF(HAVE_PAM AND HAVE_GETPWNAM_R AND HAVE_GETGRGID_R AND HAVE_DLFCN_H) - ENDIF(WITH_PAM) + + IF(UNIX) diff -rup old/scripts/CMakeLists.txt new/scripts/CMakeLists.txt --- old/scripts/CMakeLists.txt 2016-03-09 09:25:25.000000000 +0100 +++ new/scripts/CMakeLists.txt 2016-03-09 11:41:15.163325622 +0100 From da74a77e524a81d86e601887d093fd92f6734264 Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Mon, 4 Feb 2019 20:47:47 +0200 Subject: [PATCH 212/214] Merge branch 'ps-5.6-bugps1827-binlog_skip_flush_commands' into ps-5.7-bugps1827-binlog_skip_flush_commands Re-recorded 'binlog.percona_binlog_skip_flush_commands' MTR test case because of the new 'FLUSH QUERY CACHE is deprecated' warning introduced in 5.7. 'perfschema.show_sanity' MTR test case extended with a new known system variable 'binlog_skip_flush_commands'. References to 'information_schema' in the 'sys_vars.binlog_skip_flush_commands_basic' MTR test case changed to 'performance_schema'. Updated and re-recorded 'group_replication.gr_recovery_slave_commands' MTR test case because of the new behavior of 'FLUSH RELAY LOGS' under 'super_read_only = ON'. --- mysql-test/r/mysqld--help-notwin.result | 4 + .../percona_binlog_skip_flush_commands.result | 1187 +++++++++++++++++ ...cona_binlog_skip_flush_commands-master.opt | 1 + .../t/percona_binlog_skip_flush_commands.test | 205 +++ .../suite/perfschema/t/show_sanity.test | 1 + .../r/binlog_skip_flush_commands_basic.result | 102 ++ .../t/binlog_skip_flush_commands_basic.test | 81 ++ .../mtr/r/gr_recovery_slave_commands.result | 6 +- .../mtr/t/gr_recovery_slave_commands.test | 6 +- sql/mysqld.cc | 1 + sql/mysqld.h | 1 + sql/sql_reload.cc | 34 +- sql/sys_vars.cc | 7 + 13 files changed, 1631 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/binlog/r/percona_binlog_skip_flush_commands.result create mode 100644 mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands-master.opt create mode 100644 mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands.test create mode 100644 mysql-test/suite/sys_vars/r/binlog_skip_flush_commands_basic.result create mode 100644 mysql-test/suite/sys_vars/t/binlog_skip_flush_commands_basic.test diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 182768b0e93a..263fac245631 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -136,6 +136,9 @@ The following options may be given as the first argument: FULL). --binlog-rows-query-log-events Allow writing of Rows_query_log events into binary log. + --binlog-skip-flush-commands + If set to TRUE, FLUSH commands will not be be + written to the binary log --binlog-space-limit=# Maximum space to use for all binary logs. Default is 0, this feature is disabled. @@ -1399,6 +1402,7 @@ binlog-order-commits TRUE binlog-row-event-max-size 8192 binlog-row-image FULL binlog-rows-query-log-events FALSE +binlog-skip-flush-commands FALSE binlog-space-limit 0 binlog-stmt-cache-size 32768 binlog-transaction-dependency-history-size 25000 diff --git a/mysql-test/suite/binlog/r/percona_binlog_skip_flush_commands.result b/mysql-test/suite/binlog/r/percona_binlog_skip_flush_commands.result new file mode 100644 index 000000000000..b53cd8fb8975 --- /dev/null +++ b/mysql-test/suite/binlog/r/percona_binlog_skip_flush_commands.result @@ -0,0 +1,1187 @@ +# +# This is an MTR test case for the new 'binlog_skip_flush_commands' global +# system variable introduced as a fix for +# Bug #88720 "Inconsistent and unsafe FLUSH behavior in terms of replication" +# (https://bugs.mysql.com/bug.php?id=88720) +# PS-1827 "LP #1736921: Inconsistent and unsafe FLUSH behavior in terms of replication" +# (https://jira.percona.com/browse/PS-1827) +# +CREATE USER 'wo_reload'@'localhost'; +GRANT ALL PRIVILEGES ON *.* TO 'wo_reload'@'localhost'; +REVOKE SUPER ON *.* FROM 'wo_reload'@'localhost'; +REVOKE RELOAD ON *.* FROM 'wo_reload'@'localhost'; +CREATE USER 'wo_super'@'localhost'; +GRANT ALL PRIVILEGES ON *.* TO 'wo_super'@'localhost'; +REVOKE SUPER ON *.* FROM 'wo_super'@'localhost'; +SET @saved_read_only = @@global.read_only; +SET @saved_super_read_only = @@global.super_read_only; +SET @saved_binlog_skip_flush_commands = @@global.binlog_skip_flush_commands; +CREATE TABLE t1(f1 int); +INSERT INTO t1 VALUES(1); +SELECT 1; +1 +1 +CREATE TEMPORARY TABLE flush_statement( +id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, +value VARCHAR(64) NOT NULL +); +INSERT INTO flush_statement(value) VALUES +('ERROR LOGS'), +('ENGINE LOGS'), +('GENERAL LOGS'), +('SLOW LOGS'), +('RELAY LOGS'), +('QUERY CACHE'), +('HOSTS'), +('PRIVILEGES'), +('STATUS'), +('CLIENT_STATISTICS'), +('USER_STATISTICS'), +('THREAD_STATISTICS'), +('TABLE_STATISTICS'), +('INDEX_STATISTICS'), +('DES_KEY_FILE'), +('USER_RESOURCES'), +('CHANGED_PAGE_BITMAPS') +; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH ERROR LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH ERROR LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH ERROR LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ERROR LOGS; +include/assert.inc [FLUSH ERROR LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH ENGINE LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH ENGINE LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH ENGINE LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH ENGINE LOGS; +include/assert.inc [FLUSH ENGINE LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH GENERAL LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH GENERAL LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH GENERAL LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH GENERAL LOGS; +include/assert.inc [FLUSH GENERAL LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH SLOW LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH SLOW LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH SLOW LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH SLOW LOGS; +include/assert.inc [FLUSH SLOW LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH RELAY LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH RELAY LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH RELAY LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH RELAY LOGS; +include/assert.inc [FLUSH RELAY LOGS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH QUERY CACHE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH QUERY CACHE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH QUERY CACHE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH QUERY CACHE; +Warnings: +Warning 1681 'FLUSH QUERY CACHE' is deprecated and will be removed in a future release. +include/assert.inc [FLUSH QUERY CACHE with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH HOSTS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH HOSTS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH HOSTS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH HOSTS; +include/assert.inc [FLUSH HOSTS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH PRIVILEGES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH PRIVILEGES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH PRIVILEGES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH PRIVILEGES; +include/assert.inc [FLUSH PRIVILEGES with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH STATUS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH STATUS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH STATUS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH STATUS; +include/assert.inc [FLUSH STATUS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH CLIENT_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH CLIENT_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH CLIENT_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CLIENT_STATISTICS; +include/assert.inc [FLUSH CLIENT_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH USER_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH USER_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH USER_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_STATISTICS; +include/assert.inc [FLUSH USER_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH THREAD_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH THREAD_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH THREAD_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH THREAD_STATISTICS; +include/assert.inc [FLUSH THREAD_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH TABLE_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH TABLE_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH TABLE_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH TABLE_STATISTICS; +include/assert.inc [FLUSH TABLE_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH INDEX_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH INDEX_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH INDEX_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH INDEX_STATISTICS; +include/assert.inc [FLUSH INDEX_STATISTICS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH DES_KEY_FILE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH DES_KEY_FILE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH DES_KEY_FILE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH DES_KEY_FILE; +include/assert.inc [FLUSH DES_KEY_FILE with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH USER_RESOURCES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH USER_RESOURCES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH USER_RESOURCES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH USER_RESOURCES; +include/assert.inc [FLUSH USER_RESOURCES with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (read_only = OFF, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = OFF; +SET GLOBAL read_only = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (read_only = ON, super_read_only = OFF) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL super_read_only = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o RELOAD)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (user w/o SUPER)] +SET GLOBAL binlog_skip_flush_commands = OFF; +FLUSH CHANGED_PAGE_BITMAPS; +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to OFF must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = ON; +FLUSH CHANGED_PAGE_BITMAPS; +include/assert.inc [FLUSH CHANGED_PAGE_BITMAPS with binlog_skip_flush_commands set to ON must not change gtid (super_read_only = ON) (SUPER user)] +SET GLOBAL binlog_skip_flush_commands = OFF; +SET GLOBAL binlog_skip_flush_commands = @saved_binlog_skip_flush_commands; +SET GLOBAL super_read_only = @saved_super_read_only; +SET GLOBAL read_only = @saved_read_only; +DROP TABLE t1; +DROP USER 'wo_super'@'localhost'; +DROP USER 'wo_reload'@'localhost'; diff --git a/mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands-master.opt b/mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands-master.opt new file mode 100644 index 000000000000..93fefb36ed79 --- /dev/null +++ b/mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands-master.opt @@ -0,0 +1 @@ +--gtid_mode=ON --enforce-gtid-consistency --log-slave-updates diff --git a/mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands.test b/mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands.test new file mode 100644 index 000000000000..a987b56368c7 --- /dev/null +++ b/mysql-test/suite/binlog/t/percona_binlog_skip_flush_commands.test @@ -0,0 +1,205 @@ +--source include/have_log_bin.inc + +--echo # +--echo # This is an MTR test case for the new 'binlog_skip_flush_commands' global +--echo # system variable introduced as a fix for +--echo # Bug #88720 "Inconsistent and unsafe FLUSH behavior in terms of replication" +--echo # (https://bugs.mysql.com/bug.php?id=88720) +--echo # PS-1827 "LP #1736921: Inconsistent and unsafe FLUSH behavior in terms of replication" +--echo # (https://jira.percona.com/browse/PS-1827) +--echo # + +# creating a user without SUPER and RELOAD privileges +CREATE USER 'wo_reload'@'localhost'; +GRANT ALL PRIVILEGES ON *.* TO 'wo_reload'@'localhost'; +REVOKE SUPER ON *.* FROM 'wo_reload'@'localhost'; +REVOKE RELOAD ON *.* FROM 'wo_reload'@'localhost'; + +# creating a user without SUPER privilege +CREATE USER 'wo_super'@'localhost'; +GRANT ALL PRIVILEGES ON *.* TO 'wo_super'@'localhost'; +REVOKE SUPER ON *.* FROM 'wo_super'@'localhost'; + +--source include/count_sessions.inc + +--connect(wo_reload_con,localhost,wo_reload) +--connect(wo_super_con,localhost,wo_super) + +--connection default + +SET @saved_read_only = @@global.read_only; +SET @saved_super_read_only = @@global.super_read_only; +SET @saved_binlog_skip_flush_commands = @@global.binlog_skip_flush_commands; + +CREATE TABLE t1(f1 int); +INSERT INTO t1 VALUES(1); +SELECT 1; + +--let $gtid_prefix_length = 40 + +CREATE TEMPORARY TABLE flush_statement( + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + value VARCHAR(64) NOT NULL +); +INSERT INTO flush_statement(value) VALUES + ('ERROR LOGS'), + ('ENGINE LOGS'), + ('GENERAL LOGS'), + ('SLOW LOGS'), + ('RELAY LOGS'), + ('QUERY CACHE'), + ('HOSTS'), + ('PRIVILEGES'), + ('STATUS'), + ('CLIENT_STATISTICS'), + ('USER_STATISTICS'), + ('THREAD_STATISTICS'), + ('TABLE_STATISTICS'), + ('INDEX_STATISTICS'), + ('DES_KEY_FILE'), + ('USER_RESOURCES'), + ('CHANGED_PAGE_BITMAPS') +; + +--let $statement_idx = 1 +--let $number_of_statements = `SELECT COUNT(*) FROM flush_statement` + +while($statement_idx <= $number_of_statements) +{ + --connection default + --let $statement = `SELECT CONCAT('FLUSH ', value) FROM flush_statement WHERE id = $statement_idx` + + --let $read_only_mode_idx = 0 + while($read_only_mode_idx < 3) + { + --connection default + if($read_only_mode_idx == 0) + { + SET GLOBAL super_read_only = OFF; + SET GLOBAL read_only = OFF; + --let $read_only_mode_label = (read_only = OFF, super_read_only = OFF) + } + if($read_only_mode_idx == 1) + { + SET GLOBAL super_read_only = OFF; + SET GLOBAL read_only = ON; + --let $read_only_mode_label = (read_only = ON, super_read_only = OFF) + } + if($read_only_mode_idx == 2) + { + SET GLOBAL super_read_only = ON; + --let $read_only_mode_label = (super_read_only = ON) + } + + --let $user_type_idx = 0 + while($user_type_idx < 3) + { + if($user_type_idx == 0) + { + --let $custom_conection = wo_reload_con + --let $user_type_label = (user w/o RELOAD) + # users without RELOAD privilege should always get ER_SPECIFIC_ACCESS_DENIED_ERROR + --let $eval_should_fail = 1 + # users without RELOAD privilege should never change gtid_executed + --let $eval_should_change_gtid_executed = 0 + } + if($user_type_idx == 1) + { + --let $custom_conection = wo_super_con + --let $user_type_label = (user w/o SUPER) + # users with RELOAD privilege should succeed executing FLUSH XXX + --let $eval_should_fail = 0 + # users with RELOAD privilege should change gtid_executed only when read_only = OFF and super_read_only = OFF + --let $eval_should_change_gtid_executed = 0 + if($read_only_mode_idx == 0) + { + --let $eval_should_change_gtid_executed = 1 + } + # FLUSH CHANGED_PAGE_BITMAPS is an exception - it requires SUPER privilege to be executed + if($statement == "FLUSH CHANGED_PAGE_BITMAPS") + { + --let $eval_should_fail = 1 + --let $eval_should_change_gtid_executed = 0 + } + } + if($user_type_idx == 2) + { + --let $custom_conection = default + --let $user_type_label = (SUPER user) + # users with SUPER privilege should succeed executing FLUSH XXX + --let $eval_should_fail = 0 + # users with SUPER privilege should change gtid_executed only when super_read_only != OFF + --let $eval_should_change_gtid_executed = 1 + if($read_only_mode_idx == 2) + { + --let $eval_should_change_gtid_executed = 0 + } + } + + --connection default + --let $previous_gtid = `SELECT SUBSTR(@@global.gtid_executed, $gtid_prefix_length)` + + --connection $custom_conection + if($eval_should_fail) + { + --error ER_SPECIFIC_ACCESS_DENIED_ERROR + --eval $statement + } + if(!$eval_should_fail) + { + --eval $statement + } + + --connection default + --let $current_gtid = `SELECT SUBSTR(@@global.gtid_executed, $gtid_prefix_length)` + if($eval_should_change_gtid_executed) + { + --let $assert_cond= $previous_gtid + 1 = $current_gtid + --let $assert_text= $statement with binlog_skip_flush_commands set to OFF must change gtid $read_only_mode_label $user_type_label + } + if(!$eval_should_change_gtid_executed) + { + --let $assert_cond= $previous_gtid = $current_gtid + --let $assert_text= $statement with binlog_skip_flush_commands set to OFF must not change gtid $read_only_mode_label $user_type_label + } + --source include/assert.inc + SET GLOBAL binlog_skip_flush_commands = ON; + --let $previous_gtid = $current_gtid + + --connection $custom_conection + if($eval_should_fail) + { + --error ER_SPECIFIC_ACCESS_DENIED_ERROR + --eval $statement + } + if(!$eval_should_fail) + { + --eval $statement + } + --connection default + --let $current_gtid = `SELECT SUBSTR(@@global.gtid_executed, $gtid_prefix_length)` + --let $assert_cond= $previous_gtid = $current_gtid + --let $assert_text= $statement with binlog_skip_flush_commands set to ON must not change gtid $read_only_mode_label $user_type_label + --source include/assert.inc + SET GLOBAL binlog_skip_flush_commands = OFF; + + --inc $user_type_idx + } + --inc $read_only_mode_idx + } + --inc $statement_idx +} + +SET GLOBAL binlog_skip_flush_commands = @saved_binlog_skip_flush_commands; +SET GLOBAL super_read_only = @saved_super_read_only; +SET GLOBAL read_only = @saved_read_only; + +DROP TABLE t1; + +--disconnect wo_reload_con +--disconnect wo_super_con + +--source include/wait_until_count_sessions.inc + +DROP USER 'wo_super'@'localhost'; +DROP USER 'wo_reload'@'localhost'; diff --git a/mysql-test/suite/perfschema/t/show_sanity.test b/mysql-test/suite/perfschema/t/show_sanity.test index 7b8cec78ff14..839ab48ea93b 100644 --- a/mysql-test/suite/perfschema/t/show_sanity.test +++ b/mysql-test/suite/perfschema/t/show_sanity.test @@ -329,6 +329,7 @@ insert into test.sanity values ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "BINLOG_GTID_SIMPLE_RECOVERY"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "BINLOG_MAX_FLUSH_QUEUE_TIME"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "BINLOG_ORDER_COMMITS"), + ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "BINLOG_SKIP_FLUSH_COMMANDS"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "BINLOG_SPACE_LIMIT"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "BINLOG_STMT_CACHE_SIZE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "CHARACTER_SETS_DIR"), diff --git a/mysql-test/suite/sys_vars/r/binlog_skip_flush_commands_basic.result b/mysql-test/suite/sys_vars/r/binlog_skip_flush_commands_basic.result new file mode 100644 index 000000000000..bf5ead98ee6b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_skip_flush_commands_basic.result @@ -0,0 +1,102 @@ +SET @start_global_value = @@global.binlog_skip_flush_commands; +SELECT @start_global_value; +@start_global_value +0 +SELECT @@global.binlog_skip_flush_commands IN (0, 1); +@@global.binlog_skip_flush_commands IN (0, 1) +1 +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +0 +SELECT @@session.binlog_skip_flush_commands; +ERROR HY000: Variable 'binlog_skip_flush_commands' is a GLOBAL variable +SHOW GLOBAL VARIABLES LIKE 'binlog_skip_flush_commands'; +Variable_name Value +binlog_skip_flush_commands OFF +SHOW SESSION VARIABLES LIKE 'binlog_skip_flush_commands'; +Variable_name Value +binlog_skip_flush_commands OFF +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SET GLOBAL binlog_skip_flush_commands = ON; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +1 +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands ON +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands ON +SET GLOBAL binlog_skip_flush_commands = OFF; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +0 +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SET GLOBAL binlog_skip_flush_commands = 'ON'; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +1 +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands ON +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands ON +SET GLOBAL binlog_skip_flush_commands = 'OFF'; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +0 +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SET GLOBAL binlog_skip_flush_commands = 1; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +1 +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands ON +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands ON +SET GLOBAL binlog_skip_flush_commands = 0; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +0 +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; +VARIABLE_NAME VARIABLE_VALUE +binlog_skip_flush_commands OFF +SET SESSION binlog_skip_flush_commands = 'OFF'; +ERROR HY000: Variable 'binlog_skip_flush_commands' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.binlog_skip_flush_commands = 'ON'; +ERROR HY000: Variable 'binlog_skip_flush_commands' is a GLOBAL variable and should be set with SET GLOBAL +SET GLOBAL binlog_skip_flush_commands = 1.1; +ERROR 42000: Incorrect argument type to variable 'binlog_skip_flush_commands' +SET GLOBAL binlog_skip_flush_commands = 1e1; +ERROR 42000: Incorrect argument type to variable 'binlog_skip_flush_commands' +SET GLOBAL binlog_skip_flush_commands = 2; +ERROR 42000: Variable 'binlog_skip_flush_commands' can't be set to the value of '2' +SET GLOBAL binlog_skip_flush_commands = -3; +ERROR 42000: Variable 'binlog_skip_flush_commands' can't be set to the value of '-3' +SET GLOBAL binlog_skip_flush_commands = 'AUTO'; +ERROR 42000: Variable 'binlog_skip_flush_commands' can't be set to the value of 'AUTO' +SET GLOBAL binlog_skip_flush_commands = @start_global_value; +SELECT @@global.binlog_skip_flush_commands; +@@global.binlog_skip_flush_commands +0 diff --git a/mysql-test/suite/sys_vars/t/binlog_skip_flush_commands_basic.test b/mysql-test/suite/sys_vars/t/binlog_skip_flush_commands_basic.test new file mode 100644 index 000000000000..28ed104f0f1d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_skip_flush_commands_basic.test @@ -0,0 +1,81 @@ +# +# binlog_skip_flush_commands +# + +--source include/have_perfschema.inc + +SET @start_global_value = @@global.binlog_skip_flush_commands; +SELECT @start_global_value; + +# +# exists as global only +# + +# valid values are 'ON' and 'OFF' +SELECT @@global.binlog_skip_flush_commands IN (0, 1); +SELECT @@global.binlog_skip_flush_commands; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.binlog_skip_flush_commands; +SHOW GLOBAL VARIABLES LIKE 'binlog_skip_flush_commands'; +SHOW SESSION VARIABLES LIKE 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +# +# show that it's writable +# +SET GLOBAL binlog_skip_flush_commands = ON; +SELECT @@global.binlog_skip_flush_commands; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +SET GLOBAL binlog_skip_flush_commands = OFF; +SELECT @@global.binlog_skip_flush_commands; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +SET GLOBAL binlog_skip_flush_commands = 'ON'; +SELECT @@global.binlog_skip_flush_commands; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +SET GLOBAL binlog_skip_flush_commands = 'OFF'; +SELECT @@global.binlog_skip_flush_commands; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +SET GLOBAL binlog_skip_flush_commands = 1; +SELECT @@global.binlog_skip_flush_commands; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +SET GLOBAL binlog_skip_flush_commands = 0; +SELECT @@global.binlog_skip_flush_commands; +SELECT * FROM performance_schema.global_variables WHERE variable_name = 'binlog_skip_flush_commands'; +SELECT * FROM performance_schema.session_variables WHERE variable_name = 'binlog_skip_flush_commands'; + +--error ER_GLOBAL_VARIABLE +SET SESSION binlog_skip_flush_commands = 'OFF'; +--error ER_GLOBAL_VARIABLE +SET @@session.binlog_skip_flush_commands = 'ON'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL binlog_skip_flush_commands = 1.1; +--error ER_WRONG_TYPE_FOR_VAR +SET GLOBAL binlog_skip_flush_commands = 1e1; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL binlog_skip_flush_commands = 2; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL binlog_skip_flush_commands = -3; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL binlog_skip_flush_commands = 'AUTO'; + +# +# cleanup +# + +SET GLOBAL binlog_skip_flush_commands = @start_global_value; +SELECT @@global.binlog_skip_flush_commands; diff --git a/rapid/plugin/group_replication/tests/mtr/r/gr_recovery_slave_commands.result b/rapid/plugin/group_replication/tests/mtr/r/gr_recovery_slave_commands.result index ab58e61485f1..bc4461e8aa8e 100644 --- a/rapid/plugin/group_replication/tests/mtr/r/gr_recovery_slave_commands.result +++ b/rapid/plugin/group_replication/tests/mtr/r/gr_recovery_slave_commands.result @@ -174,9 +174,11 @@ include/assert.inc [recovery channel is active] # SHOW RELAYLOG EVENTS - Relay log files should exists include/assert.inc [Relay log name should not be empty as the command successfully executed.] -# ERROR when executing FLUSH RELAY LOGS on GR recovery channel +# Executing FLUSH RELAY LOGS on GR recovery channel. +# In contrast to Oracle MySQL Server this command does not return +# ER_RUN_HOOK_ERROR as it is executed under super_read_only = ON and +# therefore is not written to the binary log. FLUSH RELAY LOGS FOR CHANNEL 'group_replication_recovery'; -ERROR HY000: Error on observer while running replication hook 'before_commit'. # RESET SLAVE command is blocked only when recovery channel is active. RESET SLAVE FOR CHANNEL "group_replication_recovery"; diff --git a/rapid/plugin/group_replication/tests/mtr/t/gr_recovery_slave_commands.test b/rapid/plugin/group_replication/tests/mtr/t/gr_recovery_slave_commands.test index 7f36e44f3cb9..90f4de38e480 100644 --- a/rapid/plugin/group_replication/tests/mtr/t/gr_recovery_slave_commands.test +++ b/rapid/plugin/group_replication/tests/mtr/t/gr_recovery_slave_commands.test @@ -316,8 +316,10 @@ START SLAVE SQL_THREAD UNTIL RELAY_LOG_FILE = 'server-relay-log-group_replicatio # Bug#23575646 : FLUSH RELAY LOGS SHOULD HIT ERROR 3139 WHEN SERVER STATE IS RECOVERING --echo ---echo # ERROR when executing FLUSH RELAY LOGS on GR recovery channel ---error ER_RUN_HOOK_ERROR +--echo # Executing FLUSH RELAY LOGS on GR recovery channel. +--echo # In contrast to Oracle MySQL Server this command does not return +--echo # ER_RUN_HOOK_ERROR as it is executed under super_read_only = ON and +--echo # therefore is not written to the binary log. FLUSH RELAY LOGS FOR CHANNEL 'group_replication_recovery'; --echo diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fe2f1f972dca..2d6abbb13654 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -446,6 +446,7 @@ const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS}; my_bool binlog_gtid_simple_recovery; ulong binlog_error_action; const char *binlog_error_action_list[]= {"IGNORE_ERROR", "ABORT_SERVER", NullS}; +my_bool opt_binlog_skip_flush_commands= 0; uint32 gtid_executed_compression_period= 0; my_bool opt_log_unsafe_statements; diff --git a/sql/mysqld.h b/sql/mysqld.h index cb4c0893ce1f..af7ee91a2ac0 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -285,6 +285,7 @@ enum enum_binlog_error_action ABORT_SERVER= 1 }; extern const char *binlog_error_action_list[]; +extern my_bool opt_binlog_skip_flush_commands; extern ulong stored_program_cache_size; extern ulong back_log; diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 74c2e1e6add4..75bc52fbc101 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -396,7 +396,39 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, } } if (*write_to_binlog != -1) - *write_to_binlog= tmp_write_to_binlog; + { + if (thd == NULL || thd->security_context() == NULL) + { + *write_to_binlog= + opt_binlog_skip_flush_commands ? 0 : tmp_write_to_binlog; + } + else if (thd->security_context()->check_access(SUPER_ACL)) + { + /* + For users with 'SUPER' privilege 'FLUSH XXX' statements must not be + binlogged if 'super_read_only' is set to 'ON'. + */ + if (opt_super_readonly) + *write_to_binlog= 0; + else + *write_to_binlog= + opt_binlog_skip_flush_commands ? 0 : tmp_write_to_binlog; + } + else + { + /* + For users without 'SUPER' privilege 'FLUSH XXX' statements must not be + binlogged if 'read_only' or 'super_read_only' is set to 'ON'. + Checking only 'opt_readonly' here as in 'super_read_only' mode this + variable is implicitly set to 'true'. + */ + if (opt_readonly) + *write_to_binlog= 0; + else + *write_to_binlog= + opt_binlog_skip_flush_commands ? 0 : tmp_write_to_binlog; + } + } /* If the query was killed then this function must fail. */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index ae29f598e901..198179f9bccc 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2006,6 +2006,13 @@ static Sys_var_enum Sys_binlog_error_action( "continue, or abort.", GLOBAL_VAR(binlog_error_action), CMD_LINE(REQUIRED_ARG), binlog_error_action_list, DEFAULT(ABORT_SERVER)); +static Sys_var_mybool Sys_binlog_skip_flush_commands( + "binlog_skip_flush_commands", + "If set to TRUE, FLUSH commands will not be be written " + "to the binary log", + GLOBAL_VAR(opt_binlog_skip_flush_commands), + CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + static Sys_var_mybool Sys_trust_function_creators( "log_bin_trust_function_creators", "If set to FALSE (the default), then when --log-bin is used, creation " From 5ef160c4d985dee4bd02bcbd59831ba8c0e0ee72 Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Tue, 12 Feb 2019 16:11:06 +0200 Subject: [PATCH 213/214] [PS-5317] fix for ubuntu --- build-ps/ubuntu/control | 1 + 1 file changed, 1 insertion(+) diff --git a/build-ps/ubuntu/control b/build-ps/ubuntu/control index e5f83c637b52..9b990dba7e3c 100644 --- a/build-ps/ubuntu/control +++ b/build-ps/ubuntu/control @@ -176,6 +176,7 @@ Package: percona-server-server-5.7 Architecture: any Pre-Depends: percona-server-common-5.7 (= ${binary:Version}), adduser, + libcurl4-openssl-dev, debconf (>= 0.2.17) Depends: percona-server-client-5.7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, From f8bdd7949db6355b0bdb7f2614d56b40f974229a Mon Sep 17 00:00:00 2001 From: Evgeniy Patlan Date: Mon, 18 Feb 2019 08:08:31 +0200 Subject: [PATCH 214/214] [PS-5317] Revert changes for libcurl dependency --- build-ps/debian/control | 1 - build-ps/ubuntu/control | 1 - 2 files changed, 2 deletions(-) diff --git a/build-ps/debian/control b/build-ps/debian/control index 086daedc239e..a810e557d662 100644 --- a/build-ps/debian/control +++ b/build-ps/debian/control @@ -175,7 +175,6 @@ Package: percona-server-server-5.7 Architecture: any Pre-Depends: percona-server-common-5.7 (= ${binary:Version}), adduser, - libcurl4-openssl-dev, debconf (>= 0.2.17) Depends: percona-server-client-5.7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, diff --git a/build-ps/ubuntu/control b/build-ps/ubuntu/control index 9b990dba7e3c..e5f83c637b52 100644 --- a/build-ps/ubuntu/control +++ b/build-ps/ubuntu/control @@ -176,7 +176,6 @@ Package: percona-server-server-5.7 Architecture: any Pre-Depends: percona-server-common-5.7 (= ${binary:Version}), adduser, - libcurl4-openssl-dev, debconf (>= 0.2.17) Depends: percona-server-client-5.7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends},