From b55066a8b995a6175f7d179ed34a70c7070a64e0 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 7 Jun 2021 11:23:35 +0200 Subject: [PATCH 01/36] Raise version number after cloning 5.6.53 Approved-by: Bjorn Munch --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c31923fad8c1..3dab3ef19076 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=6 -MYSQL_VERSION_PATCH=53 +MYSQL_VERSION_PATCH=54 MYSQL_VERSION_EXTRA= From dc99b11abb3212c9a8426f7f9655edc4e2e4762c Mon Sep 17 00:00:00 2001 From: Priyanka Sangam Date: Mon, 7 Jun 2021 16:53:47 +0530 Subject: [PATCH 02/36] Bug #32919524 CONTRIBUTION: BACKPORT BUG#28949700: SUBOPTIMAL USE OF STRING::RESERVE() IN ... Contributed by Annirudh Prasad Backport of BUG#28949700 SUBOPTIMAL USE OF STRING::RESERVE() IN WRAPPER_TO_STRING(). The one-argument version of String::reserve() increases the capacity of the String object linearly and causes a high number of memory allocations when converting certain JSON documents to text representation. This patch changes wrapper_to_string() so that it uses the two-argument version of String::reserve() instead, which enables exponential increase of the capacity and reduces the number of memory allocations. The patch includes some additional small improvements to make the conversion from JSON to text go faster: - When appending a string literal, provide the length as an argument to avoid calls to strlen(). - When appending two-character string literals, instead append the two characters individually (append(char) is inlined, append(const char *, size_t) is not). Change-Id: I5ee36791d07c6525918b2ae0e5919ce47f05404e --- sql/json_dom.cc | 51 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/sql/json_dom.cc b/sql/json_dom.cc index 9b502ab53948..f3e67ce680d0 100644 --- a/sql/json_dom.cc +++ b/sql/json_dom.cc @@ -1570,6 +1570,17 @@ void Json_array::clear() delete_container_pointers(m_v); } +/** + Reserve space in a string buffer. If reallocation is needed, + increase the size of the buffer exponentially. + @param buffer the string buffer + @param needed the number of bytes needed + @return true on error, false on success +*/ +static bool reserve(String *buffer, size_t needed) +{ + return buffer->reserve(needed, buffer->length()); +} /** Perform quoting on a JSON string to make an external representation @@ -1605,8 +1616,8 @@ void Json_array::clear() */ bool double_quote(const char *cptr, size_t length, String *buf) { - if (buf->append('"')) - return true; /* purecov: inspected */ + if (reserve(buf, length + 2) || buf->append('"')) + return true; /* purecov: inspected */ for (size_t i= 0; i < length; i++) { @@ -2004,6 +2015,19 @@ static bool newline_and_indent(String *buffer, size_t level) buffer->fill(buffer->length() + level * 2, ' '); } +/** + Append a comma to separate elements in JSON arrays and objects. + @param buffer the string buffer + @param pretty true if pretty printing is enabled + @return true on error, false on success +*/ +static bool append_comma(String *buffer, bool pretty) +{ + // Append a comma followed by a blank space. If pretty printing is + // enabled, a newline will be added in front of the next element, so + // the blank space can be omitted. + return buffer->append(',') || (!pretty && buffer->append(' ')); +} /** Helper function which does all the heavy lifting for @@ -2037,7 +2061,7 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, case Json_dom::J_TIMESTAMP: { // Make sure the buffer has space for the datetime and the quotes. - if (buffer->reserve(MAX_DATE_STRING_REP_LENGTH + 2)) + if (reserve(buffer, MAX_DATE_STRING_REP_LENGTH + 2)) return true; /* purecov: inspected */ MYSQL_TIME t; wr.get_datetime(&t); @@ -2058,7 +2082,7 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, size_t array_len= wr.length(); for (uint32 i= 0; i < array_len; ++i) { - if (i > 0 && buffer->append(pretty ? "," : ", ")) + if (i > 0 && append_comma(buffer, pretty)) return true; /* purecov: inspected */ if (pretty && newline_and_indent(buffer, depth)) @@ -2077,14 +2101,14 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, break; } case Json_dom::J_BOOLEAN: - if (buffer->append(wr.get_boolean() ? "true" : "false")) + if (wr.get_boolean() ? buffer->append(STRING_WITH_LEN("true")) + : buffer->append(STRING_WITH_LEN("false"))) return true; /* purecov: inspected */ break; case Json_dom::J_DECIMAL: { int length= DECIMAL_MAX_STR_LENGTH + 1; - if (buffer->reserve(length)) - return true; /* purecov: inspected */ + if (reserve(buffer, length)) return true; char *ptr= const_cast(buffer->ptr()) + buffer->length(); my_decimal m; if (wr.get_decimal_data(&m) || @@ -2095,7 +2119,7 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, } case Json_dom::J_DOUBLE: { - if (buffer->reserve(MY_GCVT_MAX_FIELD_WIDTH + 1)) + if (reserve(buffer, MY_GCVT_MAX_FIELD_WIDTH + 1)) return true; /* purecov: inspected */ double d= wr.get_double(); size_t len= my_gcvt(d, MY_GCVT_ARG_DOUBLE, MY_GCVT_MAX_FIELD_WIDTH, @@ -2111,7 +2135,7 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, break; } case Json_dom::J_NULL: - if (buffer->append("null")) + if (buffer->append(STRING_WITH_LEN("null"))) return true; /* purecov: inspected */ break; case Json_dom::J_OBJECT: @@ -2123,7 +2147,7 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, for (Json_wrapper_object_iterator iter= wr.object_iterator(); !iter.empty(); iter.next()) { - if (!first && buffer->append(pretty ? "," : ", ")) + if (!first && append_comma(buffer, pretty)) return true; /* purecov: inspected */ first= false; @@ -2135,7 +2159,7 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, const char *key_data= key.c_str(); size_t key_length= key.length(); if (print_string(buffer, true, key_data, key_length) || - buffer->append(": ") || + buffer->append(':') || buffer->append(' ') || wrapper_to_string(iter.elt().second, buffer, true, pretty, func_name, depth)) return true; /* purecov: inspected */ @@ -2154,7 +2178,6 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, if (wr.get_data_length() > base64_encode_max_arg_length()) { /* purecov: begin inspected */ - buffer->append("\"\""); my_error(ER_INTERNAL_ERROR, MYF(0), "JSON: could not decode opaque data"); return true; @@ -2165,14 +2188,14 @@ static bool wrapper_to_string(const Json_wrapper &wr, String *buffer, static_cast(base64_needed_encoded_length(wr.get_data_length())); if (single_quote(buffer, json_quoted) || - buffer->append("base64:type") || + buffer->append(STRING_WITH_LEN("base64:type")) || buffer->append_ulonglong(wr.field_type()) || buffer->append(':')) return true; /* purecov: inspected */ // "base64:typeXX:" size_t pos= buffer->length(); - if (buffer->reserve(needed) || + if (reserve(buffer, needed) || base64_encode(wr.get_data(), wr.get_data_length(), const_cast(buffer->ptr() + pos))) return true; /* purecov: inspected */ From 31b885e1b0ebdc87649872329e5dea3a20d22405 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 3 Mar 2021 11:07:59 +0400 Subject: [PATCH 03/36] From 87ee2a189cb6f6e7d5edd1b6a2daf0e52eb4ba96 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 9 Jun 2021 23:40:23 +0200 Subject: [PATCH 04/36] From 04d15393316f602ff3f7d486f19bf610a3974909 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 14 Jun 2021 17:10:52 +0200 Subject: [PATCH 05/36] Bug #32998981 JSON-DOM-T BROKEN 5.7 BUILD WITH GCC 8.4.1 After upgrading to gcc 8.4.1 on el8 we hit an internal compiler error: In file included from unittest/gunit/merge_large_tests.cc:20: unittest/gunit/json_dom-t.cc: In member function virtual void json_dom_unittest::JsonDomTest_BasicTest_Test::TestBody(): unittest/gunit/json_dom-t.cc:392:33: internal compiler error: in pop_local_binding, at cp/name-lookup.c:2047 EXPECT_EQ(null_dom, dom.get()); The fix is to split the BasidTest in two. Change-Id: I57f8c71d954a1015272bd63301e1eb4ab73694f7 --- unittest/gunit/json_dom-t.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unittest/gunit/json_dom-t.cc b/unittest/gunit/json_dom-t.cc index 5bacd26276de..afc5ab0bc5ac 100644 --- a/unittest/gunit/json_dom-t.cc +++ b/unittest/gunit/json_dom-t.cc @@ -258,7 +258,11 @@ TEST_F(JsonDomTest, BasicTest) std::auto_ptr c(a.clone()); EXPECT_EQ(std::string("[null, false, true]"), format(a)); EXPECT_EQ(std::string("[null, false, true]"), format(c.get())); +} +TEST_F(JsonDomTest, BasicTestTwo) +{ + Json_array a; /* DATETIME scalar */ MYSQL_TIME dt; std::memset(&dt, 0, sizeof dt); @@ -366,7 +370,7 @@ TEST_F(JsonDomTest, BasicTest) EXPECT_TRUE(dom.get() != NULL); const Json_object *obj= down_cast(dom.get()); EXPECT_EQ(8U, obj->cardinality()); - idx= 0; + int idx= 0; for (Json_object::const_iterator it= obj->begin(); it != obj->end(); ++it) { From 32c4498b42bd391a1a34488daa8489450330059d Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 29 Jun 2021 17:05:49 +0200 Subject: [PATCH 06/36] BUG#31761802 STATISTICS ANY QUERIES USING VIEWS ARE SUMMARIZED TOGETHER WITH THE VIEW DEFINITION SELECT This patch is for 5.7 only, backport of 8.0 fix. Problem: ======== Assuming a view defined as: (a) CREATE VIEW v1 AS SELECT * from t1; And assuming a query like: (b1) SELECT col_a, col_b FROM v1; (b2) SELECT col_c FROM v1 where ...; The query digest computed for the queries (b1), (b2) is based on the view definition (a), instead of the query (b1), (b2). This is a problem, because: - several different queries using the same view are all computed with the same digest, and all aggregated together in table performance_schema.events_statements_summary_by_digest. - this makes statistics in events_statements_summary_by_digest useless when a view is involved. Root cause: =========== When executing a query like (b1), the parser is invoked, tokens from the query ('SELECT', 'col_a', ...) are recorded in the query digest, and a digest is computed. So far the result is correct and as expected. But later during the statement execution, the server opens the view definition (a), and makes another call to the parser, to find out how to open the view itself. This nested call computes a statement digest again, this time based on the view definition, and this digest is recorded with the top level query. The final result is that the query digest is computed correctly, then overridden with something irrelevant, causing the bug. Solution: ========= Added a new attribute in the parser: bool Parser_input::m_has_digest to clarify when a digest is to be computed. Make sure in parse_view_definition() to not compute digest when invoking the parser on the view definition. Consequences: ============= Before this fix, queries (b1) and (b2) had the same digest, and were considered to be the "same" query. After this fix, the digests of (b1) and (b2) are different, and they no longer collide into the same value. Other tools that rely on query digests, such as: - the query rewrite plugin - the firewall plugin will now see (b1) and (b2) as different queries, which is the correct result. Existing rules for the query rewrite plugin and the firewall plugin will need to be updated to treat (b1) and (b2) correctly. Approved by: Chris Powers --- .../suite/perfschema/r/digest_view.result | 144 ++++++++++++++++++ .../suite/perfschema/t/digest_view.test | 75 +++++++++ sql/log_event.cc | 1 + sql/parser_service.cc | 1 + sql/sql_lex.h | 17 ++- sql/sql_parse.cc | 43 ++++-- sql/sql_prepare.cc | 2 + sql/sql_view.cc | 5 +- 8 files changed, 270 insertions(+), 18 deletions(-) create mode 100644 mysql-test/suite/perfschema/r/digest_view.result create mode 100644 mysql-test/suite/perfschema/t/digest_view.test diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result new file mode 100644 index 000000000000..7942b7d3c853 --- /dev/null +++ b/mysql-test/suite/perfschema/r/digest_view.result @@ -0,0 +1,144 @@ +CREATE TABLE test.v1 (a int, b int); +INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300); +CREATE TABLE test.t1 (a int, b int); +INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300); +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; +EXPLAIN SELECT * from test.v1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE v1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` +EXPLAIN SELECT * from test.v1 where a = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE v1 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where (`test`.`v1`.`a` = 1) +EXPLAIN SELECT * from test.v1 where b > 100; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE v1 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where (`test`.`v1`.`b` > 100) +EXPLAIN SELECT a, b from test.v1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE v1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` +EXPLAIN SELECT b, a from test.v1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE v1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`v1`.`b` AS `b`,`test`.`v1`.`a` AS `a` from `test`.`v1` +SELECT * from test.v1; +a b +1 100 +2 200 +3 300 +SELECT * from test.v1 where a = 1; +a b +1 100 +SELECT * from test.v1 where b > 100; +a b +2 200 +3 300 +SELECT a, b from test.v1; +a b +1 100 +2 200 +3 300 +SELECT b, a from test.v1; +b a +100 1 +200 2 +300 3 +# +# DIGESTS SEEN ON TABLE +# +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR +FROM performance_schema.events_statements_summary_by_digest +ORDER BY DIGEST_TEXT; +SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR +test faacd4387467f00e5471f3620f0053ee EXPLAIN SELECT * FROM `test` . `v1` 1 +test 75f55ccb0b365eefb51cc8f1f1d81132 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1 +test f13826a4cdfdfc626f2f338744c9c746 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1 +test 4204f1e3809aca8633c27c32603bcf6d EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1 +test fff8925d7c4be86c0c3da7a26c60750e EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1 +test a8465e96fae9df6be0af2b0bcaff9548 SELECT * FROM `test` . `v1` 1 +test 90d5479e3ca1cbf7113b3b3abc96f1ff SELECT * FROM `test` . `v1` WHERE `a` = ? 1 +test b660099c975325cd338eb80b2849bd61 SELECT * FROM `test` . `v1` WHERE `b` > ? 1 +test 9b459b7b8ce957d816066ba4ee0289f9 SELECT `a` , `b` FROM `test` . `v1` 1 +test 1c037a199783a415ae1ff2361459f1de SELECT `b` , `a` FROM `test` . `v1` 1 +test feaff321c54a9c8e1e9508628f7a5a05 SHOW WARNINGS 5 +test d24da32343f2b799f8a7ba1bdc45f83b TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 +DROP TABLE test.v1; +CREATE VIEW test.v1 AS SELECT * FROM test.t1; +EXPLAIN SELECT * from test.v1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` +EXPLAIN SELECT * from test.v1 where a = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` = 1) +EXPLAIN SELECT * from test.v1 where b > 100; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 33.33 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` > 100) +EXPLAIN SELECT a, b from test.v1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` +EXPLAIN SELECT b, a from test.v1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` +SELECT * from test.v1; +a b +1 100 +2 200 +3 300 +SELECT * from test.v1 where a = 1; +a b +1 100 +SELECT * from test.v1 where b > 100; +a b +2 200 +3 300 +SELECT a, b from test.v1; +a b +1 100 +2 200 +3 300 +SELECT b, a from test.v1; +b a +100 1 +200 2 +300 3 +# +# DIGESTS SEEN ON VIEW +# +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR +FROM performance_schema.events_statements_summary_by_digest +ORDER BY DIGEST_TEXT; +SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR +test 1462d84ad90aeabc6106da2a5ba38f17 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1 +test c909e770703c59c353ca199dfe4ca154 DROP TABLE `test` . `v1` 1 +test faacd4387467f00e5471f3620f0053ee EXPLAIN SELECT * FROM `test` . `v1` 2 +test 75f55ccb0b365eefb51cc8f1f1d81132 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2 +test f13826a4cdfdfc626f2f338744c9c746 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2 +test 4204f1e3809aca8633c27c32603bcf6d EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2 +test fff8925d7c4be86c0c3da7a26c60750e EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2 +test a8465e96fae9df6be0af2b0bcaff9548 SELECT * FROM `test` . `v1` 2 +test 90d5479e3ca1cbf7113b3b3abc96f1ff SELECT * FROM `test` . `v1` WHERE `a` = ? 2 +test b660099c975325cd338eb80b2849bd61 SELECT * FROM `test` . `v1` WHERE `b` > ? 2 +test f26fa367559d55cac36428d5ebd1d511 SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1 +test 9b459b7b8ce957d816066ba4ee0289f9 SELECT `a` , `b` FROM `test` . `v1` 2 +test 1c037a199783a415ae1ff2361459f1de SELECT `b` , `a` FROM `test` . `v1` 2 +test feaff321c54a9c8e1e9508628f7a5a05 SHOW WARNINGS 10 +test d24da32343f2b799f8a7ba1bdc45f83b TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 +DROP VIEW test.v1; +DROP TABLE test.t1; diff --git a/mysql-test/suite/perfschema/t/digest_view.test b/mysql-test/suite/perfschema/t/digest_view.test new file mode 100644 index 000000000000..1cdee302187b --- /dev/null +++ b/mysql-test/suite/perfschema/t/digest_view.test @@ -0,0 +1,75 @@ +# ---------------------------------------------------- +# Tests for the performance schema statement Digests. +# ---------------------------------------------------- + +# Test case to show behavior of statements digest when +# using a view + +# Test requires: sp-protocol/ps-protocol/view-protocol/cursor-protocol disabled +--source include/no_protocol.inc + +CREATE TABLE test.v1 (a int, b int); +INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300); + +CREATE TABLE test.t1 (a int, b int); +INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300); + + +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; + +# +# test.v1 is a table. +# Every query here is different, and should have a different digest. +# + +EXPLAIN SELECT * from test.v1; +EXPLAIN SELECT * from test.v1 where a = 1; +EXPLAIN SELECT * from test.v1 where b > 100; +EXPLAIN SELECT a, b from test.v1; +EXPLAIN SELECT b, a from test.v1; + +SELECT * from test.v1; +SELECT * from test.v1 where a = 1; +SELECT * from test.v1 where b > 100; +SELECT a, b from test.v1; +SELECT b, a from test.v1; + +--echo # +--echo # DIGESTS SEEN ON TABLE +--echo # + +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest + ORDER BY DIGEST_TEXT; + +DROP TABLE test.v1; +CREATE VIEW test.v1 AS SELECT * FROM test.t1; + +# +# test.v1 is now a view. +# the query digests should be unchanged. +# + +EXPLAIN SELECT * from test.v1; +EXPLAIN SELECT * from test.v1 where a = 1; +EXPLAIN SELECT * from test.v1 where b > 100; +EXPLAIN SELECT a, b from test.v1; +EXPLAIN SELECT b, a from test.v1; + +SELECT * from test.v1; +SELECT * from test.v1 where a = 1; +SELECT * from test.v1 where b > 100; +SELECT a, b from test.v1; +SELECT b, a from test.v1; + +--echo # +--echo # DIGESTS SEEN ON VIEW +--echo # + +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest + ORDER BY DIGEST_TEXT; + +DROP VIEW test.v1; +DROP TABLE test.t1; + diff --git a/sql/log_event.cc b/sql/log_event.cc index 33c10f3a949a..ae187b2ce5a7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4772,6 +4772,7 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli, Parser_state parser_state; if (!parser_state.init(thd, thd->query().str, thd->query().length)) { + parser_state.m_input.m_has_digest = true; assert(thd->m_digest == NULL); thd->m_digest= & thd->m_digest_state; assert(thd->m_statement_psi == NULL); diff --git a/sql/parser_service.cc b/sql/parser_service.cc index f12d21c1a098..0cfca78221de 100644 --- a/sql/parser_service.cc +++ b/sql/parser_service.cc @@ -275,6 +275,7 @@ int mysql_parser_parse(MYSQL_THD thd, const MYSQL_LEX_STRING query, if (parser_state.init(thd, query.str, query.length)) return 1; + parser_state.m_input.m_has_digest = true; parser_state.m_input.m_compute_digest= true; thd->m_digest= &thd->m_digest_state; thd->m_digest->reset(thd->m_token_array, max_digest_length); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index d61f286a987d..4daa9339e5f6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3634,10 +3634,25 @@ class Yacc_state */ struct Parser_input { + /** + True if the text parsed corresponds to an actual query, + and not another text artifact. + This flag is used to disable digest parsing of nested: + - view definitions + - table trigger definitions + - table partition definitions + - event scheduler event definitions + */ + bool m_has_digest; + /** + True if the caller needs to compute a digest. + This flag is used to request explicitly a digest computation, + independently of the performance schema configuration. + */ bool m_compute_digest; Parser_input() - : m_compute_digest(false) + : m_has_digest(false), m_compute_digest(false) {} }; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index feff5f4182bf..5144852473b4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1488,6 +1488,8 @@ bool dispatch_command(THD *thd, const COM_DATA *com_data, if (parser_state.init(thd, thd->query().str, thd->query().length)) break; + parser_state.m_input.m_has_digest = true; + mysql_parse(thd, &parser_state); while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) && @@ -7053,6 +7055,7 @@ extern int MYSQLparse(class THD *thd); // from sql_yacc.cc ... handle error } + parser_state.m_input.m_has_digest= true; parser_state.m_input.m_compute_digest= true; rc= parse_sql(the, &parser_state, ctx); @@ -7102,22 +7105,32 @@ bool parse_sql(THD *thd, parser_state->m_digest_psi= NULL; parser_state->m_lip.m_digest= NULL; - if (thd->m_digest != NULL) - { - /* Start Digest */ - parser_state->m_digest_psi= MYSQL_DIGEST_START(thd->m_statement_psi); - - if (parser_state->m_input.m_compute_digest || - (parser_state->m_digest_psi != NULL)) + /* + Only consider statements that are supposed to have a digest, + like top level queries. + */ + if (parser_state->m_input.m_has_digest) { + /* + For these statements, + see if the digest computation is required. + */ + if (thd->m_digest != NULL) { - /* - If either: - - the caller wants to compute a digest - - the performance schema wants to compute a digest - set the digest listener in the lexer. - */ - parser_state->m_lip.m_digest= thd->m_digest; - parser_state->m_lip.m_digest->m_digest_storage.m_charset_number= thd->charset()->number; + /* Start Digest */ + parser_state->m_digest_psi= MYSQL_DIGEST_START(thd->m_statement_psi); + + if (parser_state->m_input.m_compute_digest || + (parser_state->m_digest_psi != NULL)) + { + /* + If either: + - the caller wants to compute a digest + - the performance schema wants to compute a digest + set the digest listener in the lexer. + */ + parser_state->m_lip.m_digest= thd->m_digest; + parser_state->m_lip.m_digest->m_digest_storage.m_charset_number= thd->charset()->number; + } } } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 47ef8d48e69c..6fbb0cc94aef 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -3302,6 +3302,8 @@ bool Prepared_statement::prepare(const char *query_str, size_t query_length) digest.reset(token_array, max_digest_length); thd->m_digest= &digest; + parser_state.m_input.m_has_digest = true; + enable_digest_if_any_plugin_needs_it(thd, &parser_state); #ifndef EMBEDDED_LIBRARY if (is_audit_plugin_class_active(thd, MYSQL_AUDIT_GENERAL_CLASS)) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 839327597c20..254f2faa9be8 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1372,8 +1372,9 @@ bool parse_view_definition(THD *thd, TABLE_LIST *view_ref) thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES); - if (thd->m_digest != NULL) - thd->m_digest->reset(thd->m_token_array, max_digest_length); + // Do not pollute the current statement + // with a digest of the view definition + assert(! parser_state.m_input.m_has_digest); // Parse the query text of the view result= parse_sql(thd, &parser_state, view_ref->view_creation_ctx); From 72f34dff96f8a25e3d10aa00a02374b6f000201f Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Tue, 29 Jun 2021 20:44:44 +0200 Subject: [PATCH 07/36] From 7b90075ae3d382a671c939382725799ca651d5b2 Mon Sep 17 00:00:00 2001 From: Yasufumi Kinoshita Date: Fri, 2 Jul 2021 18:40:38 +0900 Subject: [PATCH 08/36] Bug#32771259: PAGE COMPRESSION OF INNODB TABLE IS IGNORED DURING RECOVERY PROCESS AND MIGHT NEVER SUCCESS WITH ENOSPC CRASH NEAR TO DISK-FULL space->compression_type is set only at open of the table with the dictionary. But during recovery process, the dictionary is not recovered yet also. The problem is all flushing pages dring recovery never compressed. (because space->compression_type is not set yet) And flushing causes increasing size of the .ibd file and more possibility to cause disk-full crash of the recovery process... We need to estimate space->compression_type. (Not 100% exact, but much better than always false) And it can be done with the second page (page_no:1) flag, when get_file_size reads page_no:0. Not to increase IO opportunity, reads the page with header page (page_no:0) at Fil_shard::get_file_size() only if recv_recovery_is_on(). * This fix is the first-aid treatment. The true solution is recovered consistent flag in the DD at the time. RB: 26269 Reviewed-by: Debarun Banerjee --- storage/innobase/fil/fil0fil.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 9396b0488bf1..511406854b4c 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -768,7 +768,10 @@ fil_node_open_file( /* Read the first page of the tablespace */ - buf2 = static_cast(ut_malloc_nokey(2 * UNIV_PAGE_SIZE)); + const ulint buf2_size = recv_recovery_is_on() + ? (2 * UNIV_PAGE_SIZE) : UNIV_PAGE_SIZE; + buf2 = static_cast( + ut_malloc_nokey(buf2_size + UNIV_PAGE_SIZE)); /* Align the memory for file i/o if we might have O_DIRECT set */ @@ -778,8 +781,7 @@ fil_node_open_file( IORequest request(IORequest::READ); success = os_file_read( - request, - node->handle, page, 0, UNIV_PAGE_SIZE); + request, node->handle, page, 0, buf2_size); space_id = fsp_header_get_space_id(page); flags = fsp_header_get_flags(page); @@ -842,6 +844,20 @@ fil_node_open_file( space->size_in_header = size; space->free_limit = free_limit; space->free_len = free_len; + + /* Set estimated value for space->compression_type + during recovery process. */ + if (recv_recovery_is_on() + && (Compression::is_compressed_page( + page + page_size.physical()) + || Compression::is_compressed_encrypted_page( + page + page_size.physical()))) { + ut_ad(buf2_size >= (2 * UNIV_PAGE_SIZE)); + Compression::meta_t header; + Compression::deserialize_header( + page + page_size.physical(), &header); + space->compression_type = header.m_algorithm; + } } ut_free(buf2); From bc9c46bf2894673d0df17cd0ee872d0d99663121 Mon Sep 17 00:00:00 2001 From: Sachin Agarwal Date: Mon, 5 Jul 2021 18:07:14 +0530 Subject: [PATCH 09/36] Bug #32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO INNODB TABLES WITH FTS INDEXES Problem: Concurrent INSERTs into the tables (with FTS index) causes huge number of FTS_SYNC requests are sent and rapid growth in memory usages. When concurrent inserts into single table, FTS_OPT thread get SYNC request when fts cache threshold is reached. In this case FTS_OPT thread fetches the SYNC request and performs FTS SYNC operation. When concurrent inserts into many tables, SYNC requests are sent for many tables. At a time, FTS_OPT thread can process one SYNC request. In the meantime, each INSERT into other table keeps sending SYNC request to FTS_OPT thread. Fix: 1. added a variable total_size_before_sync in fts cache to record total size of fts cache when SYNC request is sent. 2. next SYNC request is sent based on the delta fts cache size increment from last SYNC request. 3. reset total_size_before_sync when SYNC completes. RB: #26571 Reviewed by : Rahul Agarkar --- .../suite/innodb_fts/r/bug_32831765.result | 111 ++++++++++ .../suite/innodb_fts/t/bug_32831765.test | 196 ++++++++++++++++++ storage/innobase/fts/fts0fts.cc | 8 +- storage/innobase/fts/fts0opt.cc | 3 + storage/innobase/include/fts0types.h | 3 + storage/innobase/include/ut0wqueue.h | 8 + storage/innobase/ut/ut0wqueue.cc | 21 +- 7 files changed, 346 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/innodb_fts/r/bug_32831765.result create mode 100644 mysql-test/suite/innodb_fts/t/bug_32831765.test diff --git a/mysql-test/suite/innodb_fts/r/bug_32831765.result b/mysql-test/suite/innodb_fts/r/bug_32831765.result new file mode 100644 index 000000000000..6918888f337b --- /dev/null +++ b/mysql-test/suite/innodb_fts/r/bug_32831765.result @@ -0,0 +1,111 @@ +# +# Bug#32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO +# INNODB TABLES WITH FTS INDEXES +# +create table t1 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; +create table t2 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; +create table t3 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; +create table t4 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; +#create procedure to inset into the table. +CREATE PROCEDURE `proc_insert`(IN tab_name VARCHAR(40)) +BEGIN +DECLARE i INT DEFAULT 1; +SET @insert_tbl =CONCAT('INSERT INTO ', tab_name, '( `col01`, `col02`, + `col03`, `col04`, `col05`, `col06`, `col07`, `col08`, `col09`, `col10`, + `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`, + `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`, + `col27`, `col28`, `col29`, `col30`) + VALUES ( MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()))'); +PREPARE ins_stmt FROM @insert_tbl; +while (i <= 2000) DO +EXECUTE ins_stmt; +SET i = i + 1; +END WHILE; +DEALLOCATE PREPARE ins_stmt; +END | +call proc_insert('t1');; +call proc_insert('t1');; +call proc_insert('t2');; +call proc_insert('t2');; +call proc_insert('t3');; +call proc_insert('t3');; +call proc_insert('t4');; +call proc_insert('t4');; +SET GLOBAL DEBUG="+d,fts_optimize_wq_count_check"; +SET GLOBAL DEBUG="-d,fts_optimize_wq_count_check"; +# clean up +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +DROP PROCEDURE proc_insert; diff --git a/mysql-test/suite/innodb_fts/t/bug_32831765.test b/mysql-test/suite/innodb_fts/t/bug_32831765.test new file mode 100644 index 000000000000..76b593e55af8 --- /dev/null +++ b/mysql-test/suite/innodb_fts/t/bug_32831765.test @@ -0,0 +1,196 @@ +--echo # +--echo # Bug#32831765 SERVER HITS OOM CONDITION WHEN LOADING TWO +--echo # INNODB TABLES WITH FTS INDEXES +--echo # + +--source include/have_debug.inc + +create table t1 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; + +create table t2 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; + + +create table t3 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; + +create table t4 ( `id` int unsigned NOT NULL AUTO_INCREMENT, `col01` text, +`col02` text, `col03` text, `col04` text, `col05` text, `col06` text, `col07` +text, `col08` text, `col09` text, `col10` text, `col11` text, `col12` text, +`col13` text, `col14` text, `col15` text, `col16` text, `col17` text, `col18` +text, `col19` text, `col20` text, `col21` text, `col22` text, `col23` text, +`col24` text, `col25` text, `col26` text, `col27` text, `col28` text, `col29` +text, `col30` text, PRIMARY KEY (`id`), FULLTEXT KEY (`col01`), FULLTEXT KEY +(`col02`), FULLTEXT KEY (`col03`), FULLTEXT KEY (`col04`), FULLTEXT KEY +(`col05`), FULLTEXT KEY (`col06`), FULLTEXT KEY (`col07`), FULLTEXT KEY +(`col08`), FULLTEXT KEY (`col09`), FULLTEXT KEY (`col10`), FULLTEXT KEY +(`col11`), FULLTEXT KEY (`col12`), FULLTEXT KEY (`col13`), FULLTEXT KEY +(`col14`), FULLTEXT KEY (`col15`), FULLTEXT KEY (`col16`), FULLTEXT KEY +(`col17`), FULLTEXT KEY (`col18`), FULLTEXT KEY (`col19`), FULLTEXT KEY +(`col20`), FULLTEXT KEY (`col21`), FULLTEXT KEY (`col22`), FULLTEXT KEY +(`col23`), FULLTEXT KEY (`col24`), FULLTEXT KEY (`col25`), FULLTEXT KEY +(`col26`), FULLTEXT KEY (`col27`), FULLTEXT KEY (`col28`), FULLTEXT KEY +(`col29`), FULLTEXT KEY (`col30`)) engine=innodb; + +delimiter |; + +--echo #create procedure to inset into the table. +CREATE PROCEDURE `proc_insert`(IN tab_name VARCHAR(40)) +BEGIN + DECLARE i INT DEFAULT 1; + SET @insert_tbl =CONCAT('INSERT INTO ', tab_name, '( `col01`, `col02`, + `col03`, `col04`, `col05`, `col06`, `col07`, `col08`, `col09`, `col10`, + `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`, + `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`, + `col27`, `col28`, `col29`, `col30`) + VALUES ( MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), MD5(RAND()), + MD5(RAND()))'); + PREPARE ins_stmt FROM @insert_tbl; + while (i <= 2000) DO + EXECUTE ins_stmt; + SET i = i + 1; + END WHILE; + DEALLOCATE PREPARE ins_stmt; +END | + +delimiter ;| + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +connect (con3,localhost,root,,); +connect (con4,localhost,root,,); +connect (con5,localhost,root,,); +connect (con6,localhost,root,,); +connect (con7,localhost,root,,); +connect (con8,localhost,root,,); + +connection con1; +--send call proc_insert('t1'); + +connection con2; +--send call proc_insert('t1'); + +connection con3; +--send call proc_insert('t2'); + +connection con4; +--send call proc_insert('t2'); + +connection con5; +--send call proc_insert('t3'); + +connection con6; +--send call proc_insert('t3'); + +connection con7; +--send call proc_insert('t4'); + +connection con8; +--send call proc_insert('t4'); + +connection default; + +# Check if number of SYNC requests are more than 1000. +SET GLOBAL DEBUG="+d,fts_optimize_wq_count_check"; + +# Wait for 1 minute to make sure INSERTs into FTS table will trigger +# FTS_SYNC request +let $loop=60; +while($loop > 1) +{ + sleep 1; + dec $loop; +} + +SET GLOBAL DEBUG="-d,fts_optimize_wq_count_check"; + +connection con1; +reap; +disconnect con1; + +connection con2; +reap; +disconnect con2; + +connection con3; +reap; +disconnect con3; + +connection con4; +reap; +disconnect con4; + +connection con5; +reap; +disconnect con5; + +connection con6; +reap; +disconnect con6; + +connection con7; +reap; +disconnect con7; + +connection con8; +reap; +disconnect con8; + +connection default; +--echo # clean up +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +DROP PROCEDURE proc_insert; diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 02b64d8bc9f4..f2ebc3a8ebcb 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -579,6 +579,7 @@ fts_cache_init( cache->sync_heap->arg = mem_heap_create(1024); cache->total_size = 0; + cache->total_size_before_sync = 0; mutex_enter((ib_mutex_t*) &cache->deleted_lock); cache->deleted_doc_ids = ib_vector_create( @@ -3663,10 +3664,13 @@ fts_add_doc_by_id( doc_id, doc.tokens); bool need_sync = false; - if ((cache->total_size > fts_max_cache_size / 10 - || fts_need_sync) + if ((cache->total_size - + cache->total_size_before_sync > + fts_max_cache_size / 10 || fts_need_sync) && !cache->sync->in_progress) { need_sync = true; + cache->total_size_before_sync = + cache->total_size; } rw_lock_x_unlock(&table->fts->cache->lock); diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 31431c081e32..e013aff982c6 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -2644,6 +2644,9 @@ fts_optimize_request_sync_table( msg->ptr = table_id; ib_wqueue_add(fts_optimize_wq, msg, msg->heap); + DBUG_EXECUTE_IF("fts_optimize_wq_count_check", + if (ib_wqueue_get_count(fts_optimize_wq) > 1000) { + DBUG_SUICIDE(); }); } /**********************************************************************//** diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h index 3cbf231c0fb4..f33a7f91e194 100644 --- a/storage/innobase/include/fts0types.h +++ b/storage/innobase/include/fts0types.h @@ -172,6 +172,9 @@ struct fts_cache_t { ulint total_size; /*!< total size consumed by the ilist field of all nodes. SYNC is run whenever this gets too big */ + uint64_t total_size_before_sync; + /*!< total size of fts cache, when last SYNC request was sent */ + fts_sync_t* sync; /*!< sync structure to sync data to disk */ ib_alloc_t* sync_heap; /*!< The heap allocator, for indexes diff --git a/storage/innobase/include/ut0wqueue.h b/storage/innobase/include/ut0wqueue.h index 1ddb810c1fb3..152908e8cbc9 100644 --- a/storage/innobase/include/ut0wqueue.h +++ b/storage/innobase/include/ut0wqueue.h @@ -71,6 +71,14 @@ ib_wqueue_add( mem_heap_t* heap); /*!< in: memory heap to use for allocating the list node */ +/****************************************************************//** +read total number of work item to the queue. +@return total count of work item in the queue */ +uint64_t +ib_wqueue_get_count( +/*==========*/ + ib_wqueue_t *wq); /*!< in: work queue */ + /******************************************************************** Check if queue is empty. */ ibool diff --git a/storage/innobase/ut/ut0wqueue.cc b/storage/innobase/ut/ut0wqueue.cc index 06b73b89638f..ceb3ac59aada 100644 --- a/storage/innobase/ut/ut0wqueue.cc +++ b/storage/innobase/ut/ut0wqueue.cc @@ -39,6 +39,7 @@ Created 4/26/2006 Osku Salerma struct ib_wqueue_t { ib_mutex_t mutex; /*!< mutex protecting everything */ ib_list_t* items; /*!< work item list */ + uint64_t count; /*!< total number of work items */ os_event_t event; /*!< event we use to signal additions to list */ }; @@ -59,6 +60,7 @@ ib_wqueue_create(void) wq->items = ib_list_create(); wq->event = os_event_create(0); + wq->count = 0; return(wq); } @@ -90,6 +92,7 @@ ib_wqueue_add( mutex_enter(&wq->mutex); ib_list_add_last(wq->items, item, heap); + wq->count++; os_event_set(wq->event); mutex_exit(&wq->mutex); @@ -114,7 +117,7 @@ ib_wqueue_wait( if (node) { ib_list_remove(wq->items, node); - + wq->count--; if (!ib_list_get_first(wq->items)) { /* We must reset the event when the list gets emptied. */ @@ -132,6 +135,20 @@ ib_wqueue_wait( return(node->data); } +/******************************************************************** +read total number of work item to the queue. +@return total count of work item in the queue */ +uint64_t +ib_wqueue_get_count( +/*==========*/ + ib_wqueue_t *wq) /*!< in: work queue */ +{ + uint64_t count; + mutex_enter(&wq->mutex); + count = wq->count; + mutex_exit(&wq->mutex); + return count; +} /******************************************************************** Wait for a work item to appear in the queue for specified time. */ @@ -154,7 +171,7 @@ ib_wqueue_timedwait( if (node) { ib_list_remove(wq->items, node); - + wq->count--; mutex_exit(&wq->mutex); break; } From 65fb161740fad46ad8bc4ff328bebb54c3394bcc Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 6 Jul 2021 08:57:52 +0200 Subject: [PATCH 10/36] BUG#31761802 STATISTICS ANY QUERIES USING VIEWS ARE SUMMARIZED TOGETHER WITH THE VIEW DEFINITION SELECT Test cleanup for 5.7 embedded. Approved by: Chris Powers --- mysql-test/suite/perfschema/t/digest_view.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/perfschema/t/digest_view.test b/mysql-test/suite/perfschema/t/digest_view.test index 1cdee302187b..8e9632de622e 100644 --- a/mysql-test/suite/perfschema/t/digest_view.test +++ b/mysql-test/suite/perfschema/t/digest_view.test @@ -5,7 +5,8 @@ # Test case to show behavior of statements digest when # using a view -# Test requires: sp-protocol/ps-protocol/view-protocol/cursor-protocol disabled +--source include/not_embedded.inc +--source include/have_perfschema.inc --source include/no_protocol.inc CREATE TABLE test.v1 (a int, b int); From d7e5a188fecac3254eea38d5594004b99acd468d Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Mon, 19 Jul 2021 11:59:42 +0100 Subject: [PATCH 11/36] BUG#32965864 MULTI-THREADED UNSAFE ACCESS TO A FUNCTION LOCAL STATIC VARIABLE Description ----------- Both `MYSQL_BIN_LOG::report_missing_purged_gtids` and `MYSQL_BIN_LOG::report_missing_gtids` have an output parameter name `errmsg` that will, under given conditions, be instantiated with a non-thread-local function-local static variable reference. Invocation of both methods may occur from different threads execution stacks and concurrent changes to the static variable may occur. Side effects include threads logging an error message intended for other threads or a scrambled error message. Fix --- Use `std::string` as the output parameter type, instead of `const char**` and remove the `static` modifier from the function-local variable. Reviewed-by: Justin Jose Reviewed-by: Pedro Gomes RB: 26731 --- sql/binlog.cc | 66 +++++++++++++++++++++------------------- sql/binlog.h | 15 +++++---- sql/rpl_binlog_sender.cc | 18 +++++------ 3 files changed, 51 insertions(+), 48 deletions(-) diff --git a/sql/binlog.cc b/sql/binlog.cc index 4a127e731b01..1073e7eb9787 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -4484,7 +4484,7 @@ read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, const Gtid_set *gtid_set, Gtid *first_gtid, - const char **errmsg) + std::string &errmsg) { DBUG_ENTER("MYSQL_BIN_LOG::gtid_read_start_binlog"); /* @@ -4507,18 +4507,20 @@ bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, mysql_mutex_unlock(&LOCK_index); if (error != LOG_INFO_EOF) { - *errmsg= "Failed to read the binary log index file while " - "looking for the oldest binary log that contains any GTID " - "that is not in the given gtid set"; + errmsg.assign( + "Failed to read the binary log index file while " + "looking for the oldest binary log that contains any GTID " + "that is not in the given gtid set"); error= -1; goto end; } if (filename_list.empty()) { - *errmsg= "Could not find first log file name in binary log index file " - "while looking for the oldest binary log that contains any GTID " - "that is not in the given gtid set"; + errmsg.assign( + "Could not find first log file name in binary log index file " + "while looking for the oldest binary log that contains any GTID " + "that is not in the given gtid set"); error= -2; goto end; } @@ -4549,15 +4551,17 @@ bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, opt_master_verify_checksum, is_relay_log)) { case ERROR: - *errmsg= "Error reading header of binary log while looking for " - "the oldest binary log that contains any GTID that is not in " - "the given gtid set"; + errmsg.assign( + "Error reading header of binary log while looking for " + "the oldest binary log that contains any GTID that is not in " + "the given gtid set"); error= -3; goto end; case NO_GTIDS: - *errmsg= "Found old binary log without GTIDs while looking for " - "the oldest binary log that contains any GTID that is not in " - "the given gtid set"; + errmsg.assign( + "Found old binary log without GTIDs while looking for " + "the oldest binary log that contains any GTID that is not in " + "the given gtid set"); error= -4; goto end; case GOT_GTIDS: @@ -4588,7 +4592,7 @@ bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, end: if (error) - DBUG_PRINT("error", ("'%s'", *errmsg)); + DBUG_PRINT("error", ("'%s'", errmsg.c_str())); filename_list.clear(); DBUG_PRINT("info", ("returning %d", error)); DBUG_RETURN(error != 0 ? true : false); @@ -9952,8 +9956,8 @@ int MYSQL_BIN_LOG::recover(IO_CACHE *log, Format_description_log_event *fdle, return 1; } -void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_gtid_set, - const char** errmsg) +void MYSQL_BIN_LOG::report_missing_purged_gtids( + const Gtid_set *slave_executed_gtid_set, std::string &errmsg) { DBUG_ENTER("MYSQL_BIN_LOG::report_missing_purged_gtids"); THD *thd= current_thd; @@ -9975,8 +9979,8 @@ void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_g char* missing_gtids= NULL; char* slave_executed_gtids= NULL; - gtid_missing.to_string(&missing_gtids, NULL); - slave_executed_gtid_set->to_string(&slave_executed_gtids, NULL); + gtid_missing.to_string(&missing_gtids); + slave_executed_gtid_set->to_string(&slave_executed_gtids); /* Log the information about the missing purged GTIDs to the error log @@ -10011,11 +10015,11 @@ void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_g std::ostringstream gtid_info; gtid_info << "The GTID set sent by the slave is '" << slave_executed_gtids << "', and the missing transactions are '"<< missing_gtids <<"'"; - *errmsg= ER_THD(thd, ER_MASTER_HAS_PURGED_REQUIRED_GTIDS); + errmsg.assign(ER_THD(thd, ER_MASTER_HAS_PURGED_REQUIRED_GTIDS)); /* Don't consider the "%s" in the format string. Subtract 2 from the total length */ - total_length= (strlen(*errmsg) - 2 + gtid_info.str().length()); + total_length= (errmsg.length() - 2 + gtid_info.str().length()); DBUG_EXECUTE_IF("simulate_long_missing_gtids", { total_length= MYSQL_ERRMSG_SIZE + 1;}); @@ -10027,9 +10031,9 @@ void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_g " GTID_SUBTRACT"); /* Buffer for formatting the message about the missing GTIDs. */ - static char buff[MYSQL_ERRMSG_SIZE]; - my_snprintf(buff, MYSQL_ERRMSG_SIZE, *errmsg, gtid_info.str().c_str()); - *errmsg= const_cast(buff); + char buff[MYSQL_ERRMSG_SIZE]; + my_snprintf(buff, MYSQL_ERRMSG_SIZE, errmsg.c_str(), gtid_info.str().c_str()); + errmsg.assign(const_cast(buff)); my_free(missing_gtids); my_free(slave_executed_gtids); @@ -10038,7 +10042,7 @@ void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_g void MYSQL_BIN_LOG::report_missing_gtids(const Gtid_set* previous_gtid_set, const Gtid_set* slave_executed_gtid_set, - const char** errmsg) + std::string& errmsg) { DBUG_ENTER("MYSQL_BIN_LOG::report_missing_gtids"); THD *thd=current_thd; @@ -10047,8 +10051,8 @@ void MYSQL_BIN_LOG::report_missing_gtids(const Gtid_set* previous_gtid_set, Gtid_set gtid_missing(slave_executed_gtid_set->get_sid_map()); gtid_missing.add_gtid_set(slave_executed_gtid_set); gtid_missing.remove_gtid_set(previous_gtid_set); - gtid_missing.to_string(&missing_gtids, NULL); - slave_executed_gtid_set->to_string(&slave_executed_gtids, NULL); + gtid_missing.to_string(&missing_gtids); + slave_executed_gtid_set->to_string(&slave_executed_gtids); String tmp_uuid; uchar name[]= "slave_uuid"; @@ -10092,19 +10096,19 @@ void MYSQL_BIN_LOG::report_missing_gtids(const Gtid_set* previous_gtid_set, std::ostringstream gtid_info; gtid_info << "The GTID set sent by the slave is '" << slave_executed_gtids << "', and the missing transactions are '"<< missing_gtids <<"'"; - *errmsg= ER_THD(thd, ER_MASTER_HAS_PURGED_REQUIRED_GTIDS); + errmsg.assign(ER_THD(thd, ER_MASTER_HAS_PURGED_REQUIRED_GTIDS)); /* Don't consider the "%s" in the format string. Subtract 2 from the total length */ - if ((strlen(*errmsg) - 2 + gtid_info.str().length()) > MYSQL_ERRMSG_SIZE) + if ((errmsg.length() - 2 + gtid_info.str().length()) > MYSQL_ERRMSG_SIZE) gtid_info.str("The GTID sets and the missing purged transactions are too" " long to print in this message. For more information," " please see the master's error log or the manual for" " GTID_SUBTRACT"); /* Buffer for formatting the message about the missing GTIDs. */ - static char buff[MYSQL_ERRMSG_SIZE]; - my_snprintf(buff, MYSQL_ERRMSG_SIZE, *errmsg, gtid_info.str().c_str()); - *errmsg= const_cast(buff); + char buff[MYSQL_ERRMSG_SIZE]; + my_snprintf(buff, MYSQL_ERRMSG_SIZE, errmsg.c_str(), gtid_info.str().c_str()); + errmsg.assign(const_cast(buff)); my_free(missing_gtids); my_free(slave_executed_gtids); diff --git a/sql/binlog.h b/sql/binlog.h index e569d54baf56..5b30e20bf874 100644 --- a/sql/binlog.h +++ b/sql/binlog.h @@ -578,8 +578,7 @@ class MYSQL_BIN_LOG: public TC_LOG */ bool find_first_log_not_in_gtid_set(char *binlog_file_name, const Gtid_set *gtid_set, - Gtid *first_gtid, - const char **errmsg); + Gtid *first_gtid, std::string &errmsg); /** Reads the set of all GTIDs in the binary/relay log, and the set @@ -906,8 +905,8 @@ class MYSQL_BIN_LOG: public TC_LOG @return void */ - void report_missing_purged_gtids(const Gtid_set* slave_executed_gtid_set, - const char** errmsg); + void report_missing_purged_gtids(const Gtid_set *slave_executed_gtid_set, + std::string &errmsg); /** Function to report the missing GTIDs. @@ -931,10 +930,10 @@ class MYSQL_BIN_LOG: public TC_LOG @return void */ - void report_missing_gtids(const Gtid_set* previous_gtid_set, - const Gtid_set* slave_executed_gtid_set, - const char** errmsg); - static const int MAX_RETRIES_FOR_DELETE_RENAME_FAILURE = 5; + void report_missing_gtids(const Gtid_set *previous_gtid_set, + const Gtid_set *slave_executed_gtid_set, + std::string &errmsg); + static const int MAX_RETRIES_FOR_DELETE_RENAME_FAILURE= 5; /* It is called by the threads(e.g. dump thread) which want to read hot log without LOCK_log protection. diff --git a/sql/rpl_binlog_sender.cc b/sql/rpl_binlog_sender.cc index f1f0483f9339..ea7db604da14 100644 --- a/sql/rpl_binlog_sender.cc +++ b/sql/rpl_binlog_sender.cc @@ -836,7 +836,7 @@ int Binlog_sender::check_start_file() char *name_ptr= NULL; File file; IO_CACHE cache; - const char *errmsg; + std::string errmsg; my_off_t size; if (m_start_file[0] != '\0') @@ -880,9 +880,8 @@ int Binlog_sender::check_start_file() gtid_state->get_server_sidno(), subset_sidno)) { - errmsg= ER(ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER); global_sid_lock->unlock(); - set_fatal_error(errmsg); + set_fatal_error(ER(ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER)); return 1; } /* @@ -913,9 +912,9 @@ int Binlog_sender::check_start_file() */ if (!gtid_state->get_lost_gtids()->is_subset(m_exclude_gtid)) { - mysql_bin_log.report_missing_purged_gtids(m_exclude_gtid, &errmsg); + mysql_bin_log.report_missing_purged_gtids(m_exclude_gtid, errmsg); global_sid_lock->unlock(); - set_fatal_error(errmsg); + set_fatal_error(errmsg.c_str()); return 1; } global_sid_lock->unlock(); @@ -923,9 +922,9 @@ int Binlog_sender::check_start_file() if (mysql_bin_log.find_first_log_not_in_gtid_set(index_entry_name, m_exclude_gtid, &first_gtid, - &errmsg)) + errmsg)) { - set_fatal_error(errmsg); + set_fatal_error(errmsg.c_str()); return 1; } name_ptr= index_entry_name; @@ -965,9 +964,10 @@ int Binlog_sender::check_start_file() return 1; } - if ((file= open_binlog_file(&cache, m_linfo.log_file_name, &errmsg)) < 0) + const char *bl_errmsg= NULL; + if ((file= open_binlog_file(&cache, m_linfo.log_file_name, &bl_errmsg)) < 0) { - set_fatal_error(errmsg); + set_fatal_error(bl_errmsg); return 1; } From 3bc436203a600129fa41159df03b4c92dc3bff59 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Mon, 2 Aug 2021 14:36:14 +0530 Subject: [PATCH 12/36] Bug#32843447: GTID_PURGED IS GETTING EMPTY AND GTID_EXECUTED IS GETTING UPDATED AFTER RESTARTING MYSQL Description: The state of the server in regards to GTIDs is shared between the binary logs and the `mysql.gtid_executed` table and both are needed in different scenarios to keep the consistency of the state. Analysis: Issue in the reported case is the following: 1. The dump returned by `mysqldump` includes the `SET GTID_PURGED` set to the value of `GTID_EXECUTED` and the dropping of the `mysql` schema, in that order. 2. `RESET MASTER` clears the server state (GTID state included), meaning there are no binary logs. 3. The restore of the dump does the following, in the described order: a. Executes `SET GTID_PURGED`, which writes the GTID state to the `mysql.gtid_executed` table. b. It drops the `mysql` schema, which contains the `gtid_executed` table. Since the produced dump file doesn't restore the contents of the `mysql.gtid_executed` table, the changes in 3.a. get undone. Since there are no binary logs, the data added to `mysql.gtid_executed` was the only persisted value of the GTID state, at the point just after `SET GTID_PURGED` execution. Fix : The issue is fixed in 2 parts : 1. Added a new option, '--skip-mysql-schema', in mysqldump which when set should not allow mysql schema to be dropped. 2. Updated the sequence in which the `GTID_PURGED` is set in the dump file. RB#26690 --- client/client_priv.h | 1 + client/mysqldump.c | 144 +++++++++++-------- mysql-test/r/mysqldump_gtid_state.result | 72 ++++++++++ mysql-test/t/mysqldump_gtid_state-master.opt | 1 + mysql-test/t/mysqldump_gtid_state.test | 113 +++++++++++++++ 5 files changed, 268 insertions(+), 63 deletions(-) create mode 100644 mysql-test/r/mysqldump_gtid_state.result create mode 100644 mysql-test/t/mysqldump_gtid_state-master.opt create mode 100644 mysql-test/t/mysqldump_gtid_state.test diff --git a/client/client_priv.h b/client/client_priv.h index c75636a91d38..1ab052594a96 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -114,6 +114,7 @@ enum options_client OPT_CONNECTION_SERVER_ID, OPT_TLS_VERSION, OPT_SSL_MODE, + OPT_SKIP_MYSQL_SCHEMA, /* Add new option above this */ OPT_MAX_CLIENT_OPTION }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 187d95143d9c..42309647c8c4 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -120,7 +120,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_include_master_host_port= 0, opt_events= 0, opt_comments_used= 0, opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0, - opt_secure_auth= TRUE; + opt_skip_mysql_schema=0, opt_secure_auth= TRUE; static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*mysql=0; @@ -524,6 +524,9 @@ static struct my_option my_long_options[] = {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.", &opt_dump_date, &opt_dump_date, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"skip_mysql_schema", OPT_SKIP_MYSQL_SCHEMA, "Skip adding DROP DATABASE for mysql schema.", + &opt_skip_mysql_schema, &opt_skip_mysql_schema, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, + 0}, {"skip-opt", OPT_SKIP_OPTIMIZATION, "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -584,9 +587,9 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row, int string_value); static int dump_selected_tables(char *db, char **table_names, int tables); static int dump_all_tables_in_db(char *db); -static int init_dumping_views(char *); -static int init_dumping_tables(char *); -static int init_dumping(char *, int init_func(char*)); +static int init_dumping_views(char *, my_bool); +static int init_dumping_tables(char *, my_bool); +static int init_dumping(char *, int init_func(char*, my_bool)); static int dump_databases(char **); static int dump_all_databases(); static char *quote_name(const char *name, char *buff, my_bool force); @@ -4735,12 +4738,14 @@ View Specific database initalization. SYNOPSIS init_dumping_views qdatabase quoted name of the database + is_mysql_db TRUE if the db is mysql, else FALSE RETURN VALUES 0 Success. 1 Failure. */ -int init_dumping_views(char *qdatabase MY_ATTRIBUTE((unused))) +int init_dumping_views(char *qdatabase MY_ATTRIBUTE((unused)), + my_bool is_mysql_db MY_ATTRIBUTE((unused))) { return 0; } /* init_dumping_views */ @@ -4752,13 +4757,14 @@ Table Specific database initalization. SYNOPSIS init_dumping_tables qdatabase quoted name of the database + is_mysql_db TRUE if the db is mysql, else FALSE RETURN VALUES 0 Success. 1 Failure. */ -int init_dumping_tables(char *qdatabase) +int init_dumping_tables(char *qdatabase, my_bool is_mysql_db) { DBUG_ENTER("init_dumping_tables"); @@ -4775,7 +4781,7 @@ int init_dumping_tables(char *qdatabase) if (mysql_query(mysql, qbuf) || !(dbinfo = mysql_store_result(mysql))) { /* Old server version, dump generic CREATE DATABASE */ - if (opt_drop_database) + if (opt_drop_database && (!opt_skip_mysql_schema || !is_mysql_db)) fprintf(md_result_file, "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n", qdatabase); @@ -4785,7 +4791,7 @@ int init_dumping_tables(char *qdatabase) } else { - if (opt_drop_database) + if (opt_drop_database && (!opt_skip_mysql_schema || !is_mysql_db)) fprintf(md_result_file, "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n", qdatabase); @@ -4801,7 +4807,7 @@ int init_dumping_tables(char *qdatabase) } /* init_dumping_tables */ -static int init_dumping(char *database, int init_func(char*)) +static int init_dumping(char *database, int init_func(char*, my_bool)) { if (is_ndbinfo(mysql, database)) { @@ -4825,6 +4831,7 @@ static int init_dumping(char *database, int init_func(char*)) char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted); my_bool freemem= FALSE; char const* text= fix_identifier_with_newline(qdatabase, &freemem); + my_bool is_mysql_db= !my_strcasecmp(charset_info, database, "mysql"); print_comment(md_result_file, 0, "\n--\n-- Current Database: %s\n--\n", text); @@ -4832,7 +4839,7 @@ static int init_dumping(char *database, int init_func(char*)) my_free((void*)text); /* Call the view or table specific function */ - init_func(qdatabase); + init_func(qdatabase, is_mysql_db); fprintf(md_result_file,"\nUSE %s;\n", qdatabase); check_io(md_result_file); @@ -5839,24 +5846,20 @@ static int replace(DYNAMIC_STRING *ds_str, @note: md_result_file should have been opened, before this function is called. - - @param[in] flag If FALSE, disable binlog. - If TRUE and binlog disabled previously, - restore the session binlog. */ -static void set_session_binlog(my_bool flag) +static void set_session_binlog() { static my_bool is_binlog_disabled= FALSE; - if (!flag && !is_binlog_disabled) + if (!is_binlog_disabled) { fprintf(md_result_file, "SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;\n"); fprintf(md_result_file, "SET @@SESSION.SQL_LOG_BIN= 0;\n"); is_binlog_disabled= 1; } - else if (flag && is_binlog_disabled) + else { fprintf(md_result_file, "SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;\n"); @@ -5894,7 +5897,7 @@ static my_bool add_set_gtid_purged(MYSQL *mysql_con) { if (opt_comments) fprintf(md_result_file, - "\n--\n-- GTID state at the beginning of the backup \n--\n\n"); + "\n--\n-- GTID state at the end of the backup \n--\n\n"); fprintf(md_result_file,"SET @@GLOBAL.GTID_PURGED='"); @@ -5917,79 +5920,98 @@ static my_bool add_set_gtid_purged(MYSQL *mysql_con) /** This function processes the opt_set_gtid_purged option. - This function also calls set_session_binlog() function before - setting the SET @@GLOBAL.GTID_PURGED in the output. + This function when called with the flag as FALSE, just + disables the binlog by calling set_session_binlog(). + Later when this function is called with the flag as TRUE, + SET @@GLOBAL.GTID_PURGED is written in the output and the + session binlog is restored if disabled previously. @param[in] mysql_con the connection to the server + @param[in] flag If FALSE, just disable binlog and not + set the gtid purged as it will be set + at a later point of time. + If TRUE, set the gtid purged and + restore the session binlog if disabled + previously. @retval FALSE successful according to the value of opt_set_gtid_purged. @retval TRUE fail. */ -static my_bool process_set_gtid_purged(MYSQL* mysql_con) +static my_bool process_set_gtid_purged(MYSQL* mysql_con, my_bool flag) { - MYSQL_RES *gtid_mode_res; - MYSQL_ROW gtid_mode_row; - char *gtid_mode_val= 0; + MYSQL_RES *gtid_mode_res; + MYSQL_ROW gtid_mode_row; + char *gtid_mode_val= 0; + static int gtid_mode= -1; char buf[32], query[64]; if (opt_set_gtid_purged_mode == SET_GTID_PURGED_OFF) return FALSE; /* nothing to be done */ /* - Check if the server has the knowledge of GTIDs(pre mysql-5.6) - or if the gtid_mode is ON or OFF. + Set gtid_mode, by fetching gtid_mode from server, if its not + yet populated. gtid_mode is set to -1 if gtid_mode is not yet + fetched from the server. */ - my_snprintf(query, sizeof(query), "SHOW VARIABLES LIKE %s", - quote_for_like("gtid_mode", buf)); + if (gtid_mode < 0) + { + /* + Check if the server has the knowledge of GTIDs(pre mysql-5.6) + or if the gtid_mode is ON or OFF. + */ + my_snprintf(query, sizeof(query), "SHOW VARIABLES LIKE %s", + quote_for_like("gtid_mode", buf)); - if (mysql_query_with_error_report(mysql_con, >id_mode_res, query)) - return TRUE; + if (mysql_query_with_error_report(mysql_con, >id_mode_res, query)) + return TRUE; - gtid_mode_row = mysql_fetch_row(gtid_mode_res); + gtid_mode_row = mysql_fetch_row(gtid_mode_res); - /* - gtid_mode_row is NULL for pre 5.6 versions. For versions >= 5.6, - get the gtid_mode value from the second column. - */ - gtid_mode_val = gtid_mode_row ? (char*)gtid_mode_row[1] : NULL; + /* + gtid_mode_row is NULL for pre 5.6 versions. For versions >= 5.6, + get the gtid_mode value from the second column. + */ + gtid_mode_val = gtid_mode_row ? (char*)gtid_mode_row[1] : NULL; + gtid_mode= (gtid_mode_val && strcmp(gtid_mode_val, "OFF")) ? 1 : 0; + mysql_free_result(gtid_mode_res); + } - if (gtid_mode_val && strcmp(gtid_mode_val, "OFF")) + if (gtid_mode) { /* For any gtid_mode !=OFF and irrespective of --set-gtid-purged being AUTO or ON, add GTID_PURGED in the output. */ - if (opt_databases || !opt_alldbs || !opt_dump_triggers - || !opt_routines || !opt_events) + if (!flag) + set_session_binlog(); + else { - fprintf(stderr,"Warning: A partial dump from a server that has GTIDs will " - "by default include the GTIDs of all transactions, even " - "those that changed suppressed parts of the database. If " - "you don't want to restore GTIDs, pass " - "--set-gtid-purged=OFF. To make a complete dump, pass " - "--all-databases --triggers --routines --events. \n"); - } + if (flag && (opt_databases || !opt_alldbs || !opt_dump_triggers + || !opt_routines || !opt_events)) + { + fprintf(stderr,"Warning: A partial dump from a server that has GTIDs will " + "by default include the GTIDs of all transactions, even " + "those that changed suppressed parts of the database. If " + "you don't want to restore GTIDs, pass " + "--set-gtid-purged=OFF. To make a complete dump, pass " + "--all-databases --triggers --routines --events. \n"); + } - set_session_binlog(FALSE); - if (add_set_gtid_purged(mysql_con)) - { - mysql_free_result(gtid_mode_res); - return TRUE; + if (add_set_gtid_purged(mysql_con)) + return TRUE; } } else /* gtid_mode is off */ { - if (opt_set_gtid_purged_mode == SET_GTID_PURGED_ON) + if (flag && opt_set_gtid_purged_mode == SET_GTID_PURGED_ON) { fprintf(stderr, "Error: Server has GTIDs disabled.\n"); - mysql_free_result(gtid_mode_res); return TRUE; } } - mysql_free_result(gtid_mode_res); return FALSE; } @@ -6323,12 +6345,10 @@ int main(int argc, char **argv) if (opt_slave_apply && add_stop_slave()) goto err; - - /* Process opt_set_gtid_purged and add SET @@GLOBAL.GTID_PURGED if required. */ - if (process_set_gtid_purged(mysql)) + /* Process opt_set_gtid_purged and add SET disable binlog if required. */ + if (process_set_gtid_purged(mysql, FALSE)) goto err; - if (opt_master_data && do_show_master_status(mysql)) goto err; if (opt_slave_data && do_show_slave_status(mysql)) @@ -6381,11 +6401,9 @@ int main(int argc, char **argv) if (opt_slave_data && do_start_slave_sql(mysql)) goto err; - /* - if --set-gtid-purged, restore binlog at the end of the session - if required. - */ - set_session_binlog(TRUE); + /* Process opt_set_gtid_purged and add SET @@GLOBAL.GTID_PURGED if required. */ + if (process_set_gtid_purged(mysql, TRUE)) + goto err; /* add 'START SLAVE' to end of dump */ if (opt_slave_apply && add_slave_statements()) diff --git a/mysql-test/r/mysqldump_gtid_state.result b/mysql-test/r/mysqldump_gtid_state.result new file mode 100644 index 000000000000..050aa31c1ea4 --- /dev/null +++ b/mysql-test/r/mysqldump_gtid_state.result @@ -0,0 +1,72 @@ +# +# Bug#32843447: GTID_PURGED IS GETTING EMPTY AND GTID_EXECUTED IS +# GETTING UPDATED AFTER RESTARTING MYSQL +# +CREATE TABLE t (a INT PRIMARY KEY, b INT); +INSERT INTO t VALUES (1, 1); +INSERT INTO t VALUES (2, 1); +INSERT INTO t VALUES (3, 1); +INSERT INTO t VALUES (4, 1); +INSERT INTO t VALUES (5, 1); +INSERT INTO t VALUES (6, 1); +FLUSH LOGS; +# BEFORE RESET +include/assert.inc [Committed gtids :- MASTER_UUID:1-7] +include/assert.inc [No purged gtids] +SELECT * FROM mysql.gtid_executed; +source_uuid interval_start interval_end +MASTER_UUID 1 7 +# MYSQLDUMP SKIPING THE DROP DATABASE FOR MYSQL SCHEMA USING THE OPTION --skip-mysql-schema +Pattern "DROP DATABASE IF EXISTS `mysql`" not found +# MYSQLDUMP WITHOUT SKIPING THE DROP DATABASE FOR MYSQL SCHEMA +Pattern "DROP DATABASE IF EXISTS `mysql`" found +# RESET +RESET MASTER; +# AFTER RESET +include/assert.inc [No committed gtids after RESET] +include/assert.inc [No purged gtids after RESET] +SELECT * FROM mysql.gtid_executed; +source_uuid interval_start interval_end +# DUMP RESTORE WITH THE DUMP FILE HAVING DROP DATABASE ON MYSQL SCHEMA. +# AFTER RESTORE +include/assert.inc [Committed gtids after restore :- MASTER_UUID:1-7] +include/assert.inc [Purged gtids after restore :- MASTER_UUID:1-7] +SELECT * FROM mysql.gtid_executed; +source_uuid interval_start interval_end +MASTER_UUID 1 7 +# INSERT +INSERT INTO t VALUES (7, 1); +INSERT INTO t VALUES (8, 1); +INSERT INTO t VALUES (9, 1); +# AFTER INSERTING +include/assert.inc [Committed gtids after inserting :- MASTER_UUID:1-10] +include/assert.inc [Purged gtids after inserting :- MASTER_UUID:1-7] +SELECT * FROM mysql.gtid_executed; +source_uuid interval_start interval_end +MASTER_UUID 1 7 +# RESTART +# restart +# AFTER RESTART +include/assert.inc [Committed gtids after restart :- MASTER_UUID:1-10] +include/assert.inc [Purged gtids after restart :- MASTER_UUID:1-7] +SELECT * FROM mysql.gtid_executed; +source_uuid interval_start interval_end +MASTER_UUID 1 7 +MASTER_UUID 8 10 +include/assert.inc [GTID_EXECUTED is correct after the restart] +CALL mtr.add_suppression(".*InnoDB: Table `mysql`.`innodb_table_stats` not found.*"); +SHOW CREATE TABLE `mysql`.`innodb_table_stats`; +Table Create Table +innodb_table_stats CREATE TABLE `innodb_table_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `n_rows` bigint(20) unsigned NOT NULL, + `clustered_index_size` bigint(20) unsigned NOT NULL, + `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`database_name`,`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 +#CLEANUP +DROP TABLE t; +RESET MASTER; +# restart diff --git a/mysql-test/t/mysqldump_gtid_state-master.opt b/mysql-test/t/mysqldump_gtid_state-master.opt new file mode 100644 index 000000000000..53bcd2e424f0 --- /dev/null +++ b/mysql-test/t/mysqldump_gtid_state-master.opt @@ -0,0 +1 @@ +--log-slave-updates --enforce-gtid-consistency --gtid-mode=ON --log-bin diff --git a/mysql-test/t/mysqldump_gtid_state.test b/mysql-test/t/mysqldump_gtid_state.test new file mode 100644 index 000000000000..997676a825e7 --- /dev/null +++ b/mysql-test/t/mysqldump_gtid_state.test @@ -0,0 +1,113 @@ +--echo # +--echo # Bug#32843447: GTID_PURGED IS GETTING EMPTY AND GTID_EXECUTED IS +--echo # GETTING UPDATED AFTER RESTARTING MYSQL +--echo # + +# Embedded server doesn't support external clients +--source include/not_embedded.inc +--source include/have_gtid.inc + +--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` + +CREATE TABLE t (a INT PRIMARY KEY, b INT); +INSERT INTO t VALUES (1, 1); +INSERT INTO t VALUES (2, 1); +INSERT INTO t VALUES (3, 1); +INSERT INTO t VALUES (4, 1); +INSERT INTO t VALUES (5, 1); +INSERT INTO t VALUES (6, 1); + +FLUSH LOGS; + +--echo # BEFORE RESET +--let $assert_text= Committed gtids :- MASTER_UUID:1-7 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-7" +--source include/assert.inc +--let $assert_text= No purged gtids +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" +--source include/assert.inc +--replace_result $master_uuid MASTER_UUID +SELECT * FROM mysql.gtid_executed; + +--echo # MYSQLDUMP SKIPING THE DROP DATABASE FOR MYSQL SCHEMA USING THE OPTION --skip-mysql-schema +--let $dump_file_without_mysql = $MYSQLTEST_VARDIR/tmp/rpl_gtid_state_after_restore_without_mysql.sql +--exec $MYSQL_DUMP --socket=$MASTER_MYSOCK --single-transaction --add-drop-database --skip-mysql-schema --databases mysql -uroot > $dump_file_without_mysql +--let SEARCH_FILE= $dump_file_without_mysql +--let SEARCH_PATTERN=DROP DATABASE IF EXISTS `mysql` +--source include/search_pattern.inc + +--echo # MYSQLDUMP WITHOUT SKIPING THE DROP DATABASE FOR MYSQL SCHEMA +--let $dump_file_with_mysql = $MYSQLTEST_VARDIR/tmp/rpl_gtid_state_after_restore_with_mysql.sql +--exec $MYSQL_DUMP --socket=$MASTER_MYSOCK --single-transaction --add-drop-database --databases mysql -uroot > $dump_file_with_mysql +--let SEARCH_FILE= $dump_file_with_mysql +--let SEARCH_PATTERN=DROP DATABASE IF EXISTS `mysql` +--source include/search_pattern.inc + +--echo # RESET +RESET MASTER; + +--echo # AFTER RESET +--let $assert_text= No committed gtids after RESET +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "" +--source include/assert.inc +--let $assert_text= No purged gtids after RESET +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" +--source include/assert.inc +--replace_result $master_uuid MASTER_UUID +SELECT * FROM mysql.gtid_executed; + +--echo # DUMP RESTORE WITH THE DUMP FILE HAVING DROP DATABASE ON MYSQL SCHEMA. +--exec $MYSQL -h localhost -P $MASTER_MYPORT < $dump_file_with_mysql + +--echo # AFTER RESTORE +--let $assert_text= Committed gtids after restore :- MASTER_UUID:1-7 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-7" +--source include/assert.inc +--let $assert_text= Purged gtids after restore :- MASTER_UUID:1-7 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "$master_uuid:1-7" +--source include/assert.inc +--replace_result $master_uuid MASTER_UUID +SELECT * FROM mysql.gtid_executed; + +--echo # INSERT +INSERT INTO t VALUES (7, 1); +INSERT INTO t VALUES (8, 1); +INSERT INTO t VALUES (9, 1); + +--echo # AFTER INSERTING +--let $assert_text= Committed gtids after inserting :- MASTER_UUID:1-10 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-10" +--source include/assert.inc +--let $assert_text= Purged gtids after inserting :- MASTER_UUID:1-7 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "$master_uuid:1-7" +--source include/assert.inc +--replace_result $master_uuid MASTER_UUID +SELECT * FROM mysql.gtid_executed; + +--let $gtid_executed = `SELECT @@GLOBAL.gtid_executed` + +--echo # RESTART +--source include/restart_mysqld.inc + +--echo # AFTER RESTART +--let $assert_text= Committed gtids after restart :- MASTER_UUID:1-10 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-10" +--source include/assert.inc +--let $assert_text= Purged gtids after restart :- MASTER_UUID:1-7 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "$master_uuid:1-7" +--source include/assert.inc +--replace_result $master_uuid MASTER_UUID +SELECT * FROM mysql.gtid_executed; + +--let $assert_text = GTID_EXECUTED is correct after the restart +--let $assert_cond = "[SELECT @@GLOBAL.gtid_executed]" = "$gtid_executed" +--source include/assert.inc + +CALL mtr.add_suppression(".*InnoDB: Table `mysql`.`innodb_table_stats` not found.*"); + +SHOW CREATE TABLE `mysql`.`innodb_table_stats`; + +--echo #CLEANUP +DROP TABLE t; +RESET MASTER; +--source include/restart_mysqld.inc From ee3f001be2216f586d3ca8fa100f404b2fa4d37d Mon Sep 17 00:00:00 2001 From: Debarun Banerjee Date: Tue, 10 Aug 2021 21:32:16 +0530 Subject: [PATCH 13/36] BUG#33181859: Followup for Bug 32800020 - the deadlocking continues Problem : --------- In bug#32800020 bug fix, we fixed the deadlock by truncating pending rollback segments (rseg) during undo tablespace truncate. This patch attempts to resolve the issue by freeing old rsegs during undo space truncate. It works for anyone upgrading directly to the patched version from 5.6. It fails to correct the old rseg if the issue has already occurred. 1. We could face the same deadlock till the time a space is truncated. 2. Once server is restarted after hang old rseg could have references to open transaction undo belonging to new rseg. This would cause assert while truncating undo tablespace. Solution : ---------- 1. During server start-up, find rouge 5.6 (pre 5.7.2) rsegs and reset the slot. Emit NOTE in mysqld error log. [Note] InnoDB: Found duplicate reference rseg: 33 space: 1 page: 3 [Note] InnoDB: Reset pre-5.7.2 rseg: 1 after duplicate is found. 2. If there is no undo data left to purge don't allocate old_rseg and reset the slot. Emit NOTE in mysqld error log. [Note] InnoDB: Successfully reset 32 pre-5.7.2 rseg slots. 3. If there is any undo data found for pre-5.7.2 rseg slot, allocate old rseg. Emit NOTE recommending slow shutdown in mysqld error log. [Note] InnoDB: pre-5.7.2 rseg: 2 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart Reviewed-by: Sachin Z Agarwal RB: 26810 --- storage/innobase/include/trx0rseg.h | 6 + storage/innobase/srv/srv0start.cc | 6 + storage/innobase/trx/trx0rseg.cc | 296 +++++++++++++++++++++------- 3 files changed, 232 insertions(+), 76 deletions(-) diff --git a/storage/innobase/include/trx0rseg.h b/storage/innobase/include/trx0rseg.h index 8e4cad97e447..cf3f1e3fe5b5 100644 --- a/storage/innobase/include/trx0rseg.h +++ b/storage/innobase/include/trx0rseg.h @@ -160,6 +160,12 @@ trx_rseg_get_n_undo_tablespaces( /*============================*/ ulint* space_ids); /*!< out: array of space ids of UNDO tablespaces */ + +/** Reset no-redo rseg slots on disk used by pre-5.7.2 rsegs. All data for +these rsegs are already purged. This is a deferred action to be done post +redo log recovery. */ +void trx_rseg_reset_pending(); + /* Number of undo log slots in a rollback segment file copy */ #define TRX_RSEG_N_SLOTS (UNIV_PAGE_SIZE / 16) diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index b404b2068357..83da06e301d2 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2421,6 +2421,12 @@ innobase_start_or_create_for_mysql(void) trx_sys_file_format_tag_init(); } + if (!create_new_db) { + /* Check and reset any no-redo rseg slot on disk used by + pre-5.7.2 redo resg with no data to purge. */ + trx_rseg_reset_pending(); + } + if (!create_new_db && sum_of_new_sizes > 0) { /* New data file(s) were added */ mtr_start(&mtr); diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index 852242592d9e..60a11196a4c5 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -105,8 +105,8 @@ trx_rseg_header_create( } if (!trx_sys_is_noredo_rseg_slot(rseg_slot_no)) { - /* Non-redo rseg are re-created on restart and so no need - to persist this information in sys-header. Anyway, on restart + /* No-redo rsegs are re-created on restart and no need to + persist this information in sys-header. Anyway, on restart this information is not valid too as there is no space with persisted space-id on restart. */ @@ -277,107 +277,251 @@ trx_rseg_mem_create( return(rseg); } -/******************************************************************** -Check if rseg in given slot needs to be scheduled for purge. */ -static -void -trx_rseg_schedule_pending_purge( -/*============================*/ - trx_sysf_t* sys_header, /*!< in: trx system header */ - purge_pq_t* purge_queue, /*!< in/out: rseg queue */ - ulint slot, /*!< in: check rseg from given slot. */ - mtr_t* mtr) /*!< in: mtr */ +/* Read information from system header page for a rollback segment. +@param[in] rseg_id rollback segment ID +@param[in,out] mtr mini transaction for reading +@param[out] space space ID for the rollback segment +@param[out] page_no page number of the rollback segment +@return page size for the rollback segment space. */ +static const page_size_t +read_sys_rseg_info( + ulint rseg_id, + mtr_t *mtr, + ulint &space, + ulint &page_no) { - ulint page_no; - ulint space; + trx_sysf_t* sys_header = trx_sysf_get(mtr); - page_no = trx_sysf_rseg_get_page_no(sys_header, slot, mtr); - space = trx_sysf_rseg_get_space(sys_header, slot, mtr); + page_no = trx_sysf_rseg_get_page_no(sys_header, rseg_id, mtr); - if (page_no != FIL_NULL - && is_system_or_undo_tablespace(space)) { + if (page_no == FIL_NULL) { + space = 0; + return (univ_page_size); + } - /* rseg resides in system or undo tablespace and so - this is an upgrade scenario. trx_rseg_mem_create - will add rseg to purge queue if needed. */ + space = trx_sysf_rseg_get_space(sys_header, rseg_id, mtr); - trx_rseg_t* rseg = NULL; - bool found = true; - const page_size_t& page_size - = is_system_tablespace(space) - ? univ_page_size - : fil_space_get_page_size(space, &found); + bool found = true; - ut_ad(found); + const page_size_t& page_size + = is_system_tablespace(space) + ? univ_page_size + : fil_space_get_page_size(space, &found); - rseg = trx_rseg_mem_create( - slot, space, page_no, page_size, - purge_queue, trx_sys->pending_purge_rseg_array, mtr); + ut_ad(found); + return (page_size); +} + +/** Initialize a redo rollback segment and add to purge queue if it has anything +left to purge. +@param[in] rseg_id rollback segment ID +@param[in,out] rseg_array rollback segment array +@param[in,out] purge_queue queue for rollback segments that need purging */ +static void +trx_rseg_initialize( + ulint rseg_id, + trx_rseg_t** rseg_array, + purge_pq_t* purge_queue) +{ + ut_a(rseg_array[rseg_id] == NULL); + + mtr_t mtr; + mtr.start(); + + ulint space = 0; + ulint page_no = FIL_NULL; + + const page_size_t& page_size = + read_sys_rseg_info(rseg_id, &mtr, space, page_no); - ut_a(rseg->id == slot); + if (page_no == FIL_NULL) { + mtr.commit(); + return; } + + trx_rseg_t* rseg = trx_rseg_mem_create(rseg_id, space, page_no, + page_size, purge_queue, rseg_array, &mtr); + + ut_a(rseg->id == rseg_id); + + mtr.commit(); } -/******************************************************************** -Creates the memory copies for the rollback segments and initializes the -rseg array in trx_sys at a database startup. */ -static -void -trx_rseg_create_instance( -/*=====================*/ - purge_pq_t* purge_queue) /*!< in/out: rseg queue */ +/* Check if any of the redo rollback segment has same space, page reference +@param[in] space space ID for the rollback segment +@param[in] page_no page number of the rollback segment +@return true iff duplicate is found. */ +static bool +check_duplicate_rseg( + ulint space, + ulint page_no) { - ulint i; + for (ulint rseg_id = 0; rseg_id < TRX_SYS_N_RSEGS; rseg_id++) { + /* Skip over no-redo rollback segments. */ + if (trx_sys_is_noredo_rseg_slot(rseg_id)) { + continue; + } - for (i = 0; i < TRX_SYS_N_RSEGS; i++) { - ulint page_no; + trx_rseg_t* rseg = trx_sys->rseg_array[rseg_id]; - mtr_t mtr; - mtr.start(); - trx_sysf_t* sys_header = trx_sysf_get(&mtr); + if (rseg != NULL && rseg->space == space && + rseg->page_no == page_no) { + ib::info() << "Found duplicate reference rseg: " + << rseg_id << " space: " << space + << " page: " << page_no; + return (true); + } + } + return (false); +} - page_no = trx_sysf_rseg_get_page_no(sys_header, i, &mtr); +/** Check if pre-5.7.2 rollback segment has data to be purged. +@param[in] rseg_id rollback segment ID +@param[out] reset_rseg true iff need to reset rseg slot +@return true iff there is data to purge. +*/ +static bool is_purge_pending( + ulint rseg_id, + bool& reset_rseg) +{ + ut_a(trx_sys_is_noredo_rseg_slot(rseg_id)); - /* Slot-1....Slot-n are reserved for non-redo rsegs. - Non-redo rsegs are recreated on server re-start so - avoid initializing the existing non-redo rsegs. */ - if (trx_sys_is_noredo_rseg_slot(i)) { + mtr_t mtr; + mtr.start(); - /* If this is an upgrade scenario then existing rsegs - in range from slot-1....slot-n needs to be scheduled - for purge if there are pending purge operation. */ - trx_rseg_schedule_pending_purge( - sys_header, purge_queue, i, &mtr); + ulint space = 0; + ulint page_no = FIL_NULL; - } else if (page_no != FIL_NULL) { - ulint space; - trx_rseg_t* rseg = NULL; + const page_size_t& page_size = + read_sys_rseg_info(rseg_id, &mtr, space, page_no); - ut_a(!trx_rseg_get_on_id(i, true)); + reset_rseg = (page_no != FIL_NULL); - space = trx_sysf_rseg_get_space(sys_header, i, &mtr); + if (page_no == FIL_NULL || !is_system_or_undo_tablespace(space)) { + mtr.commit(); + return (false); + } - bool found = true; - const page_size_t& page_size - = is_system_tablespace(space) - ? univ_page_size - : fil_space_get_page_size(space, &found); + /* There is an issue till 5.7.34, which could cause a pre-5.7.2 rseg to + point to some redo rseg after undo tablespace truncate. We need to check + for it and should not add it for purge in such case. */ + if (check_duplicate_rseg(space, page_no)) { + mtr.commit(); + ib::info() << "Reset pre-5.7.2 rseg: " << rseg_id + << " after duplicate is found."; + return (false); + } + + trx_rsegf_t* rseg_header = + trx_rsegf_get_new(space, page_no, page_size, &mtr); + + ulint len = flst_get_len(rseg_header + TRX_RSEG_HISTORY); - ut_ad(found); + mtr.commit(); - trx_rseg_t** rseg_array = - static_cast(trx_sys->rseg_array); + if (len > 0) { + ib::info() << "pre-5.7.2 rseg: " << rseg_id + << " holds data to be purged. History length: " + << len << ". Recommend slow shutdown with" + << " innodb_fast_shutdown=0 and restart"; + reset_rseg = false; + return (true); + } + return (false); +} - rseg = trx_rseg_mem_create( - i, space, page_no, page_size, - purge_queue, rseg_array, &mtr); +/** Rollback segment IDs that needs to be reset on disk. */ +static std::vector s_pending_reset_rseg_ids; - ut_a(rseg->id == i); - } else { - ut_a(trx_sys->rseg_array[i] == NULL); +/** Creates the memory copies for the rollback segments and initializes the +rseg array in trx_sys at a database startup. +@param[in,out] purge_queue queue for rollback segments that need purging +*/ +static void trx_rseg_create_instance( + purge_pq_t* purge_queue) +{ + /* Initialize redo rollback segments. */ + for (ulint rseg_id = 0; rseg_id < TRX_SYS_N_RSEGS; rseg_id++) { + /* Skip all no-redo segments. Slot-1....Slot-n are reserved for + no-redo rsegs. These no-redo rsegs are recreated on server + re-start and we should avoid initializing them. There could also + be some leftover redo rollback segments from pre-5.7.2, which we + handle in next iteration. */ + if (trx_sys_is_noredo_rseg_slot(rseg_id)) { + continue; } - mtr.commit(); + trx_rseg_initialize(rseg_id, trx_sys->rseg_array, purge_queue); } + + /* Check and initialize redo rollback segments carried forward from + pre-5.7.2. They could occupy the no-redo rseg slots in range from + slot-1...slot-n. We need to schedule them for purge if there are pending + purge operations. It is only possible if pre-5.7.2 server is upgraded + without using slow shutdown (innodb_fast_shutdown = 0). */ + for (ulint rseg_id = 0; rseg_id < TRX_SYS_N_RSEGS; rseg_id++) { + /* Skip all redo slots which are handled already in previous + iteration. */ + if (!trx_sys_is_noredo_rseg_slot(rseg_id)) { + continue; + } + + bool reset_rseg_slot = false; + + if (is_purge_pending(rseg_id, reset_rseg_slot)) { + trx_rseg_initialize(rseg_id, + trx_sys->pending_purge_rseg_array, purge_queue); + continue; + } + + if (reset_rseg_slot) { + /* We need to reset this rollback segment slot on disk. + Redo recovery is not finished at this point and we don't + want to start DB modification generating new redo logs. + The reset is deferred till recovery end and done by + trx_rseg_reset_pending(). */ + s_pending_reset_rseg_ids.push_back(rseg_id); + } + ut_a(trx_sys->pending_purge_rseg_array[rseg_id] == NULL); + } +} + +/** Reset no-redo rollback segment slot on disk. +@param[in] rseg_id rollback segment ID */ +static void trx_rseg_reset_slot( + ulint rseg_id) +{ + ut_a(rseg_id < TRX_SYS_N_RSEGS); + ut_a(trx_sys_is_noredo_rseg_slot(rseg_id)); + + /* Reset rollback segment slot on disk. */ + mtr_t mtr; + mtr.start(); + trx_sysf_t* sys_header = trx_sysf_get(&mtr); + + trx_sysf_rseg_set_page_no( + sys_header, rseg_id, FIL_NULL, &mtr); + mtr.commit(); +} + +void trx_rseg_reset_pending() { + if (s_pending_reset_rseg_ids.empty()) { + return; + + } else if (srv_read_only_mode) { + ib::warn() << "Could not reset pre-5.7.2 rseg slots" + << " in read-only mode."; + return; + } + /* Check and reset no-redo rollback segment slots carried forward from + pre-5.7.2 with no left-over data to purge. This is a deferred action + from trx_rseg_create_instance(). */ + std::for_each(s_pending_reset_rseg_ids.begin(), + s_pending_reset_rseg_ids.end(), trx_rseg_reset_slot); + + ib::info() << "Successfully reset " << s_pending_reset_rseg_ids.size() + << " pre-5.7.2 rseg slots."; + + s_pending_reset_rseg_ids.clear(); } /********************************************************************* From ac79aa1522f33e6eb912133a81fa2614db764c9c Mon Sep 17 00:00:00 2001 From: Rahul Agarkar Date: Mon, 9 Aug 2021 11:43:10 +0200 Subject: [PATCH 14/36] Bug#33162828: INNODB: Assertion failure: ut0ut.cc:552 thread 140294520874752 Problem: Server crashes when an undo tablespace is truncated while an active transaction is using it. Solution: Do not mark the transaction as complete until all the cleanup is done. RB# 26771 Reviewed By: Debarun Banerjee --- storage/innobase/trx/trx0trx.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index fa834f7eeb6a..6a5727e40889 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1992,13 +1992,6 @@ trx_commit_in_memory( } } - if (trx->rsegs.m_redo.rseg != NULL) { - trx_rseg_t* rseg = trx->rsegs.m_redo.rseg; - mutex_enter(&rseg->mutex); - ut_ad(rseg->trx_ref_count > 0); - --rseg->trx_ref_count; - mutex_exit(&rseg->mutex); - } if (mtr != NULL) { if (trx->rsegs.m_redo.insert_undo != NULL) { @@ -2061,6 +2054,24 @@ trx_commit_in_memory( srv_active_wake_master_thread(); } + /* Do not decrement the reference count before this point. + There is a potential issue where a thread attempting to truncate + an undo tablespace may end up truncating this undo space + before this thread can complete the cleanup. + While truncating an undo space, the server tries to find if any + transaction is actively using the undo log being truncated. A + non-zero reference count ensures that the thread attempting to + truncate the undo tablespace cannot be successful as the undo log + cannot be truncated until it is empty. */ + if (trx->rsegs.m_redo.rseg != NULL) { + trx_rseg_t* rseg = trx->rsegs.m_redo.rseg; + mutex_enter(&rseg->mutex); + ut_ad(rseg->trx_ref_count > 0); + --rseg->trx_ref_count; + mutex_exit(&rseg->mutex); + trx->rsegs.m_redo.rseg = NULL; + } + /* Free all savepoints, starting from the first. */ trx_named_savept_t* savep = UT_LIST_GET_FIRST(trx->trx_savepoints); From f8ed1772fe82a3e3789e90b2aadc8258ec24e67e Mon Sep 17 00:00:00 2001 From: Maheedhar PV Date: Wed, 25 Aug 2021 11:50:50 +0530 Subject: [PATCH 15/36] Bug#32552332 - CAN'T WRITE; DUPLICATE KEY IN TABLE '/TMP/#SQL...' In the case of a query that uses temporary table for aggregation, the group-by Item is used as the unique constraint of the temporary table. If the group-by Item value is already present, the row is updated. Otherwise, a new row is inserted into the temporary table. If the group-by Item is an Item with a result field(like Item_func) or a reference Item, it gets evaluated twice. Once to check if the result exists in the temporary table and if not, again while constructing the row to insert. If the group-by item is non-deterministic, the result value used to check for existence would be different from the value with which an insert is tried. This causes the insert to fail if the value already exists in the table. Fix: If any of the group-by Items are non-deterministic, use the hash of the group-by Items as the unique constraint of the temporary table as the hash gets evaluated only once. Change-Id: I7004f298dc0ea84d760903c30af8f08e072a3f2d --- mysql-test/r/func_group.result | 35 ++++++++++++++++++++++++++++++++++ mysql-test/t/func_group.test | 35 ++++++++++++++++++++++++++++++++++ sql/item.h | 9 ++++++++- sql/sql_tmp_table.cc | 9 ++++++++- 4 files changed, 86 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 6b95880a2ea8..c0c8ffa09577 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1941,3 +1941,38 @@ FROM t1 t GROUP BY t1.a) 0 0 DROP TABLE t1; +# +# Bug#32552332 - CAN'T WRITE; DUPLICATE KEY IN TABLE '/TMP/#SQL...' +# +CREATE TABLE tr (c1 INT); +INSERT INTO tr VALUES (1); +CREATE FUNCTION seq_1_to_2() RETURNS INT +BEGIN +DECLARE limit_value, return_value INT; +SET limit_value = 2; +SELECT c1 INTO return_value FROM tr; +IF (return_value < limit_value) THEN +UPDATE tr SET c1 = c1 + 1; +ELSE +UPDATE tr SET c1 = 1; +END IF; +RETURN (return_value); +END| +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (10); +INSERT INTO t1 VALUES (11); +SELECT seq_1_to_2() as seq, COUNT(*) FROM t1 GROUP BY seq; +seq COUNT(*) +1 1 +2 1 +SELECT FLOOR(seq_1_to_2() * 2) AS val, COUNT(*) FROM t1 GROUP BY val; +val COUNT(*) +2 1 +4 1 +SELECT val, COUNT(*) FROM (SELECT FLOOR(seq_1_to_2())+1 val FROM t1) x +GROUP BY x.val; +val COUNT(*) +2 1 +3 1 +DROP TABLE t1, tr; +DROP FUNCTION seq_1_to_2; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index e7a3741d5622..e88cd8c0bfa8 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1240,3 +1240,38 @@ WHERE 0 = (SELECT group_concat(b) FROM t1 t GROUP BY t1.a) ; DROP TABLE t1; + +--echo # +--echo # Bug#32552332 - CAN'T WRITE; DUPLICATE KEY IN TABLE '/TMP/#SQL...' +--echo # + +CREATE TABLE tr (c1 INT); +INSERT INTO tr VALUES (1); + +# Generates a integer sequence from 1 to 2 and repeats +DELIMITER |; +CREATE FUNCTION seq_1_to_2() RETURNS INT +BEGIN + DECLARE limit_value, return_value INT; + SET limit_value = 2; + SELECT c1 INTO return_value FROM tr; + IF (return_value < limit_value) THEN + UPDATE tr SET c1 = c1 + 1; + ELSE + UPDATE tr SET c1 = 1; + END IF; + RETURN (return_value); +END| +DELIMITER ;| + +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (10); +INSERT INTO t1 VALUES (11); + +SELECT seq_1_to_2() as seq, COUNT(*) FROM t1 GROUP BY seq; +SELECT FLOOR(seq_1_to_2() * 2) AS val, COUNT(*) FROM t1 GROUP BY val; +SELECT val, COUNT(*) FROM (SELECT FLOOR(seq_1_to_2())+1 val FROM t1) x + GROUP BY x.val; + +DROP TABLE t1, tr; +DROP FUNCTION seq_1_to_2; diff --git a/sql/item.h b/sql/item.h index 2aee2167b75e..bf58b31f32c3 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1663,9 +1663,16 @@ class Item : public Parse_tree_node Returns true if this is constant but its value may be not known yet. (Can be used for parameters of prep. stmts or of stored procedures.) */ - virtual bool const_during_execution() const + virtual bool const_during_execution() const { return (used_tables() & ~PARAM_TABLE_BIT) == 0; } + /** + @returns true if this item is non-deterministic, which means that a + has a component that must be evaluated once per row in + execution of a JOIN query. + */ + bool is_non_deterministic() const { return used_tables() & RAND_TABLE_BIT; } + /** This method is used for to: - to generate a view definition query (SELECT-statement); diff --git a/sql/sql_tmp_table.cc b/sql/sql_tmp_table.cc index 60292c303034..9f39dd7bc9e2 100644 --- a/sql/sql_tmp_table.cc +++ b/sql/sql_tmp_table.cc @@ -745,8 +745,15 @@ create_tmp_table(THD *thd, Temp_table_param *param, List &fields, (*tmp->item)->marker= 4; const uint char_len= (*tmp->item)->max_length / (*tmp->item)->collation.collation->mbmaxlen; - if (char_len > CONVERT_IF_BIGGER_TO_BLOB) + /* + Use hash key as the unique constraint if the group-by key is + big or if it is non-deterministic. Group-by items get evaluated + twice and a non-deterministic function would cause a discrepancy. + */ + if (char_len > CONVERT_IF_BIGGER_TO_BLOB || + (*tmp->item)->is_non_deterministic()) { using_unique_constraint= true; + } } if (group) { From 27130e25078864b010d81266f9613d389d4a229b Mon Sep 17 00:00:00 2001 From: Sachin Agarwal Date: Wed, 1 Sep 2021 18:40:31 +0200 Subject: [PATCH 16/36] Bug #33053297 VIRTUAL INDEX CORRUPTED DURING CASCADE UPDATE ON CHILD TABLE Problem: Child table has FOREIGN KEY (FK) constraint with referential action ON DELETE SET NULL (or ON UPDATE SET NULL). And child table also has an index over (FK column, virtual column). When a row is deleted from parent table, FK constraint check on child table, set both [FK column, virtual column] value in the index to NULL. Fix: Instead of setting virtual column value to NULL, derives it from the base columns. when FK column is set to NULL in the child table, three cases need to be taken care while setting virtual column value in the index: 1. If all base columns are in FK then set virtual column value to NULL. 2. If no base columns is in FK then set virtual column value to OLD value. 3. If one or more base columns are in FK then set those base column value to NULL and compute virtual column value again. RB: 26751 Reviewed by : Rahul Agarkar --- mysql-test/suite/innodb/r/foreign_key.result | 147 +++++++++++++++++++ mysql-test/suite/innodb/t/foreign_key.test | 140 ++++++++++++++++++ storage/innobase/dict/dict0dict.cc | 22 +++ storage/innobase/handler/ha_innodb.cc | 15 +- storage/innobase/include/dict0dict.h | 4 + storage/innobase/include/row0mysql.h | 12 ++ storage/innobase/row/row0ins.cc | 29 +++- 7 files changed, 360 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 33cf5f9cec9e..e573cd9adfd2 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -150,3 +150,150 @@ unique_constraint_name PRIMARY DROP TABLE t2; DROP TABLE t1; +# +# Bug#33053297 VIRTUAL INDEX CORRUPTED DURING CASCADE UPDATE ON CHILD TABLE +# +#Test-Case 1 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_date` date GENERATED ALWAYS AS +(concat(year(`date_sent`),'-',lpad(month(`date_sent`),2,'0'), +'-',lpad(dayofmonth(`date_sent`),2,'0'))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `IDX_ES1` (`email_id`), +KEY `mautic_generated_sent_date_email_id` +(`generated_sent_date`,`email_id`), +CONSTRAINT `FK_EA1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_date +1 1 2020-10-22 13:32:41 2020-10-22 +DELETE FROM `emails`; +DELETE FROM `email_stats`; +DROP TABLE `email_stats`; +DROP TABLE `emails`; +# Test-Case 2 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_date` date GENERATED ALWAYS AS +(concat(year(`date_sent`),'-',lpad(month(`date_sent`),2,'0'), +'-',lpad(dayofmonth(`date_sent`),2,'0'))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `IDX_ES1` (`email_id`), +KEY `mautic_generated_sent_date_email_id` +(`generated_sent_date`,`email_id`), +CONSTRAINT `FK_EA1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +UPDATE `emails` SET `id` = 2 where `id` = 1; +SELECT id FROM `email_stats` WHERE `generated_sent_date` IS NULL; +id +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_date +1 NULL 2020-10-22 13:32:41 2020-10-22 +UPDATE `email_stats` SET `email_id`=2 +WHERE DATE(`generated_sent_date`) = '2020-10-22'; +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_date +1 2 2020-10-22 13:32:41 2020-10-22 +DROP TABLE `email_stats`; +DROP TABLE `emails`; +# test-case 3 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_email` varchar(20) GENERATED ALWAYS AS +(CONCAT(YEAR(`date_sent`),'-', COALESCE(`email_id`, ' '))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `idx_es1` (`email_id`), +KEY `mautic_generated_sent_date_email` +(`generated_sent_email`,`email_id`), +CONSTRAINT `fk_ea1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON DELETE SET NULL +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_email +1 1 2020-10-22 13:32:41 2020-1 +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-1'; +date_sent +2020-10-22 13:32:41 +DELETE FROM `emails`; +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_email +1 NULL 2020-10-22 13:32:41 2020- +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-'; +date_sent +2020-10-22 13:32:41 +DROP TABLE `email_stats`; +DROP TABLE `emails`; +# test-case 4 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_email` varchar(20) GENERATED ALWAYS AS +(CONCAT(YEAR(`date_sent`),'-', COALESCE(`email_id`, ' '))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `idx_es1` (`email_id`), +KEY `mautic_generated_sent_date_email` +(`generated_sent_email`,`email_id`), +CONSTRAINT `fk_ea1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON UPDATE SET NULL +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_email +1 1 2020-10-22 13:32:41 2020-1 +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-1'; +date_sent +2020-10-22 13:32:41 +UPDATE `emails` SET `id` = 2 WHERE `id` = 1; +SELECT * FROM `email_stats`; +id email_id date_sent generated_sent_email +1 NULL 2020-10-22 13:32:41 2020- +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-'; +date_sent +2020-10-22 13:32:41 +DROP TABLE `email_stats`; +DROP TABLE `emails`; diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index f4b0dee2f993..7368a8e29d85 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -113,3 +113,143 @@ WHERE table_name = 't2'; DROP TABLE t2; DROP TABLE t1; + +--echo # +--echo # Bug#33053297 VIRTUAL INDEX CORRUPTED DURING CASCADE UPDATE ON CHILD TABLE +--echo # + +--echo #Test-Case 1 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; + +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_date` date GENERATED ALWAYS AS +(concat(year(`date_sent`),'-',lpad(month(`date_sent`),2,'0'), +'-',lpad(dayofmonth(`date_sent`),2,'0'))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `IDX_ES1` (`email_id`), +KEY `mautic_generated_sent_date_email_id` +(`generated_sent_date`,`email_id`), +CONSTRAINT `FK_EA1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; + +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +SELECT * FROM `email_stats`; +DELETE FROM `emails`; +DELETE FROM `email_stats`; + +#clean up. +DROP TABLE `email_stats`; +DROP TABLE `emails`; + +--echo # Test-Case 2 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; + +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_date` date GENERATED ALWAYS AS +(concat(year(`date_sent`),'-',lpad(month(`date_sent`),2,'0'), +'-',lpad(dayofmonth(`date_sent`),2,'0'))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `IDX_ES1` (`email_id`), +KEY `mautic_generated_sent_date_email_id` +(`generated_sent_date`,`email_id`), +CONSTRAINT `FK_EA1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON DELETE SET NULL ON UPDATE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +UPDATE `emails` SET `id` = 2 where `id` = 1; +SELECT id FROM `email_stats` WHERE `generated_sent_date` IS NULL; +SELECT * FROM `email_stats`; +UPDATE `email_stats` SET `email_id`=2 +WHERE DATE(`generated_sent_date`) = '2020-10-22'; +SELECT * FROM `email_stats`; + +#clean up. +DROP TABLE `email_stats`; +DROP TABLE `emails`; + +--echo # test-case 3 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_email` varchar(20) GENERATED ALWAYS AS +(CONCAT(YEAR(`date_sent`),'-', COALESCE(`email_id`, ' '))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `idx_es1` (`email_id`), +KEY `mautic_generated_sent_date_email` +(`generated_sent_email`,`email_id`), +CONSTRAINT `fk_ea1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON DELETE SET NULL +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +SELECT * FROM `email_stats`; +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-1'; +DELETE FROM `emails`; +SELECT * FROM `email_stats`; +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-'; + +#clean up. +DROP TABLE `email_stats`; +DROP TABLE `emails`; + +--echo # test-case 4 +CREATE TABLE `emails` ( +`id` int unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +CREATE TABLE `email_stats` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT, +`email_id` int unsigned DEFAULT NULL, +`date_sent` datetime NOT NULL, +`generated_sent_email` varchar(20) GENERATED ALWAYS AS +(CONCAT(YEAR(`date_sent`),'-', COALESCE(`email_id`, ' '))) VIRTUAL, +PRIMARY KEY (`id`), +KEY `idx_es1` (`email_id`), +KEY `mautic_generated_sent_date_email` +(`generated_sent_email`,`email_id`), +CONSTRAINT `fk_ea1` FOREIGN KEY (`email_id`) REFERENCES +`emails` (`id`) ON UPDATE SET NULL +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ROW_FORMAT=DYNAMIC; +INSERT INTO `emails` VALUES (1); +INSERT INTO `email_stats` (`id`, `email_id`, `date_sent`) VALUES +(1,1,'2020-10-22 13:32:41'); +SELECT * FROM `email_stats`; +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-1'; +UPDATE `emails` SET `id` = 2 WHERE `id` = 1; +SELECT * FROM `email_stats`; +SELECT `date_sent` FROM `email_stats` WHERE `generated_sent_email` = '2020-'; + +#clean up. +DROP TABLE `email_stats`; +DROP TABLE `emails`; diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index ad747ceda8e0..f3c38b2aee24 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -7166,3 +7166,25 @@ dict_table_extent_size( return(pages_in_extent); } + +/** @return number of base columns of virtual column in foreign key column +@param[in] vcol in-memory virtual column +@param[in] foreign in-memory Foreign key constraint */ +uint32_t dict_vcol_base_is_foreign_key(dict_v_col_t *vcol, + dict_foreign_t *foreign) { + + const dict_table_t *table = foreign->foreign_table; + uint32_t foreign_col_count = 0; + + for (uint32_t i = 0; i < foreign->n_fields; i++) { + const char *foreign_col_name = foreign->foreign_col_names[i]; + for (uint32_t j = 0; j < vcol->num_base; j++) { + if (innobase_strcasecmp(foreign_col_name, + dict_table_get_col_name(table, + vcol->base_col[j]->ind)) == 0) { + foreign_col_count++; + } + } + } + return foreign_col_count; +} diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 413d2e21baab..20bf6f0767fe 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -20788,20 +20788,19 @@ given col_no. @param[in] update updated parent vector. @param[in] col_no base column position of the child table to check @return updated field from the parent update vector, else NULL */ -static dfield_t* innobase_get_field_from_update_vector( dict_foreign_t* foreign, upd_t* update, - ulint col_no) + uint32_t col_no) { dict_table_t* parent_table = foreign->referenced_table; dict_index_t* parent_index = foreign->referenced_index; - ulint parent_field_no; - ulint parent_col_no; - ulint child_col_no; + uint32_t parent_field_no; + uint32_t parent_col_no; + uint32_t child_col_no; - for (ulint i = 0; i < foreign->n_fields; i++) { + for (uint32_t i = 0; i < foreign->n_fields; i++) { child_col_no = dict_index_get_nth_col_no( foreign->foreign_index, i); if (child_col_no != col_no) { @@ -20811,7 +20810,7 @@ innobase_get_field_from_update_vector( parent_field_no = dict_table_get_nth_col_pos( parent_table, parent_col_no); - for (ulint j = 0; j < update->n_fields; j++) { + for (uint32_t j = 0; j < update->n_fields; j++) { upd_field_t* parent_ufield = &update->fields[j]; @@ -20891,7 +20890,7 @@ innobase_get_computed_value( for (ulint i = 0; i < col->num_base; i++) { dict_col_t* base_col = col->base_col[i]; const dfield_t* row_field = NULL; - ulint col_no = base_col->ind; + uint32_t col_no = base_col->ind; const mysql_row_templ_t* templ = index->table->vc_templ->vtempl[col_no]; const byte* data; diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 0e0854a6aac4..24e7a94f9b1e 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -2149,6 +2149,10 @@ bool dict_table_is_partition( const dict_table_t* table); +/** @return true if all base column of virtual column is foreign key column +@param[in] vcol in-memory virtul column +@param[in] foreign in-memory Foreign key constraint */ +uint32_t dict_vcol_base_is_foreign_key(dict_v_col_t *vcol, dict_foreign_t *foreign); #endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 5625679ee3b5..2db9c12155de 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -951,6 +951,18 @@ struct SysIndexCallback { virtual void operator()(mtr_t* mtr, btr_pcur_t* pcur) throw() = 0; }; +/** Get the updated parent field value from the update vector for the +given col_no. +@param[in] foreign foreign key information +@param[in] update updated parent vector. +@param[in] col_no base column position of the child table to check +@return updated field from the parent update vector, else NULL */ +dfield_t* +innobase_get_field_from_update_vector( + dict_foreign_t* foreign, + upd_t* update, + uint32_t col_no); + /** Get the computed value by supplying the base column values. @param[in,out] row the data row @param[in] col virtual column diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 98b65bc4257d..b95556329728 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1016,8 +1016,35 @@ row_ins_foreign_fill_virtual( if (node->is_delete ? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) : (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)) { + uint32_t col_match_count = + dict_vcol_base_is_foreign_key(col, foreign); + if (col_match_count == col->num_base) { + /* If all base columns of virtual col are + in FK */ + dfield_set_null(&upd_field->new_val); + } else if (col_match_count == 0) { + /* If no base column of virtual col is in FK */ + dfield_copy(&(upd_field->new_val), vfield); + } else { + /* If at least one base column of virtual col + is in FK */ + for (uint32_t j = 0; j < col->num_base; j++) { + dict_col_t *base_col = col->base_col[j]; + uint32_t col_no = base_col->ind; + dfield_t *row_field = + innobase_get_field_from_update_vector( + foreign, node->update, col_no); + if (row_field != NULL) { + dfield_set_null(row_field); + } + } + dfield_t *new_vfield = innobase_get_computed_value( + update->old_vrow, col, index, &v_heap, + update->heap, NULL, thd, NULL, + NULL, node->update, foreign); + dfield_copy(&(upd_field->new_val), new_vfield); + } - dfield_set_null(&upd_field->new_val); } if (!node->is_delete From 7977f189d91375a7cbfe56d5915a7a3d66ec5151 Mon Sep 17 00:00:00 2001 From: Salman Khan Date: Fri, 13 Aug 2021 13:52:48 +0530 Subject: [PATCH 17/36] BUG#31716706 BAD HANDLING OF QUOTES IN SHOW GRANTS Description: SHOW GRANTS quotes username with ' and if the username contains ' it is not escaped. When the output of SHOW GRANTS is dumped to a file to re-excecute the commands will result in either invalid SQL or SQL injection. Analysis: It is hardcoded to quote the username with ' and also fails to escaping the ' when present in username. Right way is to append the quotes and escape it with \ when quotes are present in username or host. Fix: Escape the ' with \ if present in username@host specification. RB: 26845 --- sql/auth/sql_auth_cache.cc | 29 +++++++++--------- sql/auth/sql_auth_cache.h | 9 +++++- sql/auth/sql_authorization.cc | 56 +++++++++++++++++++---------------- 3 files changed, 53 insertions(+), 41 deletions(-) diff --git a/sql/auth/sql_auth_cache.cc b/sql/auth/sql_auth_cache.cc index 25034ce63dd0..18625738da91 100644 --- a/sql/auth/sql_auth_cache.cc +++ b/sql/auth/sql_auth_cache.cc @@ -335,21 +335,22 @@ ACL_PROXY_USER::pk_equals(ACL_PROXY_USER *grant) } void -ACL_PROXY_USER::print_grant(String *str) +ACL_PROXY_USER::print_grant(THD *thd, String *str) { - str->append(STRING_WITH_LEN("GRANT PROXY ON '")); - if (proxied_user) - str->append(proxied_user, strlen(proxied_user)); - str->append(STRING_WITH_LEN("'@'")); - if (!proxied_host.is_null()) - str->append(proxied_host.get_host(), proxied_host.get_host_len()); - str->append(STRING_WITH_LEN("' TO '")); - if (user) - str->append(user, strlen(user)); - str->append(STRING_WITH_LEN("'@'")); - if (!host.is_null()) - str->append(host.get_host(), host.get_host_len()); - str->append(STRING_WITH_LEN("'")); + str->append(STRING_WITH_LEN("GRANT PROXY ON ")); + String proxied_user_str(proxied_user, get_proxied_user_length(), + system_charset_info); + append_query_string(thd, system_charset_info, &proxied_user_str, str); + str->append(STRING_WITH_LEN("@")); + String proxied_host_str(proxied_host.get_host(), proxied_host.get_host_len(), + system_charset_info); + append_query_string(thd, system_charset_info, &proxied_host_str, str); + str->append(STRING_WITH_LEN(" TO ")); + String user_str(user, get_user_length(), system_charset_info); + append_query_string(thd, system_charset_info, &user_str, str); + str->append(STRING_WITH_LEN("@")); + String host_str(host.get_host(), host.get_host_len(), system_charset_info); + append_query_string(thd, system_charset_info, &host_str, str); if (with_grant) str->append(STRING_WITH_LEN(" WITH GRANT OPTION")); } diff --git a/sql/auth/sql_auth_cache.h b/sql/auth/sql_auth_cache.h index 2954db1256d0..07d42b0f5f38 100644 --- a/sql/auth/sql_auth_cache.h +++ b/sql/auth/sql_auth_cache.h @@ -33,6 +33,7 @@ #include "partitioned_rwlock.h" // Partitioned_rwlock #include "prealloced_array.h" +#include "log_event.h" /* Forward Declarations */ class String; @@ -180,7 +181,7 @@ class ACL_PROXY_USER :public ACL_ACCESS } - void print_grant(String *str); + void print_grant(THD *thd, String *str); void set_data(ACL_PROXY_USER *grant) { @@ -203,6 +204,12 @@ class ACL_PROXY_USER :public ACL_ACCESS const LEX_CSTRING &proxied_user, bool with_grant, const char *grantor); + + size_t get_user_length() const { return user ? strlen(user) : 0; } + + size_t get_proxied_user_length() const { + return proxied_user ? strlen(proxied_user) : 0; + } }; #ifndef NO_EMBEDDED_ACCESS_CHECKS diff --git a/sql/auth/sql_authorization.cc b/sql/auth/sql_authorization.cc index 4d1f0fa4383c..8338d51ff721 100644 --- a/sql/auth/sql_authorization.cc +++ b/sql/auth/sql_authorization.cc @@ -2837,13 +2837,14 @@ static int show_routine_grants(THD* thd, LEX_USER *lex_user, HASH *hash, global.append('.'); append_identifier(thd, &global, grant_proc->tname, strlen(grant_proc->tname)); - global.append(STRING_WITH_LEN(" TO '")); - global.append(lex_user->user.str, lex_user->user.length, - system_charset_info); - global.append(STRING_WITH_LEN("'@'")); + global.append(STRING_WITH_LEN(" TO ")); + String user_str(lex_user->user.str, lex_user->user.length, + system_charset_info); + append_query_string(thd, system_charset_info, &user_str, &global); + global.append(STRING_WITH_LEN("@")); // host and lex_user->host are equal except for case - global.append(host, strlen(host), system_charset_info); - global.append('\''); + String host_str(host, strlen(host), system_charset_info); + append_query_string(thd, system_charset_info, &host_str, &global); if (proc_access & GRANT_ACL) global.append(STRING_WITH_LEN(" WITH GRANT OPTION")); protocol->start_row(); @@ -2873,7 +2874,7 @@ show_proxy_grants(THD *thd, LEX_USER *user, char *buff, size_t buffsize) { String global(buff, buffsize, system_charset_info); global.length(0); - proxy->print_grant(&global); + proxy->print_grant(thd, &global); protocol->start_row(); protocol->store(global.ptr(), global.length(), global.charset()); if (protocol->end_row()) @@ -2996,13 +2997,14 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) } } } - global.append (STRING_WITH_LEN(" ON *.* TO '")); - global.append(lex_user->user.str, lex_user->user.length, - system_charset_info); - global.append (STRING_WITH_LEN("'@'")); - global.append(lex_user->host.str,lex_user->host.length, - system_charset_info); - global.append ('\''); + global.append (STRING_WITH_LEN(" ON *.* TO ")); + String user_str(lex_user->user.str, lex_user->user.length, + system_charset_info); + append_query_string(thd, system_charset_info, &user_str, &global); + global.append(STRING_WITH_LEN("@")); + String host_str(lex_user->host.str, lex_user->host.length, + system_charset_info); + append_query_string(thd, system_charset_info, &host_str, &global); if (want_access & GRANT_ACL) global.append(STRING_WITH_LEN(" WITH GRANT OPTION")); protocol->start_row(); @@ -3061,13 +3063,14 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) } db.append (STRING_WITH_LEN(" ON ")); append_identifier(thd, &db, acl_db->db, strlen(acl_db->db)); - db.append (STRING_WITH_LEN(".* TO '")); - db.append(lex_user->user.str, lex_user->user.length, - system_charset_info); - db.append (STRING_WITH_LEN("'@'")); + db.append (STRING_WITH_LEN(".* TO ")); + String user_str(lex_user->user.str, lex_user->user.length, + system_charset_info); + append_query_string(thd, system_charset_info, &user_str, &db); + db.append(STRING_WITH_LEN("@")); // host and lex_user->host are equal except for case - db.append(host, strlen(host), system_charset_info); - db.append ('\''); + String host_str(host, strlen(host), system_charset_info); + append_query_string(thd, system_charset_info, &host_str, &db); if (want_access & GRANT_ACL) db.append(STRING_WITH_LEN(" WITH GRANT OPTION")); protocol->start_row(); @@ -3175,13 +3178,14 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) global.append('.'); append_identifier(thd, &global, grant_table->tname, strlen(grant_table->tname)); - global.append(STRING_WITH_LEN(" TO '")); - global.append(lex_user->user.str, lex_user->user.length, - system_charset_info); - global.append(STRING_WITH_LEN("'@'")); + global.append(STRING_WITH_LEN(" TO ")); + String user_str(lex_user->user.str, lex_user->user.length, + system_charset_info); + append_query_string(thd, system_charset_info, &user_str, &global); + global.append(STRING_WITH_LEN("@")); // host and lex_user->host are equal except for case - global.append(host, strlen(host), system_charset_info); - global.append('\''); + String host_str(host, strlen(host), system_charset_info); + append_query_string(thd, system_charset_info, &host_str, &global); if (table_access & GRANT_ACL) global.append(STRING_WITH_LEN(" WITH GRANT OPTION")); protocol->start_row(); From 2bc3a17dc567c06763642308f0afd85f5a499d38 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Wed, 27 Oct 2021 10:44:17 +0300 Subject: [PATCH 18/36] Implemented PS-7947 (Merge MySQL 5.7.36) (docs) https://jira.percona.com/browse/PS-7947 *** Updated man pages from MySQL Server 5.7.36 source tarball. *** Updated 'scripts/fill_help_tables.sql' from MySQL Server 5.7.36 source tarball. --- man/comp_err.1 | 4 +-- man/innochecksum.1 | 4 +-- man/lz4_decompress.1 | 4 +-- man/my_print_defaults.1 | 4 +-- man/myisam_ftdump.1 | 4 +-- man/myisamchk.1 | 4 +-- man/myisamlog.1 | 4 +-- man/myisampack.1 | 4 +-- man/mysql.1 | 4 +-- man/mysql.server.1 | 4 +-- man/mysql_config.1 | 4 +-- man/mysql_config_editor.1 | 4 +-- man/mysql_install_db.1 | 4 +-- man/mysql_plugin.1 | 4 +-- man/mysql_secure_installation.1 | 4 +-- man/mysql_ssl_rsa_setup.1 | 4 +-- man/mysql_tzinfo_to_sql.1 | 4 +-- man/mysql_upgrade.1 | 4 +-- man/mysqladmin.1 | 4 +-- man/mysqlbinlog.1 | 4 +-- man/mysqlcheck.1 | 4 +-- man/mysqld.8 | 4 +-- man/mysqld_multi.1 | 4 +-- man/mysqld_safe.1 | 12 +++++-- man/mysqldump.1 | 4 +-- man/mysqlimport.1 | 4 +-- man/mysqlpump.1 | 4 +-- man/mysqlshow.1 | 4 +-- man/mysqlslap.1 | 4 +-- man/ndb_blob_tool.1 | 4 +-- man/ndb_config.1 | 14 ++++---- man/ndb_cpcd.1 | 4 +-- man/ndb_delete_all.1 | 4 +-- man/ndb_desc.1 | 6 ++-- man/ndb_drop_index.1 | 6 ++-- man/ndb_drop_table.1 | 4 +-- man/ndb_error_reporter.1 | 4 +-- man/ndb_import.1 | 23 ++++++++++--- man/ndb_index_stat.1 | 6 ++-- man/ndb_mgm.1 | 12 ++++--- man/ndb_mgmd.8 | 24 ++++++------- man/ndb_move_data.1 | 4 +-- man/ndb_perror.1 | 8 ++--- man/ndb_print_backup_file.1 | 6 ++-- man/ndb_print_file.1 | 6 ++-- 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 | 40 ++++++++++----------- man/ndb_select_all.1 | 8 ++--- 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 | 6 ++-- man/ndb_waiter.1 | 4 +-- man/ndbd.8 | 16 ++++----- man/ndbinfo_select_all.1 | 4 +-- man/ndbmtd.8 | 6 ++-- man/perror.1 | 4 +-- man/replace.1 | 4 +-- man/resolve_stack_dump.1 | 4 +-- man/resolveip.1 | 4 +-- man/zlib_decompress.1 | 4 +-- scripts/fill_help_tables.sql | 61 ++++++++++++++++----------------- 66 files changed, 241 insertions(+), 217 deletions(-) diff --git a/man/comp_err.1 b/man/comp_err.1 index f2c85e0a2814..430860471af1 100644 --- a/man/comp_err.1 +++ b/man/comp_err.1 @@ -2,12 +2,12 @@ .\" Title: comp_err .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "COMP_ERR" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "COMP_ERR" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/innochecksum.1 b/man/innochecksum.1 index 3c08164f58fc..279feca31cb6 100644 --- a/man/innochecksum.1 +++ b/man/innochecksum.1 @@ -2,12 +2,12 @@ .\" Title: innochecksum .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "INNOCHECKSUM" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "INNOCHECKSUM" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/lz4_decompress.1 b/man/lz4_decompress.1 index 929dce42905f..c304bfe4e802 100644 --- a/man/lz4_decompress.1 +++ b/man/lz4_decompress.1 @@ -2,12 +2,12 @@ .\" Title: lz4_decompress .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "LZ4_DECOMPRESS" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "LZ4_DECOMPRESS" "1" "09/06/2021" "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 8cc758159175..32cb2dcc2812 100644 --- a/man/my_print_defaults.1 +++ b/man/my_print_defaults.1 @@ -2,12 +2,12 @@ .\" Title: my_print_defaults .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MY_PRINT_DEFAULTS" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MY_PRINT_DEFAULTS" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisam_ftdump.1 b/man/myisam_ftdump.1 index 59b055ad0f1d..dad110da6743 100644 --- a/man/myisam_ftdump.1 +++ b/man/myisam_ftdump.1 @@ -2,12 +2,12 @@ .\" Title: myisam_ftdump .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYISAM_FTDUMP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYISAM_FTDUMP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisamchk.1 b/man/myisamchk.1 index 73093508d7f3..c6fb28233abc 100644 --- a/man/myisamchk.1 +++ b/man/myisamchk.1 @@ -2,12 +2,12 @@ .\" Title: myisamchk .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYISAMCHK" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYISAMCHK" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisamlog.1 b/man/myisamlog.1 index bd79209ae786..9eb65227d3f4 100644 --- a/man/myisamlog.1 +++ b/man/myisamlog.1 @@ -2,12 +2,12 @@ .\" Title: myisamlog .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYISAMLOG" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYISAMLOG" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/myisampack.1 b/man/myisampack.1 index c791ead82f7c..bf810f79abea 100644 --- a/man/myisampack.1 +++ b/man/myisampack.1 @@ -2,12 +2,12 @@ .\" Title: myisampack .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYISAMPACK" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYISAMPACK" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql.1 b/man/mysql.1 index 2bf7bfac86ef..0f254f545b69 100644 --- a/man/mysql.1 +++ b/man/mysql.1 @@ -2,12 +2,12 @@ .\" Title: mysql .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql.server.1 b/man/mysql.server.1 index ce35c2de8ee5..93f02093474a 100644 --- a/man/mysql.server.1 +++ b/man/mysql.server.1 @@ -2,12 +2,12 @@ .\" Title: mysql.server .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL\&.SERVER" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL\&.SERVER" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_config.1 b/man/mysql_config.1 index 6c3ebee14cc1..485145571c86 100644 --- a/man/mysql_config.1 +++ b/man/mysql_config.1 @@ -2,12 +2,12 @@ .\" Title: mysql_config .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_CONFIG" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_CONFIG" "1" "09/06/2021" "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 7d628ce7955f..a09e4c5cbba7 100644 --- a/man/mysql_config_editor.1 +++ b/man/mysql_config_editor.1 @@ -2,12 +2,12 @@ .\" Title: mysql_config_editor .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_CONFIG_EDITOR" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_CONFIG_EDITOR" "1" "09/06/2021" "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 efc7ecc2460f..3c62972ba339 100644 --- a/man/mysql_install_db.1 +++ b/man/mysql_install_db.1 @@ -2,12 +2,12 @@ .\" Title: mysql_install_db .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_INSTALL_DB" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_INSTALL_DB" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1 index 7e65b4f4445e..849aad4e4b1a 100644 --- a/man/mysql_plugin.1 +++ b/man/mysql_plugin.1 @@ -2,12 +2,12 @@ .\" Title: mysql_plugin .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_PLUGIN" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_PLUGIN" "1" "09/06/2021" "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 568e8cc4ebb9..fa9347c16344 100644 --- a/man/mysql_secure_installation.1 +++ b/man/mysql_secure_installation.1 @@ -2,12 +2,12 @@ .\" Title: mysql_secure_installation .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_SECURE_INSTALLATION" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_SECURE_INSTALLATION" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_ssl_rsa_setup.1 b/man/mysql_ssl_rsa_setup.1 index 56edaa43905e..9c56c5db7227 100644 --- a/man/mysql_ssl_rsa_setup.1 +++ b/man/mysql_ssl_rsa_setup.1 @@ -2,12 +2,12 @@ .\" Title: mysql_ssl_rsa_setup .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_SSL_RSA_SETUP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_SSL_RSA_SETUP" "1" "09/06/2021" "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 0286cf92a8a8..049b94f570b3 100644 --- a/man/mysql_tzinfo_to_sql.1 +++ b/man/mysql_tzinfo_to_sql.1 @@ -2,12 +2,12 @@ .\" Title: mysql_tzinfo_to_sql .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_TZINFO_TO_SQL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_TZINFO_TO_SQL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index 7350fd069190..23feb8270db3 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -2,12 +2,12 @@ .\" Title: mysql_upgrade .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQL_UPGRADE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQL_UPGRADE" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqladmin.1 b/man/mysqladmin.1 index fe08ae8184b0..f179ef404202 100644 --- a/man/mysqladmin.1 +++ b/man/mysqladmin.1 @@ -2,12 +2,12 @@ .\" Title: mysqladmin .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLADMIN" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLADMIN" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1 index 45c2ffc1d8a7..0e3b651f2484 100644 --- a/man/mysqlbinlog.1 +++ b/man/mysqlbinlog.1 @@ -2,12 +2,12 @@ .\" Title: mysqlbinlog .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLBINLOG" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLBINLOG" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1 index 7bc2c521f830..accf29616594 100644 --- a/man/mysqlcheck.1 +++ b/man/mysqlcheck.1 @@ -2,12 +2,12 @@ .\" Title: mysqlcheck .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLCHECK" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLCHECK" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqld.8 b/man/mysqld.8 index 18c5200de40b..d95c426c6025 100644 --- a/man/mysqld.8 +++ b/man/mysqld.8 @@ -2,12 +2,12 @@ .\" Title: mysqld .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLD" "8" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLD" "8" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1 index 8511838297da..17c4146fa106 100644 --- a/man/mysqld_multi.1 +++ b/man/mysqld_multi.1 @@ -2,12 +2,12 @@ .\" Title: mysqld_multi .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLD_MULTI" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLD_MULTI" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1 index bc58d16c1e7f..9bf37bb81524 100644 --- a/man/mysqld_safe.1 +++ b/man/mysqld_safe.1 @@ -2,12 +2,12 @@ .\" Title: mysqld_safe .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLD_SAFE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLD_SAFE" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -57,6 +57,14 @@ For some Linux platforms, MySQL installation from RPM or Debian packages include \fBmysqld_safe\fR is not installed because it is unnecessary\&. For more information, see Section\ \&2.5.10, \(lqManaging MySQL Server with systemd\(rq\&. +.PP +One implication of the non\-use of +\fBmysqld_safe\fR +on platforms that use systemd for server management is that use of +[mysqld_safe] +or +[safe_mysqld] +sections in option files is not supported and might lead to unexpected behavior\&. .sp .5v .RE .PP diff --git a/man/mysqldump.1 b/man/mysqldump.1 index aabd404b5ab2..9a5985c00357 100644 --- a/man/mysqldump.1 +++ b/man/mysqldump.1 @@ -2,12 +2,12 @@ .\" Title: mysqldump .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLDUMP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLDUMP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlimport.1 b/man/mysqlimport.1 index a8996e9ec333..991dbb98812e 100644 --- a/man/mysqlimport.1 +++ b/man/mysqlimport.1 @@ -2,12 +2,12 @@ .\" Title: mysqlimport .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLIMPORT" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLIMPORT" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlpump.1 b/man/mysqlpump.1 index b4ab46db64ed..fc9ca0fb569a 100644 --- a/man/mysqlpump.1 +++ b/man/mysqlpump.1 @@ -2,12 +2,12 @@ .\" Title: mysqlpump .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLPUMP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLPUMP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlshow.1 b/man/mysqlshow.1 index f52965927a9e..2ff69d8bdcbf 100644 --- a/man/mysqlshow.1 +++ b/man/mysqlshow.1 @@ -2,12 +2,12 @@ .\" Title: mysqlshow .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLSHOW" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLSHOW" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/mysqlslap.1 b/man/mysqlslap.1 index a26e89de9f05..918b768d7102 100644 --- a/man/mysqlslap.1 +++ b/man/mysqlslap.1 @@ -2,12 +2,12 @@ .\" Title: mysqlslap .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "MYSQLSLAP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "MYSQLSLAP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_blob_tool.1 b/man/ndb_blob_tool.1 index 566398482f1e..431c167256c4 100644 --- a/man/ndb_blob_tool.1 +++ b/man/ndb_blob_tool.1 @@ -2,12 +2,12 @@ .\" Title: ndb_blob_tool .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_BLOB_TOOL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_BLOB_TOOL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_config.1 b/man/ndb_config.1 index dde1f7f24663..0f5acce4cd9c 100644 --- a/man/ndb_config.1 +++ b/man/ndb_config.1 @@ -2,12 +2,12 @@ .\" Title: ndb_config .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_CONFIG" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_CONFIG" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -714,8 +714,8 @@ information only\(emthat is, information about parameters found in the [shm], or [shm default] sections of the cluster configuration file (see -Section\ \&21.3.3.10, \(lqNDB Cluster TCP/IP Connections\(rq, and -Section\ \&21.3.3.12, \(lqNDB Cluster Shared Memory Connections\(rq, for more information)\&. +Section\ \&21.4.3.10, \(lqNDB Cluster TCP/IP Connections\(rq, and +Section\ \&21.4.3.12, \(lqNDB Cluster Shared Memory Connections\(rq, for more information)\&. .sp This option is mutually exclusive with \fB\-\-nodes\fR @@ -1260,7 +1260,7 @@ T} .TE .sp 1 Specifies the connection string to use in connecting to the management server\&. The format for the connection string is the same as described in -Section\ \&21.3.3.3, \(lqNDB Cluster Connection Strings\(rq, and defaults to +Section\ \&21.4.3.3, \(lqNDB Cluster Connection Strings\(rq, and defaults to localhost:1186\&. .RE .sp @@ -1455,7 +1455,7 @@ to print information relating only to parameters defined in an or [ndbd default] section of the cluster configuration file (see -Section\ \&21.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq)\&. +Section\ \&21.4.3.6, \(lqDefining NDB Cluster Data Nodes\(rq)\&. .sp This option is mutually exclusive with \fB\-\-connections\fR @@ -1839,7 +1839,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 9febb49bfa4c..b5192241a74d 100644 --- a/man/ndb_cpcd.1 +++ b/man/ndb_cpcd.1 @@ -2,12 +2,12 @@ .\" Title: ndb_cpcd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_CPCD" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_CPCD" "1" "09/06/2021" "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 873d0bbe30cc..2990c9f8a0d5 100644 --- a/man/ndb_delete_all.1 +++ b/man/ndb_delete_all.1 @@ -2,12 +2,12 @@ .\" Title: ndb_delete_all .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_DELETE_ALL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_DELETE_ALL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_desc.1 b/man/ndb_desc.1 index 295ac9079970..d020837e4341 100644 --- a/man/ndb_desc.1 +++ b/man/ndb_desc.1 @@ -2,12 +2,12 @@ .\" Title: ndb_desc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_DESC" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_DESC" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -368,7 +368,7 @@ ALTER TABLESPACE ts_1 .\} .PP (For more information on the statements just shown and the objects created by them, see -Section\ \&21.5.10.1, \(lqNDB Cluster Disk Data Objects\(rq, as well as +Section\ \&21.6.10.1, \(lqNDB Cluster Disk Data Objects\(rq, as well as Section\ \&13.1.15, \(lqCREATE LOGFILE GROUP Statement\(rq, and Section\ \&13.1.19, \(lqCREATE TABLESPACE Statement\(rq\&.) .PP diff --git a/man/ndb_drop_index.1 b/man/ndb_drop_index.1 index 88677137438d..74f59ce48e80 100644 --- a/man/ndb_drop_index.1 +++ b/man/ndb_drop_index.1 @@ -2,12 +2,12 @@ .\" Title: ndb_drop_index .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_DROP_INDEX" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_DROP_INDEX" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -898,7 +898,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\&.33\-ndb\-7\&.5\&.23 +Your MySQL connection id is 7 to server version: 5\&.7\&.35\-ndb\-7\&.5\&.24 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 c6f2ed833948..076f7323a67b 100644 --- a/man/ndb_drop_table.1 +++ b/man/ndb_drop_table.1 @@ -2,12 +2,12 @@ .\" Title: ndb_drop_table .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_DROP_TABLE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_DROP_TABLE" "1" "09/06/2021" "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 bded5ff372e4..9588d341844e 100644 --- a/man/ndb_error_reporter.1 +++ b/man/ndb_error_reporter.1 @@ -2,12 +2,12 @@ .\" Title: ndb_error_reporter .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_ERROR_REPORTER" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_ERROR_REPORTER" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_import.1 b/man/ndb_import.1 index 65e21db2426c..f8d01932cbba 100644 --- a/man/ndb_import.1 +++ b/man/ndb_import.1 @@ -2,12 +2,12 @@ .\" Title: ndb_import .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_IMPORT" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_IMPORT" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -3556,11 +3556,24 @@ T}:T{ T} .TE .sp 1 -NDB 7\&.6\&.4 and later: Enable verbose output\&. +Enable verbose output\&. +.if n \{\ .sp -Previously, this option controlled the internal logging level for debugging messages\&. In NDB 7\&.6\&.4 and later, use the +.\} +.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 +Previously, this option controlled the internal logging level for debugging messages\&. In NDB 7\&.6, use the \fB\-\-log\-level\fR option for this purpose instead\&. +.sp .5v +.RE .RE .sp .RS 4 @@ -3600,7 +3613,7 @@ STARTING WITH option\&. .PP \fBndb_import\fR -was added in NDB 7\&.6\&.2\&. +was added in NDB 7\&.6\&. .SH "COPYRIGHT" .br .PP diff --git a/man/ndb_index_stat.1 b/man/ndb_index_stat.1 index 2e6a220eec42..7dd2365367d7 100644 --- a/man/ndb_index_stat.1 +++ b/man/ndb_index_stat.1 @@ -2,12 +2,12 @@ .\" Title: ndb_index_stat .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_INDEX_STAT" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_INDEX_STAT" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1360,7 +1360,7 @@ Create all statistics tables and events in the NDB kernel\&. This works only if .sp -1 .IP \(bu 2.3 .\} -\fBsys\-create\-if\-not\-exist\fR +\fB\-\-sys\-create\-if\-not\-exist\fR .TS allbox tab(:); lB l diff --git a/man/ndb_mgm.1 b/man/ndb_mgm.1 index 4cbc80356064..e0fef17c7aee 100644 --- a/man/ndb_mgm.1 +++ b/man/ndb_mgm.1 @@ -2,12 +2,12 @@ .\" Title: ndb_mgm .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_MGM" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_MGM" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -728,7 +728,11 @@ T}:T{ T} .TE .sp 1 -Set connect string for connecting to ndb_mgmd\&. Syntax: "[nodeid=id;][host=]hostname[:port]"\&. Overrides entries in NDB_CONNECTSTRING and my\&.cnf\&. +Set connect string for connecting to +\fBndb_mgmd\fR\&. Syntax: [nodeid=\fIid\fR;][host=]\fIhostname\fR[:\fIport\fR]\&. Overrides entries in +NDB_CONNECTSTRING +and +my\&.cnf\&. .RE .sp .RS 4 @@ -986,7 +990,7 @@ Display version information and exit\&. Additional information about using \fBndb_mgm\fR can be found in -Section\ \&21.5.1, \(lqCommands in the NDB Cluster Management Client\(rq\&. +Section\ \&21.6.1, \(lqCommands in the NDB Cluster Management Client\(rq\&. .SH "COPYRIGHT" .br .PP diff --git a/man/ndb_mgmd.8 b/man/ndb_mgmd.8 index 82a2a4c393f4..1fd3a7db58b1 100644 --- a/man/ndb_mgmd.8 +++ b/man/ndb_mgmd.8 @@ -2,12 +2,12 @@ .\" Title: ndb_mgmd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_MGMD" "8" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_MGMD" "8" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -547,7 +547,7 @@ TRUE, or ON), can be used to disable the management server\*(Aqs configuration cache, so that it reads its configuration from config\&.ini every time it starts (see -Section\ \&21.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. You can do this by starting the +Section\ \&21.4.3, \(lqNDB Cluster Configuration Files\(rq)\&. You can do this by starting the \fBndb_mgmd\fR process with any one of the following options: .sp @@ -714,7 +714,7 @@ option is also read if \fBndb_mgmd\fR was started with \fB\-\-config\-cache=OFF\fR\&. See -Section\ \&21.3.3, \(lqNDB Cluster Configuration Files\(rq, for more information\&. +Section\ \&21.4.3, \(lqNDB Cluster Configuration Files\(rq, for more information\&. .RE .sp .RS 4 @@ -1102,7 +1102,7 @@ T} .TE .sp 1 Configuration data is cached internally, rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&21.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using the +Section\ \&21.4.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using the \fB\-\-initial\fR option overrides this behavior, by forcing the management server to delete any existing cache files, and then to re\-read the configuration data from the cluster configuration file and to build a new cache\&. .sp @@ -1121,7 +1121,7 @@ is invoked with but cannot find a global configuration file, the management server cannot start\&. .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\&. This behavior has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See -Section\ \&21.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&. +Section\ \&21.6.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&. .sp When used together with the \fB\-\-config\-file\fR @@ -1684,7 +1684,7 @@ shell> \fBndbd \-c 198\&.51\&.100\&.150,198\&.51\&.100\&.151\fR The same is true with regard to the connection string used with any \fBmysqld\fR processes that you wish to start as NDB Cluster SQL nodes connected to this cluster\&. See -Section\ \&21.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for more information\&. +Section\ \&21.4.3.3, \(lqNDB Cluster Connection Strings\(rq, for more information\&. .sp When used with \fBndb_mgmd\fR, this option affects the behavior of the management node with regard to other management nodes only\&. Do not confuse it with the @@ -1808,7 +1808,7 @@ T} .TE .sp 1 NDB Cluster configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&21.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\&. +Section\ \&21.4.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 This differs in two ways from the \fB\-\-initial\fR @@ -1827,7 +1827,7 @@ When is used, the management server must be able to communicate with data nodes and any other management servers in the cluster before it attempts to read the global configuration file; otherwise, the management server fails to start\&. This can happen due to changes in the networking environment, such as new IP addresses for nodes or an altered firewall configuration\&. In such cases, you must use \fB\-\-initial\fR instead to force the exsiting cached configuration to be discarded and reloaded from the file\&. See -Section\ \&21.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for additional information\&. +Section\ \&21.6.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for additional information\&. .RE .sp .RS 4 @@ -1991,7 +1991,7 @@ Display version information and exit\&. 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\ \&21.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for information about using connection strings\&. +Section\ \&21.4.3.3, \(lqNDB Cluster Connection Strings\(rq, for information about using connection strings\&. ndb_mgmd(8), describes other options for \fBndb_mgmd\fR\&. .PP @@ -2015,7 +2015,7 @@ is the unique node identifier\&. .\} 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\ \&21.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up this file\&. +Section\ \&21.4, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up this file\&. .RE .sp .RS 4 @@ -2028,7 +2028,7 @@ Section\ \&21.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up t .\} 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\ \&21.5, \(lqManagement of NDB Cluster\(rq\&. +Section\ \&21.6, \(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 diff --git a/man/ndb_move_data.1 b/man/ndb_move_data.1 index d6b820c66aeb..9500c20fb3a3 100644 --- a/man/ndb_move_data.1 +++ b/man/ndb_move_data.1 @@ -2,12 +2,12 @@ .\" Title: ndb_move_data .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_MOVE_DATA" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_MOVE_DATA" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_perror.1 b/man/ndb_perror.1 index 269c833fe43b..1401641f0d0c 100644 --- a/man/ndb_perror.1 +++ b/man/ndb_perror.1 @@ -2,12 +2,12 @@ .\" Title: ndb_perror .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_PERROR" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_PERROR" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,7 +35,7 @@ ndb_perror \- obtain NDB error message information .SH "DESCRIPTION" .PP \fBndb_perror\fR -shows information about an NDB error, given its error code\&. This includes the error message, the type of error, and whether the error is permanent or temporary\&. Added to the MySQL NDB Cluster distribution in NDB 7\&.6\&.4, it is intended as a drop\-in replacement for +shows information about an NDB error, given its error code\&. This includes the error message, the type of error, and whether the error is permanent or temporary\&. Added to the MySQL NDB Cluster distribution in NDB 7\&.6, it is intended as a drop\-in replacement for \fBperror\fR \fB\-\-ndb\fR\&. Usage @@ -106,7 +106,7 @@ are described later in this section\&. \fBndb_perror\fR replaces \fBperror\fR -\fB\-\-ndb\fR, which is deprecated as of NDB 7\&.6\&.4 and subject to removal in a future release of MySQL NDB Cluster\&. To make substitution easier in scripts and other applications that might depend on +\fB\-\-ndb\fR, which is deprecated in NDB 7\&.6 and subject to removal in a future release of MySQL NDB Cluster\&. To make substitution easier in scripts and other applications that might depend on \fBperror\fR for obtaining NDB error information, \fBndb_perror\fR diff --git a/man/ndb_print_backup_file.1 b/man/ndb_print_backup_file.1 index 0c5f1ef34843..09f1a64992d2 100644 --- a/man/ndb_print_backup_file.1 +++ b/man/ndb_print_backup_file.1 @@ -2,12 +2,12 @@ .\" Title: ndb_print_backup_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_PRINT_BACKUP_FILE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_PRINT_BACKUP_FILE" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -56,7 +56,7 @@ file) found in a cluster backup directory\&. These files are found in the data n BACKUP\-\fI#\fR, where \fI#\fR is the sequence number for the backup\&. For more information about cluster backup files and their contents, see -Section\ \&21.5.8.1, \(lqNDB Cluster Backup Concepts\(rq\&. +Section\ \&21.6.8.1, \(lqNDB Cluster Backup Concepts\(rq\&. .PP Like \fBndb_print_schema_file\fR diff --git a/man/ndb_print_file.1 b/man/ndb_print_file.1 index 5661ac22de3d..14892c470f70 100644 --- a/man/ndb_print_file.1 +++ b/man/ndb_print_file.1 @@ -2,12 +2,12 @@ .\" Title: ndb_print_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_PRINT_FILE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_PRINT_FILE" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -101,7 +101,7 @@ supports the following options: .RE .PP For more information, see -Section\ \&21.5.10, \(lqNDB Cluster Disk Data Tables\(rq\&. +Section\ \&21.6.10, \(lqNDB Cluster Disk Data Tables\(rq\&. .SH "COPYRIGHT" .br .PP diff --git a/man/ndb_print_frag_file.1 b/man/ndb_print_frag_file.1 index 75e038a225d2..34dda27fb1f8 100644 --- a/man/ndb_print_frag_file.1 +++ b/man/ndb_print_frag_file.1 @@ -2,12 +2,12 @@ .\" Title: ndb_print_frag_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_PRINT_FRAG_FILE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_PRINT_FRAG_FILE" "1" "09/06/2021" "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 4ab4c1148fa3..57797ab43bd0 100644 --- a/man/ndb_print_schema_file.1 +++ b/man/ndb_print_schema_file.1 @@ -2,12 +2,12 @@ .\" Title: ndb_print_schema_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_PRINT_SCHEMA_FILE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_PRINT_SCHEMA_FILE" "1" "09/06/2021" "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 fde1a6f5d802..97161ce4b4a9 100644 --- a/man/ndb_print_sys_file.1 +++ b/man/ndb_print_sys_file.1 @@ -2,12 +2,12 @@ .\" Title: ndb_print_sys_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_PRINT_SYS_FILE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_PRINT_SYS_FILE" "1" "09/06/2021" "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 5affd86998c9..098bc666e68c 100644 --- a/man/ndb_redo_log_reader.1 +++ b/man/ndb_redo_log_reader.1 @@ -2,12 +2,12 @@ .\" Title: ndb_redo_log_reader .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_REDO_LOG_READER" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_REDO_LOG_READER" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_restore.1 b/man/ndb_restore.1 index d0c064051949..0673b7b41f50 100644 --- a/man/ndb_restore.1 +++ b/man/ndb_restore.1 @@ -2,12 +2,12 @@ .\" Title: ndb_restore .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_RESTORE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_RESTORE" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -61,7 +61,7 @@ when it finishes its run\&. Applications depending on this behavior should be mo must be executed once for each of the backup files that were created by the START BACKUP command used to create the backup (see -Section\ \&21.5.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq)\&. This is equal to the number of data nodes in the cluster at the time that the backup was created\&. +Section\ \&21.6.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq)\&. This is equal to the number of data nodes in the cluster at the time that the backup was created\&. .if n \{\ .sp .\} @@ -77,7 +77,7 @@ Section\ \&21.5.8.2, \(lqUsing The NDB Cluster Management Client to Create a Bac .PP Before using \fBndb_restore\fR, it is recommended that the cluster be running in single user mode, unless you are restoring multiple data nodes in parallel\&. See -Section\ \&21.5.6, \(lqNDB Cluster Single User Mode\(rq, for more information\&. +Section\ \&21.6.6, \(lqNDB Cluster Single User Mode\(rq, for more information\&. .sp .5v .RE .PP @@ -542,8 +542,7 @@ T{ .PP \fB \fR\fB-z\fR\fB \fR T}:T{ -Nodegroup map for NDBCLUSTER storage engine; syntax: list of - (source_nodegroup, destination_nodegroup) +Specify node group map; unused, unsupported T}:T{ .PP (Supported in all NDB releases based on MySQL 5.7) @@ -1131,7 +1130,7 @@ and must be run twice\(emonce for each storage node in the cluster where the backup was taken\&. However, \fBndb_restore\fR cannot always restore backups made from a cluster running one version of MySQL to a cluster running a different MySQL version\&. See -Section\ \&21.2.7, \(lqUpgrading and Downgrading NDB Cluster\(rq, for more information\&. +Section\ \&21.3.7, \(lqUpgrading and Downgrading NDB Cluster\(rq, for more information\&. .if n \{\ .sp .\} @@ -1149,9 +1148,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\&.5\&.23 to a cluster running NDB Cluster 7\&.4\&.33, you must use the +For example, to restore a cluster backup taken from a cluster running NDB Cluster 7\&.5\&.24 to a cluster running NDB Cluster 7\&.4\&.33, you must use the \fBndb_restore\fR -that comes with the NDB Cluster 7\&.5\&.23 distribution\&. +that comes with the NDB Cluster 7\&.5\&.24 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 @@ -1200,7 +1199,7 @@ T} This option is used to specify the ID or sequence number of the backup, and is the same number shown by the management client in the Backup \fIbackup_id\fR completed message displayed upon completion of a backup\&. (See -Section\ \&21.5.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq\&.) +Section\ \&21.6.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq\&.) .if n \{\ .sp .\} @@ -1551,6 +1550,8 @@ 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 multithreaded building of indexes using \fB\-\-rebuild\-indexes\fR, which should be faster than rebuilding indexes concurrently for very large tables\&. +.sp +Beginning with NDB 7\&.5\&.24 and NDB 7\&.6\&.20, this option also drops any foreign keys specified in the backup\&. .RE .sp .RS 4 @@ -2563,8 +2564,7 @@ T}:T{ T} .TE .sp 1 -This option can be used to restore a backup taken from one node group to a different node group\&. Its argument is a list of the form -\fIsource_node_group\fR, \fItarget_node_group\fR\&. +Intended for restoring a backup taken from one node group to a different node group, but never completely implemented; unsupported\&. .RE .sp .RS 4 @@ -2707,7 +2707,7 @@ T} This option stops \fBndb_restore\fR from restoring any NDB Cluster Disk Data objects, such as tablespaces and log file groups; see -Section\ \&21.5.10, \(lqNDB Cluster Disk Data Tables\(rq, for more information about these\&. +Section\ \&21.6.10, \(lqNDB Cluster Disk Data Tables\(rq, for more information about these\&. .RE .sp .RS 4 @@ -3584,7 +3584,7 @@ BIGINT, and the option attempts to apply an offset value of 8 on a row in which .RE .sp This option can be useful when you wish to merge data stored in multiple source instances of NDB Cluster (all using the same schema) into a single destination NDB Cluster, using NDB native backup (see -Section\ \&21.5.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq) and +Section\ \&21.6.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq) and \fBndb_restore\fR to merge the data, where primary and unique key values are overlapping between source clusters, and it is necessary as part of the process to remap these values to ranges that do not overlap\&. It may also be necessary to preserve other relationships between tables\&. To fulfill such requirements, it is possible to use the option multiple times in the same invocation of \fBndb_restore\fR @@ -3696,7 +3696,7 @@ having in the id column is updated if it already exists; such a row is inserted if it does not already exist\&. (See -Section\ \&21.6.9, \(lqNDB Cluster Backups With NDB Cluster Replication\(rq\&.) +Section\ \&21.7.9, \(lqNDB Cluster Backups With NDB Cluster Replication\(rq\&.) .RE .sp .RS 4 @@ -3804,7 +3804,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.12, \(lqDistributed Privileges Using Shared Grant Tables\(rq\&. +Section\ \&21.6.12, \(lqDistributed Privileges Using Shared Grant Tables\(rq\&. .RE .sp .RS 4 @@ -4262,7 +4262,7 @@ The option is used to specify a connection string which tells ndb_restore where to locate the cluster management server (see -Section\ \&21.3.3.3, \(lqNDB Cluster Connection Strings\(rq)\&. If this option is not used, then +Section\ \&21.4.3.3, \(lqNDB Cluster Connection Strings\(rq)\&. If this option is not used, then \fBndb_restore\fR attempts to connect to a management server on localhost:1186\&. This utility acts as a cluster API node, and so requires a free connection @@ -4280,7 +4280,7 @@ or section in config\&.ini that is not being used for a MySQL server or other application for this reason (see -Section\ \&21.3.3.7, \(lqDefining SQL and Other API Nodes in an NDB Cluster\(rq)\&. +Section\ \&21.4.3.7, \(lqDefining SQL and Other API Nodes in an NDB Cluster\(rq)\&. .PP You can verify that \fBndb_restore\fR @@ -4330,7 +4330,7 @@ START SLAVE\&. This is a known issue in NDB Cluster\&. The following two sections provide information about restoring a native NDB backup to a different version of NDB Cluster from the version in which the backup was taken\&. .PP In addition, you should consult -Section\ \&21.2.7, \(lqUpgrading and Downgrading NDB Cluster\(rq, for other issues you may encounter when attempting to restore an NDB backup to a cluster running a different version of the NDB software\&. +Section\ \&21.3.7, \(lqUpgrading and Downgrading NDB Cluster\(rq, for other issues you may encounter when attempting to restore an NDB backup to a cluster running a different version of the NDB software\&. .PP It is also advisable to review \m[blue]\fBWhat is New in NDB Cluster 8\&.0\fR\m[]\&\s-2\u[1]\d\s+2, as well as @@ -4578,7 +4578,7 @@ or the equivalent\&. .IP " 2." 4.2 .\} Perform a backup in the normal manner\&. See -Section\ \&21.5.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq, for information about how to do this\&. +Section\ \&21.6.8.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq, for information about how to do this\&. .RE .sp .RS 4 diff --git a/man/ndb_select_all.1 b/man/ndb_select_all.1 index 02ec052c9f62..7d92790e5253 100644 --- a/man/ndb_select_all.1 +++ b/man/ndb_select_all.1 @@ -2,12 +2,12 @@ .\" Title: ndb_select_all .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_SELECT_ALL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_SELECT_ALL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -773,8 +773,8 @@ Adds a disk reference column to the output\&. The column is nonempty only for Di Adds a GCI column to the output showing the global checkpoint at which each row was last updated\&. See -Section\ \&21.1, \(lqNDB Cluster Overview\(rq, and -Section\ \&21.5.3.2, \(lqNDB Cluster Log Events\(rq, for more information about checkpoints\&. +Section\ \&21.2, \(lqNDB Cluster Overview\(rq, and +Section\ \&21.6.3.2, \(lqNDB Cluster Log Events\(rq, for more information about checkpoints\&. .RE .sp .RS 4 diff --git a/man/ndb_select_count.1 b/man/ndb_select_count.1 index 4f1bcb221e9c..7c3373cbaaad 100644 --- a/man/ndb_select_count.1 +++ b/man/ndb_select_count.1 @@ -2,12 +2,12 @@ .\" Title: ndb_select_count .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_SELECT_COUNT" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_SELECT_COUNT" "1" "09/06/2021" "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 02fb766daa3b..b52ccc2d3df8 100644 --- a/man/ndb_setup.py.1 +++ b/man/ndb_setup.py.1 @@ -2,12 +2,12 @@ .\" Title: ndb_setup.py .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_SETUP\&.PY" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_SETUP\&.PY" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -75,7 +75,7 @@ or other administrative account\&. This section describes usage of and program options for the command\-line tool only\&. For information about using the Auto\-Installer GUI that is spawned when \fBndb_setup\&.py\fR is invoked, see -Section\ \&21.2.8, \(lqThe NDB Cluster Auto-Installer (NDB 7.5) (No longer supported)\(rq\&. +Section\ \&21.3.8, \(lqThe NDB Cluster Auto-Installer (NDB 7.5) (No longer supported)\(rq\&. Usage .PP All platforms: diff --git a/man/ndb_show_tables.1 b/man/ndb_show_tables.1 index aebeb8cdf9be..eef607fe924f 100644 --- a/man/ndb_show_tables.1 +++ b/man/ndb_show_tables.1 @@ -2,12 +2,12 @@ .\" Title: ndb_show_tables .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_SHOW_TABLES" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_SHOW_TABLES" "1" "09/06/2021" "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 8ea37a1fc214..565861d5ffc0 100644 --- a/man/ndb_size.pl.1 +++ b/man/ndb_size.pl.1 @@ -2,12 +2,12 @@ .\" Title: ndb_size.pl .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_SIZE\&.PL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_SIZE\&.PL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndb_top.1 b/man/ndb_top.1 index 900f828370af..db04d21f8c3d 100644 --- a/man/ndb_top.1 +++ b/man/ndb_top.1 @@ -2,12 +2,12 @@ .\" Title: ndb_top .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_TOP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_TOP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -38,7 +38,7 @@ ndb_top \- View CPU usage information for NDB threads displays running information in the terminal about CPU usage by NDB threads on an NDB Cluster data node\&. Each thread is represented by two rows in the output, the first showing system statistics, the second showing the measured statistics for the thread\&. .PP \fBndb_top\fR -is available beginning with MySQL NDB Cluster 7\&.6\&.3\&. +is available in MySQL NDB Cluster 7\&.6 (and later)\&. Usage .sp .if n \{\ diff --git a/man/ndb_waiter.1 b/man/ndb_waiter.1 index b7ff5756cdac..71d97702ddf1 100644 --- a/man/ndb_waiter.1 +++ b/man/ndb_waiter.1 @@ -2,12 +2,12 @@ .\" Title: ndb_waiter .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDB_WAITER" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDB_WAITER" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndbd.8 b/man/ndbd.8 index 54e78b79b22f..8a48c1d44d5f 100644 --- a/man/ndbd.8 +++ b/man/ndbd.8 @@ -2,12 +2,12 @@ .\" Title: ndbd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDBD" "8" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDBD" "8" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1063,7 +1063,7 @@ Backup files that have already been created by the affected node .IP \(bu 2.3 .\} NDB Cluster Disk Data files (see -Section\ \&21.5.10, \(lqNDB Cluster Disk Data Tables\(rq)\&. +Section\ \&21.6.10, \(lqNDB Cluster Disk Data Tables\(rq)\&. .RE .sp This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running\&. This recovery of data occurs automatically, and requires no user intervention in an NDB Cluster that is running normally\&. @@ -1532,7 +1532,7 @@ not to start automatically\&. When this option is used, 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\ \&21.5.1, \(lqCommands in the NDB Cluster Management Client\(rq)\&. +Section\ \&21.6.1, \(lqCommands in the NDB Cluster Management Client\(rq)\&. .RE .sp .RS 4 @@ -1686,7 +1686,7 @@ Display help text and exit; same as \fB\-v\fR Causes extra debug output to be written to the node log\&. .sp -In NDB 7\&.6\&.4 and later, you can also use +In NDB 7\&.6, you can also use NODELOG DEBUG ON and NODELOG DEBUG OFF @@ -1878,8 +1878,8 @@ shell> \fBndbd \-\-connect\-string="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\f .\} .PP See -Section\ \&21.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for additional information about this issue\&. For more information about data node configuration parameters, see -Section\ \&21.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq\&. +Section\ \&21.4.3.3, \(lqNDB Cluster Connection Strings\(rq, for additional information about this issue\&. For more information about data node configuration parameters, see +Section\ \&21.4.3.6, \(lqDefining NDB Cluster Data Nodes\(rq\&. .PP When \fBndbd\fR @@ -1903,7 +1903,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.7, \(lqKnown Limitations of NDB Cluster\(rq\&. +Section\ \&21.2.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 d6f1533e26e1..db25333b6ea6 100644 --- a/man/ndbinfo_select_all.1 +++ b/man/ndbinfo_select_all.1 @@ -2,12 +2,12 @@ .\" Title: ndbinfo_select_all .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDBINFO_SELECT_ALL" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDBINFO_SELECT_ALL" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/ndbmtd.8 b/man/ndbmtd.8 index 3cf34b5a6932..ae20ed5f4b71 100644 --- a/man/ndbmtd.8 +++ b/man/ndbmtd.8 @@ -2,12 +2,12 @@ .\" Title: ndbmtd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "NDBMTD" "8" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "NDBMTD" "8" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -54,7 +54,7 @@ Command\-line options and configuration parameters used with also apply to \fBndbmtd\fR\&. For more information about these options and parameters, see ndbd(8), and -Section\ \&21.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq, respectively\&. +Section\ \&21.4.3.6, \(lqDefining NDB Cluster Data Nodes\(rq, respectively\&. .PP \fBndbmtd\fR is also file system\-compatible with diff --git a/man/perror.1 b/man/perror.1 index 09c1d4a35b43..0c8fce7853f9 100644 --- a/man/perror.1 +++ b/man/perror.1 @@ -2,12 +2,12 @@ .\" Title: perror .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "PERROR" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "PERROR" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/replace.1 b/man/replace.1 index 7730dbe3875d..d50e152619f2 100644 --- a/man/replace.1 +++ b/man/replace.1 @@ -2,12 +2,12 @@ .\" Title: replace .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "REPLACE" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "REPLACE" "1" "09/06/2021" "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 a276369538cf..9cf79581438b 100644 --- a/man/resolve_stack_dump.1 +++ b/man/resolve_stack_dump.1 @@ -2,12 +2,12 @@ .\" Title: resolve_stack_dump .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "RESOLVE_STACK_DUMP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "RESOLVE_STACK_DUMP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/resolveip.1 b/man/resolveip.1 index ce50f57b9f36..f95e6cbce28b 100644 --- a/man/resolveip.1 +++ b/man/resolveip.1 @@ -2,12 +2,12 @@ .\" Title: resolveip .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "RESOLVEIP" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "RESOLVEIP" "1" "09/06/2021" "MySQL 5\&.7" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/man/zlib_decompress.1 b/man/zlib_decompress.1 index d6521ee9f1c9..80cb0ff5df4d 100644 --- a/man/zlib_decompress.1 +++ b/man/zlib_decompress.1 @@ -2,12 +2,12 @@ .\" Title: zlib_decompress .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/07/2021 +.\" Date: 09/06/2021 .\" Manual: MySQL Database System .\" Source: MySQL 5.7 .\" Language: English .\" -.TH "ZLIB_DECOMPRESS" "1" "06/07/2021" "MySQL 5\&.7" "MySQL Database System" +.TH "ZLIB_DECOMPRESS" "1" "09/06/2021" "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 aa455c5934aa..2a0098d77a9a 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -25,9 +25,9 @@ -- documentation team. If you require changes to the content of this -- file, contact the documentation team. --- File generation date: 2021-06-07 +-- File generation date: 2021-09-06 -- MySQL series: 5.7 --- Document repository revision: 69955 +-- Document repository revision: 70755 -- To use this file, load its contents into the mysql system database. -- For example, with the mysql client program, process the file like @@ -96,8 +96,8 @@ INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (48,'Utility',0,''); INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (49,'Storage Engines',0,''); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (0,1,'HELP_DATE','This help information was generated from the MySQL 5.7 Reference Manual\non: 2021-06-07\n','',''); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (1,1,'HELP_VERSION','This help information was generated from the MySQL 5.7 Reference Manual\non: 2021-06-07 (revision: 69955)\n\nThis information applies to MySQL 5.7 through 5.7.34.\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (0,1,'HELP_DATE','This help information was generated from the MySQL 5.7 Reference Manual\non: 2021-09-06\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (1,1,'HELP_VERSION','This help information was generated from the MySQL 5.7 Reference Manual\non: 2021-09-06 (revision: 70755)\n\nThis information applies to MySQL 5.7 through 5.7.35.\n','',''); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (2,2,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: https://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','https://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 (3,3,'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\nhttps://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: https://dev.mysql.com/doc/refman/5.7/en/mysql-server-side-help.html\n\n','','https://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 (4,5,'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 plaintext 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: https://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html\n\n','','https://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html'); @@ -179,7 +179,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 (80,12,'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: https://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','https://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 (81,12,'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: https://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','https://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 (82,13,'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 ...] [ELSE\nresult] 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 operator 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: https://dev.mysql.com/doc/refman/5.7/en/flow-control-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','https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html'); -INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (83,13,'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: https://dev.mysql.com/doc/refman/5.7/en/flow-control-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','https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (83,13,'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: https://dev.mysql.com/doc/refman/5.7/en/flow-control-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','https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (84,13,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/flow-control-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','https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (85,13,'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: https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','https://dev.mysql.com/doc/refman/5.7/en/flow-control-functions.html'); INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (86,14,'+','Syntax:\n+\n\nAddition:\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','https://dev.mysql.com/doc/refman/5.7/en/arithmetic-functions.html'); @@ -239,7 +239,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 (140,15,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','https://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,15,'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\nhttps://dev.mysql.com/doc/refman/5.7/en/expressions.html#temporal-inter\nvals.\n\nURL: https://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','https://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,15,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: https://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','https://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,15,'FROM_UNIXTIME','Syntax:\nFROM_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. unix_timestamp is\nan internal timestamp value representing seconds since \'1970-01-01\n00:00:00\' UTC, such as produced by the UNIX_TIMESTAMP() function.\n\nThe return value is expressed in the session time zone. (Clients can\nset the session time zone as described in\nhttps://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html.) The\nformat string, if given, is used to format the result the same way as\ndescribed in the entry for the DATE_FORMAT() function.\n\nURL: https://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(1447430881,\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2015 13th November 10:08:01 2015\'\n','https://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,15,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp[,format])\n\nReturns a representation of unix_timestamp as a datetime or character\nstring value. The value returned is expressed using the session time\nzone. (Clients can set the session time zone as described in\nhttps://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html.)\nunix_timestamp is an internal timestamp value representing seconds\nsince \'1970-01-01 00:00:00\' UTC, such as produced by the\nUNIX_TIMESTAMP() function.\n\nIf format is omitted, this function returns a DATETIME value.\n\nIf unix_timestamp is an integer, the fractional seconds precision of\nthe DATETIME is zero. When unix_timestamp is a decimal value, the\nfractional seconds precision of the DATETIME is the same as the\nprecision of the decimal value, up to a maximum of 6. When\nunix_timestamp is a floating point number, the fractional seconds\nprecision of the datetime is 6.\n\nformat is used to format the result in the same way as the format\nstring used for the DATE_FORMAT() function. If format is supplied, the\nvalue returned is a VARCHAR.\n\nURL: https://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(1447430881,\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2015 13th November 10:08:01 2015\'\n','https://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,15,'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: https://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','https://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,15,'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: https://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','https://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,15,'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: https://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','https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html'); @@ -333,11 +333,11 @@ 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 (234,16,'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: https://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html\n\n','','https://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 (235,16,'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: https://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','https://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 (236,16,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/regexp.html\n\n','','https://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 (237,16,'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\nhttps://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\nMySQL uses C escape syntax in strings (for example, \\n to represent the\nnewline character). If you want your expr or pat argument to contain a\nliteral \\, you must double it. (Unless the NO_BACKSLASH_ESCAPES SQL\nmode is enabled, in which case no escape character is used.)\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\nhttps://dev.mysql.com/doc/refman/5.7/en/charset-collation-coercibility.\nhtml. If either argument is a binary string, the arguments are handled\nin case-sensitive fashion as binary strings.\n\nURL: https://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','https://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 (237,16,'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\nhttps://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\nMySQL uses C escape syntax in strings (for example, \\n to represent the\nnewline character). If you want your expr or pat argument to contain a\nliteral \\, you must double it. (Unless the NO_BACKSLASH_ESCAPES SQL\nmode is enabled, in which case no escape character is used.)\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\nhttps://dev.mysql.com/doc/refman/5.7/en/charset-collation-coercibility.\nhtml. If either argument is a binary string, the arguments are handled\nin case-sensitive fashion as binary strings.\n\nURL: https://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+---------------------+\n','https://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 (238,16,'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 MySQL provides a built-in full-text ngram parser that supports\n Chinese, Japanese, and Korean (CJK), and an installable MeCab\n full-text parser plugin for Japanese. Parsing differences are\n outlined in\n https://dev.mysql.com/doc/refman/5.7/en/fulltext-search-ngram.html,\n and\n https://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. MATCH()\ntakes a comma-separated list that names the columns to be searched.\nAGAINST takes a string to search for, and an optional modifier that\nindicates what type of search to perform. The search string must be a\nstring value that is constant during query evaluation. This rules out,\nfor example, a table column because that can differ for each 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 https://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 https://dev.mysql.com/doc/refman/5.7/en/fulltext-natural-language.htm\n l.\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 https://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 https://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html\n .\n\nURL: https://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','https://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 (239,17,'BINARY OPERATOR','Syntax:\nBINARY expr\n\nThe BINARY operator converts the expression to a binary string (a\nstring that has the binary character set and binary collation). A\ncommon use for BINARY is to force a character string comparison to be\ndone byte by byte using numeric byte values rather than character by\ncharacter. The BINARY operator also causes trailing spaces in\ncomparisons to be significant. For information about the differences\nbetween the binary collation of the binary character set and the _bin\ncollations of nonbinary character sets, see\nhttps://dev.mysql.com/doc/refman/5.7/en/charset-binary-collations.html.\n\nURL: https://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','https://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 (240,17,'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\nURL: https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','https://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 (241,17,'CONVERT','Syntax:\nCONVERT(expr USING transcoding_name), CONVERT(expr,type)\n\nThe CONVERT() function takes an expression of any type and produces a\nresult value of the specified type.\n\nCONVERT(... USING ...) is standard SQL syntax. The non-USING form of\nCONVERT() is ODBC syntax.\n\nCONVERT(expr USING transcoding_name) converts data between different\ncharacter sets. In MySQL, transcoding names are the same as the\ncorresponding character set names. For example, this statement converts\nthe string \'abc\' in the default character set to the corresponding\nstring in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nCONVERT(expr, type) syntax (without USING) takes an expression and a\ntype value specifying the result type. This operation may also be\nexpressed as CAST(expr AS type), which is equivalent. These type values\nare permitted:\n\no BINARY[(N)]\n\n Produces a string with the BINARY data type. For a description of how\n this affects comparisons, see\n https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html. If the\n optional length N is given, BINARY(N) causes the cast to use no more\n than N bytes of the argument. Values shorter than N bytes are padded\n with 0x00 bytes 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 character set default collation.\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\n\n Produces a JSON value. For details on the rules for conversion of\n values between JSON and other types, see\n https://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 https://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: https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','https://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 (240,17,'CAST','Syntax:\nCAST(expr AS type)\n\nCAST(expr AS type takes an expression of any type and produces a result\nvalue of the specified type. This operation may also be expressed as\nCONVERT(expr, type), which is equivalent.\n\nThese type values are permitted:\n\no BINARY[(N)]\n\n Produces a string with the VARBINARY data type, except that when the\n expression expr is empty (zero length), the result type is BINARY(0).\n If the optional length N is given, BINARY(N) causes the cast to use\n no more than N bytes of the argument. Values shorter than N bytes are\n padded with 0x00 bytes to a length of N. If the optional length N is\n not given, MySQL calculates the maximum length from the expression.\n If the supplied or calculated length is greater than an internal\n threshold, the result type is BLOB. If the length is still too long,\n the result type is LONGBLOB.\n\n For a description of how casting to BINARY affects comparisons, see\n https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html.\n\no CHAR[(N)] [charset_info]\n\n Produces a string with the VARCHAR data type. except that when the\n expression expr is empty (zero length), the result type is CHAR(0).\n If the optional length N is given, CHAR(N) causes the cast to use no\n more than N characters of the argument. No padding occurs for values\n shorter than N characters. If the optional length N is not given,\n MySQL calculates the maximum length from the expression. If the\n supplied or calculated length is greater than an internal threshold,\n the result type is TEXT. If the length is still too long, the result\n type is LONGTEXT.\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 character set default collation.\n\no DATE\n\n Produces a DATE value.\n\no DATETIME[(M)]\n\n Produces a DATETIME value. If the optional M value is given, it\n specifies the fractional seconds precision.\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). If D is\n omitted, 0 is assumed. If M is omitted, 10 is assumed.\n\no JSON\n\n Produces a JSON value. For details on the rules for conversion of\n values between JSON and other types, see\n https://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 https://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 BIGINT value.\n\no TIME[(M)]\n\n Produces a TIME value. If the optional M value is given, it specifies\n the fractional seconds precision.\n\no UNSIGNED [INTEGER]\n\n Produces an unsigned BIGINT value.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','https://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 (241,17,'CONVERT','Syntax:\nCONVERT(expr USING transcoding_name)\n\nCONVERT(expr,type)\n\nCONVERT(expr USING transcoding_name) is standard SQL syntax. The\nnon-USING form of CONVERT() is ODBC syntax.\n\nCONVERT(expr USING transcoding_name) converts data between different\ncharacter sets. In MySQL, transcoding names are the same as the\ncorresponding character set names. For example, this statement converts\nthe string \'abc\' in the default character set to the corresponding\nstring in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nCONVERT(expr, type) syntax (without USING) takes an expression and a\ntype value specifying a result type, and produces a result value of the\nspecified type. This operation may also be expressed as CAST(expr AS\ntype), which is equivalent. For more information, see the description\nof CAST().\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html\n\n','','https://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 (242,18,'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: https://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','https://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 (243,18,'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: https://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','https://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 (244,19,'|','Syntax:\n|\n\nBitwise OR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','https://dev.mysql.com/doc/refman/5.7/en/bit-functions.html'); @@ -382,7 +382,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 (283,22,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','https://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 (284,22,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','','https://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 (285,22,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','https://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 (286,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\nhttps://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.7.34-standard\'\n','https://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 (286,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\nhttps://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.7.35-standard\'\n','https://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 (287,24,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt [, srid]), GeometryCollectionFromText(wkt [,\nsrid])\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(),\nST_GeomCollFromTxt(), GeomCollFromText(), and\nGeometryCollectionFromText() are synonyms. For more information, see\nthe description of ST_GeomCollFromText().\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','https://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 (288,24,'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: https://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','https://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 (289,24,'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: https://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html\n\n','','https://dev.mysql.com/doc/refman/5.7/en/gis-wkt-functions.html'); @@ -475,7 +475,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 (376,31,'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: https://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','https://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,31,'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: https://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','https://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 (378,31,'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: https://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','https://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 (379,31,'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: https://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','https://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 (379,31,'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: https://dev.mysql.com/doc/refman/5.7/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'MULTIPOINT(5 0,15 10,15 25)\');\nmysql> SET @g2 = ST_GeomFromText(\'MULTIPOINT(1 1,15 10,15 25)\');\nmysql> SELECT ST_AsText(ST_SymDifference(@g1, @g2));\n+---------------------------------------+\n| ST_AsText(ST_SymDifference(@g1, @g2)) |\n+---------------------------------------+\n| MULTIPOINT((1 1),(5 0)) |\n+---------------------------------------+\n','https://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 (380,31,'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: https://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','https://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 (381,32,'CROSSES','Crosses(g1, g2)\n\nST_Crosses() and Crosses() are synonyms. For more information, see the\ndescription of ST_Crosses().\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','https://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 (382,32,'DISTANCE','Distance(g1, g2)\n\nST_Distance() and Distance() are synonyms. For more information, see\nthe description of ST_Distance().\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html\n\n','','https://dev.mysql.com/doc/refman/5.7/en/spatial-relation-functions-object-shapes.html'); @@ -703,8 +703,8 @@ 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 (604,3,'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. SHOW BINLOG EVENTS requires the\nREPLICATION SLAVE privilege.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html\n\n','','https://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 (605,3,'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\nhttps://dev.mysql.com/doc/refman/5.7/en/extended-show.html. For\nexample:\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: https://dev.mysql.com/doc/refman/5.7/en/show-character-set.html\n\n','','https://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 (606,3,'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\nhttps://dev.mysql.com/doc/refman/5.7/en/extended-show.html. For\nexample:\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: https://dev.mysql.com/doc/refman/5.7/en/show-collation.html\n\n','','https://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 (607,3,'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\nhttps://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\nhttps://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\nhttps://dev.mysql.com/doc/refman/5.7/en/information-schema-columns-tabl\ne.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 https://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: https://dev.mysql.com/doc/refman/5.7/en/show-columns.html\n\n','','https://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 (608,3,'SHOW FIELDS','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\nhttps://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\nhttps://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\nhttps://dev.mysql.com/doc/refman/5.7/en/information-schema-columns-tabl\ne.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 https://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: https://dev.mysql.com/doc/refman/5.7/en/show-columns.html\n\n','','https://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 (607,3,'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\nhttps://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\nhttps://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 STORED GENERATED 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\nhttps://dev.mysql.com/doc/refman/5.7/en/information-schema-columns-tabl\ne.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 https://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: https://dev.mysql.com/doc/refman/5.7/en/show-columns.html\n\n','','https://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 (608,3,'SHOW FIELDS','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\nhttps://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\nhttps://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 STORED GENERATED 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\nhttps://dev.mysql.com/doc/refman/5.7/en/information-schema-columns-tabl\ne.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 https://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: https://dev.mysql.com/doc/refman/5.7/en/show-columns.html\n\n','','https://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 (609,3,'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: https://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','https://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 (610,3,'SHOW CREATE SCHEMA','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: https://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','https://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 (611,3,'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: https://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','https://dev.mysql.com/doc/refman/5.7/en/show-create-event.html'); @@ -748,7 +748,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 (649,3,'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\nThe ability to see which threads are available to be killed depends on\nthe PROCESS privilege:\n\no Without PROCESS, you can see only your own threads.\n\no With PROCESS, you can see all threads.\n\nThe ability to kill threads and statements depends on the SUPER\nprivilege:\n\no Without SUPER, you can kill only your own threads and statements.\n\no With SUPER, you can kill all 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: https://dev.mysql.com/doc/refman/5.7/en/kill.html\n\n','','https://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 (650,3,'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)]\n [{INDEX|KEY} (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\npartition_list: {\n partition_name[, partition_name] ...\n | ALL\n}\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 applies only to MyISAM tables, including\npartitioned MyISAM tables. In addition, indexes on partitioned tables\ncan be preloaded for one, several, or all partitions.\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: https://dev.mysql.com/doc/refman/5.7/en/load-index.html\n\n','','https://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 (651,3,'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\nhttps://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 replica forget its replication position in the source\n binary logs. Also resets the relay log by deleting any existing relay\n log files and beginning a new one.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/reset.html\n\n','','https://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 (652,3,'SHUTDOWN','Syntax:\nSHUTDOWN\n\nThis statement stops the MySQL server. It requires the SHUTDOWN\nprivilege.\n\nSHUTDOWN provides an SQL-level interface to the same functionality\navailable using the mysqladmin shutdown command or the mysql_shutdown()\n(https://dev.mysql.com/doc/c-api/5.7/en/mysql-shutdown.html) C API\nfunction.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/shutdown.html\n\n','','https://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 (652,3,'SHUTDOWN','Syntax:\nSHUTDOWN\n\nThis statement stops the MySQL server. It requires the SHUTDOWN\nprivilege.\n\nSHUTDOWN provides an SQL-level interface to the same functionality\navailable using the mysqladmin shutdown command or the mysql_shutdown()\n(https://dev.mysql.com/doc/c-api/5.7/en/mysql-shutdown.html) C API\nfunction. A successful SHUTDOWN sequence consists of checking the\nprivileges, validating the arguments, and sending an OK packet to the\nclient. Then the server is shut down.\n\nURL: https://dev.mysql.com/doc/refman/5.7/en/shutdown.html\n\n','','https://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 (653,48,'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: https://dev.mysql.com/doc/refman/5.7/en/explain.html\n\n','','https://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 (654,48,'DESCRIBE','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: https://dev.mysql.com/doc/refman/5.7/en/explain.html\n\n','','https://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 (655,48,'DESC','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: https://dev.mysql.com/doc/refman/5.7/en/explain.html\n\n','','https://dev.mysql.com/doc/refman/5.7/en/explain.html'); @@ -1012,10 +1012,10 @@ INSERT INTO help_keyword (help_keyword_id,name) VALUES (252,'MODE'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (253,'WITH'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (254,'BINARY'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (255,'CAST'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (256,'CONVERT'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (257,'DATETIME'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (258,'JSON'); -INSERT INTO help_keyword (help_keyword_id,name) VALUES (259,'SIGNED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (256,'DATETIME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (257,'JSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (258,'SIGNED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (259,'CONVERT'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (260,'EXTRACTVALUE'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (261,'UPDATEXML'); INSERT INTO help_keyword (help_keyword_id,name) VALUES (262,'|'); @@ -1737,7 +1737,7 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,24); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (18,24); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (18,25); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,26); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,26); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,26); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,26); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,26); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,26); @@ -1753,7 +1753,7 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (20,28); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (21,29); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (21,30); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (22,31); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,32); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,32); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,32); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (22,32); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,33); @@ -1761,7 +1761,7 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,34); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,35); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,35); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,36); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,37); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,37); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,37); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (27,38); @@ -1769,13 +1769,13 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,39); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,40); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (593,41); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,41); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,42); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,42); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,42); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,42); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (133,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 (167,43); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,44); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,44); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,44); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (165,44); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,45); @@ -1797,9 +1797,9 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,46); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,46); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (35,47); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,48); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,49); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (36,49); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (186,49); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,49); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,50); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,51); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,52); @@ -2182,7 +2182,7 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (648,253); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (584,253); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,253); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,254); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,254); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,254); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (648,254); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (548,254); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (549,254); @@ -2190,12 +2190,11 @@ INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (602,254); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (603,254); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,255); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,256); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,256); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,257); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,258); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (655,258); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (654,258); -INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (653,258); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,257); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (655,257); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (654,257); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (653,257); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (240,258); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (241,259); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,260); INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,261); From a80172d2c79e0f8f0f570bc0b269c858bbae1f23 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:19:34 +0200 Subject: [PATCH 19/36] Implemented PS-7947 (Merge MySQL 5.7.36 up to 7977f189d91) (conflicts resolved) https://jira.percona.com/browse/PS-7947 VERSION raised to "5.7.36-39.0". PERCONA_INNODB_VERSION in univ.i raised to "39.0". --- MYSQL_VERSION | 10 +---- client/client_priv.h | 4 -- client/mysqldump.c | 67 ++++-------------------------- sql/binlog.cc | 9 ---- sql/sql_parse.cc | 8 +--- storage/innobase/dict/dict0dict.cc | 4 -- storage/innobase/include/univ.i | 2 +- storage/innobase/row/row0ins.cc | 2 +- 8 files changed, 11 insertions(+), 95 deletions(-) diff --git a/MYSQL_VERSION b/MYSQL_VERSION index 450c4c3efdcc..7a4b3c0221c9 100644 --- a/MYSQL_VERSION +++ b/MYSQL_VERSION @@ -1,12 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=7 -<<<<<<< HEAD:MYSQL_VERSION -MYSQL_VERSION_PATCH=35 -MYSQL_VERSION_EXTRA=-38 -||||||| 89713bf41c3:VERSION -MYSQL_VERSION_PATCH=35 -MYSQL_VERSION_EXTRA= -======= MYSQL_VERSION_PATCH=36 -MYSQL_VERSION_EXTRA= ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^:VERSION +MYSQL_VERSION_EXTRA=-39 diff --git a/client/client_priv.h b/client/client_priv.h index 1c7b397820fc..90d394221fca 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -116,17 +116,13 @@ enum options_client OPT_CONNECTION_SERVER_ID, OPT_TLS_VERSION, OPT_SSL_MODE, -<<<<<<< HEAD OPT_ENABLE_COMPRESSED_COLUMNS, OPT_ENABLE_COMPRESSED_COLUMNS_WITH_DICTIONARIES, OPT_DROP_COMPRESSION_DICTIONARY, OPT_ORDER_BY_PRIMARY_DESC, OPT_START_SQL_FILE, OPT_FINISH_SQL_FILE, -||||||| 89713bf41c3 -======= OPT_SKIP_MYSQL_SCHEMA, ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ /* Add new option above this */ OPT_MAX_CLIENT_OPTION }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 4fea8607ca9d..d92d3b4c30af 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -131,18 +131,11 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_include_master_host_port= 0, opt_events= 0, opt_comments_used= 0, opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0, -<<<<<<< HEAD - opt_secure_auth= TRUE, opt_compressed_columns= 0, opt_compressed_columns_with_dictionaries= 0, opt_drop_compression_dictionary= 1, - opt_order_by_primary_desc= 0; - -||||||| 89713bf41c3 - opt_secure_auth= TRUE; -======= + opt_order_by_primary_desc= 0, opt_skip_mysql_schema=0, opt_secure_auth= TRUE; ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*mysql=0; @@ -6833,17 +6826,11 @@ static my_bool add_set_gtid_purged(MYSQL *mysql_con, my_bool ftwrl_done) { if (opt_comments) fprintf(md_result_file, -<<<<<<< HEAD - "\n--\n-- GTID state at the beginning of the backup" + "\n--\n-- GTID state at the end of the backup" "\n-- (origin: %s)" "\n--\n\n", capture_raw_gtid_executed ? "@@global.gtid_executed" : "Binlog_snapshot_gtid_executed"); -||||||| 89713bf41c3 - "\n--\n-- GTID state at the beginning of the backup \n--\n\n"); -======= - "\n--\n-- GTID state at the end of the backup \n--\n\n"); ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ fprintf(md_result_file,"SET @@GLOBAL.GTID_PURGED='"); @@ -6873,30 +6860,21 @@ static my_bool add_set_gtid_purged(MYSQL *mysql_con, my_bool ftwrl_done) session binlog is restored if disabled previously. @param[in] mysql_con the connection to the server -<<<<<<< HEAD @param[in] ftwrl_done FLUSH TABLES WITH READ LOCK query was issued -||||||| 89713bf41c3 -======= @param[in] flag If FALSE, just disable binlog and not set the gtid purged as it will be set at a later point of time. If TRUE, set the gtid purged and restore the session binlog if disabled previously. ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ @retval FALSE successful according to the value of opt_set_gtid_purged. @retval TRUE fail. */ -<<<<<<< HEAD -static my_bool process_set_gtid_purged(MYSQL* mysql_con, my_bool ftwrl_done) -||||||| 89713bf41c3 -static my_bool process_set_gtid_purged(MYSQL* mysql_con) -======= -static my_bool process_set_gtid_purged(MYSQL* mysql_con, my_bool flag) ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ +static my_bool process_set_gtid_purged(MYSQL* mysql_con, my_bool ftwrl_done, + my_bool flag) { MYSQL_RES *gtid_mode_res; MYSQL_ROW gtid_mode_row; @@ -6956,22 +6934,8 @@ static my_bool process_set_gtid_purged(MYSQL* mysql_con, my_bool flag) "--all-databases --triggers --routines --events. \n"); } -<<<<<<< HEAD - set_session_binlog(FALSE); - if (add_set_gtid_purged(mysql_con, ftwrl_done)) - { - mysql_free_result(gtid_mode_res); - return TRUE; -||||||| 89713bf41c3 - set_session_binlog(FALSE); - if (add_set_gtid_purged(mysql_con)) - { - mysql_free_result(gtid_mode_res); - return TRUE; -======= - if (add_set_gtid_purged(mysql_con)) + if (add_set_gtid_purged(mysql_con, ftwrl_done)) return TRUE; ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ } } else /* gtid_mode is off */ @@ -7512,29 +7476,12 @@ int main(int argc, char **argv) if (opt_slave_apply && add_stop_slave()) goto err; -<<<<<<< HEAD - - /* Process opt_set_gtid_purged and add SET @@GLOBAL.GTID_PURGED if required. */ - if (process_set_gtid_purged(mysql, ftwrl_done)) -||||||| 89713bf41c3 - - /* Process opt_set_gtid_purged and add SET @@GLOBAL.GTID_PURGED if required. */ - if (process_set_gtid_purged(mysql)) -======= /* Process opt_set_gtid_purged and add SET disable binlog if required. */ - if (process_set_gtid_purged(mysql, FALSE)) ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ + if (process_set_gtid_purged(mysql, ftwrl_done, FALSE)) goto err; -<<<<<<< HEAD if (opt_master_data && do_show_master_status(mysql, has_consistent_binlog_pos)) -||||||| 89713bf41c3 - - if (opt_master_data && do_show_master_status(mysql)) -======= - if (opt_master_data && do_show_master_status(mysql)) ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ goto err; if (opt_slave_data && do_show_slave_status(mysql)) goto err; @@ -7612,7 +7559,7 @@ int main(int argc, char **argv) goto err; /* Process opt_set_gtid_purged and add SET @@GLOBAL.GTID_PURGED if required. */ - if (process_set_gtid_purged(mysql, TRUE)) + if (process_set_gtid_purged(mysql, ftwrl_done, TRUE)) goto err; /* add 'START SLAVE' to end of dump */ diff --git a/sql/binlog.cc b/sql/binlog.cc index 369450584bcc..2036cc44d950 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -10664,7 +10664,6 @@ int MYSQL_BIN_LOG::recover(IO_CACHE *log, Format_description_log_event *fdle, return 1; } -<<<<<<< HEAD /* Copy out the non-directory part of binlog position filename for the `binlog_snapshot_file' status variable, same way as it is done for @@ -10740,16 +10739,8 @@ void MYSQL_BIN_LOG::xunlock(void) mysql_mutex_unlock(&LOCK_log); } - -void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_gtid_set, - const char** errmsg) -||||||| 89713bf41c3 -void MYSQL_BIN_LOG::report_missing_purged_gtids(const Gtid_set* slave_executed_gtid_set, - const char** errmsg) -======= void MYSQL_BIN_LOG::report_missing_purged_gtids( const Gtid_set *slave_executed_gtid_set, std::string &errmsg) ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ { DBUG_ENTER("MYSQL_BIN_LOG::report_missing_purged_gtids"); THD *thd= current_thd; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e624ef8e898a..95d46acb825b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1541,15 +1541,9 @@ bool dispatch_command(THD *thd, const COM_DATA *com_data, if (parser_state.init(thd, thd->query().str, thd->query().length)) break; -<<<<<<< HEAD - mysql_parse(thd, &parser_state, false); -||||||| 89713bf41c3 - mysql_parse(thd, &parser_state); -======= parser_state.m_input.m_has_digest = true; - mysql_parse(thd, &parser_state); ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ + mysql_parse(thd, &parser_state, false); while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) && ! thd->is_error()) diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 294a938bd269..91b538c06530 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -7253,7 +7253,6 @@ dict_table_extent_size( return(pages_in_extent); } -<<<<<<< HEAD /** Insert a records into SYS_ZIP_DICT. @retval DB_SUCCESS if OK @@ -7432,8 +7431,6 @@ dict_drop_zip_dict( return err; } -||||||| 89713bf41c3 -======= /** @return number of base columns of virtual column in foreign key column @param[in] vcol in-memory virtual column @@ -7456,4 +7453,3 @@ uint32_t dict_vcol_base_is_foreign_key(dict_v_col_t *vcol, } return foreign_col_count; } ->>>>>>> 0ed6d65f4c60a38e77a672fc528efd3f44bc7701^ diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index a3d37d93eded..84df9fc311a1 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -55,7 +55,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 38 +#define PERCONA_INNODB_VERSION 39 #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 180924c944ed..34dd78490658 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1043,7 +1043,7 @@ row_ins_foreign_fill_virtual( dfield_t *new_vfield = innobase_get_computed_value( update->old_vrow, col, index, &v_heap, update->heap, NULL, thd, NULL, - NULL, node->update, foreign); + NULL, node->update, foreign, prebuilt); dfield_copy(&(upd_field->new_val), new_vfield); } From 47dee999e8e2dd5444bbe544cd44ffba65e90e3c Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:21:52 +0200 Subject: [PATCH 20/36] PS-7947: Merge MySQL 5.7.36 (fixed perfschema.digest_view test) https://jira.percona.com/browse/PS-7947 Query digest calculated by PS differs from one expected by upstream because of extended SQL grammar. Removed DIGEST from result file for perfschema.digest_view to fix the test. --- .../suite/perfschema/r/digest_view.result | 54 +++++++++---------- .../suite/perfschema/t/digest_view.test | 2 + 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result index 7942b7d3c853..69c2a263fd11 100644 --- a/mysql-test/suite/perfschema/r/digest_view.result +++ b/mysql-test/suite/perfschema/r/digest_view.result @@ -57,18 +57,18 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR FROM performance_schema.events_statements_summary_by_digest ORDER BY DIGEST_TEXT; SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR -test faacd4387467f00e5471f3620f0053ee EXPLAIN SELECT * FROM `test` . `v1` 1 -test 75f55ccb0b365eefb51cc8f1f1d81132 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1 -test f13826a4cdfdfc626f2f338744c9c746 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1 -test 4204f1e3809aca8633c27c32603bcf6d EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1 -test fff8925d7c4be86c0c3da7a26c60750e EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1 -test a8465e96fae9df6be0af2b0bcaff9548 SELECT * FROM `test` . `v1` 1 -test 90d5479e3ca1cbf7113b3b3abc96f1ff SELECT * FROM `test` . `v1` WHERE `a` = ? 1 -test b660099c975325cd338eb80b2849bd61 SELECT * FROM `test` . `v1` WHERE `b` > ? 1 -test 9b459b7b8ce957d816066ba4ee0289f9 SELECT `a` , `b` FROM `test` . `v1` 1 -test 1c037a199783a415ae1ff2361459f1de SELECT `b` , `a` FROM `test` . `v1` 1 -test feaff321c54a9c8e1e9508628f7a5a05 SHOW WARNINGS 5 -test d24da32343f2b799f8a7ba1bdc45f83b TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 +test ? EXPLAIN SELECT * FROM `test` . `v1` 1 +test ? EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1 +test ? EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1 +test ? EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1 +test ? EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1 +test ? SELECT * FROM `test` . `v1` 1 +test ? SELECT * FROM `test` . `v1` WHERE `a` = ? 1 +test ? SELECT * FROM `test` . `v1` WHERE `b` > ? 1 +test ? SELECT `a` , `b` FROM `test` . `v1` 1 +test ? SELECT `b` , `a` FROM `test` . `v1` 1 +test ? SHOW WARNINGS 5 +test ? TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 DROP TABLE test.v1; CREATE VIEW test.v1 AS SELECT * FROM test.t1; EXPLAIN SELECT * from test.v1; @@ -125,20 +125,20 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR FROM performance_schema.events_statements_summary_by_digest ORDER BY DIGEST_TEXT; SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR -test 1462d84ad90aeabc6106da2a5ba38f17 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1 -test c909e770703c59c353ca199dfe4ca154 DROP TABLE `test` . `v1` 1 -test faacd4387467f00e5471f3620f0053ee EXPLAIN SELECT * FROM `test` . `v1` 2 -test 75f55ccb0b365eefb51cc8f1f1d81132 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2 -test f13826a4cdfdfc626f2f338744c9c746 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2 -test 4204f1e3809aca8633c27c32603bcf6d EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2 -test fff8925d7c4be86c0c3da7a26c60750e EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2 -test a8465e96fae9df6be0af2b0bcaff9548 SELECT * FROM `test` . `v1` 2 -test 90d5479e3ca1cbf7113b3b3abc96f1ff SELECT * FROM `test` . `v1` WHERE `a` = ? 2 -test b660099c975325cd338eb80b2849bd61 SELECT * FROM `test` . `v1` WHERE `b` > ? 2 -test f26fa367559d55cac36428d5ebd1d511 SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1 -test 9b459b7b8ce957d816066ba4ee0289f9 SELECT `a` , `b` FROM `test` . `v1` 2 -test 1c037a199783a415ae1ff2361459f1de SELECT `b` , `a` FROM `test` . `v1` 2 -test feaff321c54a9c8e1e9508628f7a5a05 SHOW WARNINGS 10 -test d24da32343f2b799f8a7ba1bdc45f83b TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 +test ? CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1 +test ? DROP TABLE `test` . `v1` 1 +test ? EXPLAIN SELECT * FROM `test` . `v1` 2 +test ? EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2 +test ? EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2 +test ? EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2 +test ? EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2 +test ? SELECT * FROM `test` . `v1` 2 +test ? SELECT * FROM `test` . `v1` WHERE `a` = ? 2 +test ? SELECT * FROM `test` . `v1` WHERE `b` > ? 2 +test ? SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1 +test ? SELECT `a` , `b` FROM `test` . `v1` 2 +test ? SELECT `b` , `a` FROM `test` . `v1` 2 +test ? SHOW WARNINGS 10 +test ? TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 DROP VIEW test.v1; DROP TABLE test.t1; diff --git a/mysql-test/suite/perfschema/t/digest_view.test b/mysql-test/suite/perfschema/t/digest_view.test index 8e9632de622e..8bde2239b24f 100644 --- a/mysql-test/suite/perfschema/t/digest_view.test +++ b/mysql-test/suite/perfschema/t/digest_view.test @@ -39,6 +39,7 @@ SELECT b, a from test.v1; --echo # DIGESTS SEEN ON TABLE --echo # +--replace_column 2 ? SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR FROM performance_schema.events_statements_summary_by_digest ORDER BY DIGEST_TEXT; @@ -67,6 +68,7 @@ SELECT b, a from test.v1; --echo # DIGESTS SEEN ON VIEW --echo # +--replace_column 2 ? SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR FROM performance_schema.events_statements_summary_by_digest ORDER BY DIGEST_TEXT; From fbc5ab31ef453a6204030331e4e07f8fd2f3eb56 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:22:59 +0200 Subject: [PATCH 21/36] PS-7947: Merge MySQL 5.7.36 (fixed keyring_vault.keyring_vault_timeout test) https://jira.percona.com/browse/PS-7947 This is a backport of https://github.com/percona/percona-server/commit/d460658f49c941665c92649756ceadcedb2d6914 Test uses https for vault_conf_address. As a result it fails in case vault_conf_ca is missing for some reason. To fix this the vault_conf_address was changed to use http and in addition added skip_vault_conf_ca parameter for generate_conf_file.inc which allows to leave vault_conf_ca config parameter empty even in case it is provided via environment variable. Another issue with the test is that test server behavior seem to be changed somehow. Request was sent to vault.public-ci.percona.com in such a way that it was supposed to timeout. But for some reason server now responds quickly. Changed vault_conf_address to dummy private IP address. --- .../keyring_vault/tests/mtr/generate_conf_file.inc | 12 ++++++++++++ .../tests/mtr/keyring_vault_timeout.test | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugin/keyring_vault/tests/mtr/generate_conf_file.inc b/plugin/keyring_vault/tests/mtr/generate_conf_file.inc index a73368df0f5d..8cedb3c111fe 100644 --- a/plugin/keyring_vault/tests/mtr/generate_conf_file.inc +++ b/plugin/keyring_vault/tests/mtr/generate_conf_file.inc @@ -11,6 +11,7 @@ # $vault_conf_address - optional Hashicorp Vault server URL, if not defined, taken from MTR_VAULT_ADDRESS environment variable # $vault_conf_token - optional Hashicorp Vault server token, if not defined, taken from MTR_VAULT_PLUGIN_TOKEN environment variable # $vault_conf_ca - optional path to Hashicorp Vault server CA certificate, if not defined, taken from MTR_VAULT_CA environment variable +# $skip_vault_conf_ca - do not fill in vault_conf_ca even in case it is provided in MTR_VAULT_CA environment variable --let EXPORTED_VAULT_CONF_FILE = $vault_conf_file --let EXPORTED_VAULT_CONF_MOUNT_POINT_UUID = $vault_conf_mount_point_uuid @@ -32,6 +33,11 @@ if ($vault_conf_ca) { --let EXPORTED_VAULT_CONF_CA = $vault_conf_ca } +--let EXPORTED_SKIP_VAULT_CONF_CA = 0 +if ($skip_vault_conf_ca) +{ + --let EXPORTED_SKIP_VAULT_CONF_CA = 1 +} --perl use strict; @@ -54,6 +60,12 @@ if ($vault_conf_ca) $imported_vault_conf_ca = $ENV{'MTR_VAULT_CA'}; } + my $imported_skip_vault_conf_ca = $ENV{EXPORTED_SKIP_VAULT_CONF_CA}; + if ($imported_skip_vault_conf_ca) + { + $imported_vault_conf_ca = ''; + } + my $imported_vault_conf_file = $ENV{'EXPORTED_VAULT_CONF_FILE'} or die("EXPORTED_VAULT_CONF_FILE not set\n"); my $imported_vault_conf_mount_point_uuid = $ENV{'EXPORTED_VAULT_CONF_MOUNT_POINT_UUID'} or die("EXPORTED_VAULT_CONF_MOUNT_POINT_UUID not set\n"); my $imported_vault_conf_mount_point_suffix = $ENV{'EXPORTED_VAULT_CONF_MOUNT_POINT_SUFFIX'}; diff --git a/plugin/keyring_vault/tests/mtr/keyring_vault_timeout.test b/plugin/keyring_vault/tests/mtr/keyring_vault_timeout.test index 9750246777b4..5c262b13547b 100644 --- a/plugin/keyring_vault/tests/mtr/keyring_vault_timeout.test +++ b/plugin/keyring_vault/tests/mtr/keyring_vault_timeout.test @@ -7,8 +7,9 @@ --source parse_combination.inc --let $vault_conf_file = $MYSQLTEST_VARDIR/keyring_vault_incorrect_server.conf ---let $vault_conf_address = https://vault.public-ci.percona.com +--let $vault_conf_address = http://192.168.255.1 --let $vault_conf_mount_point_suffix = +--let $skip_vault_conf_ca = 1 --source generate_conf_file.inc --replace_regex /\.dll/.so/ @@ -37,7 +38,7 @@ SET @@GLOBAL.keyring_vault_timeout = 15; --let $connection_time_start = `SELECT UNIX_TIMESTAMP()` # Here, we are trying to set keyring_vault_config variable to existing, but not accessible address. -# As the connection is not possible we should receive connection timeout - according the to value of +# As the connection is not possible we should receive connection timeout - according to the value of # keyring_vault_timeout variable. --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR From daa0bde6735b7e4ed14430e1f05c30d88a897f5e Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:24:13 +0200 Subject: [PATCH 22/36] PS-7947: Merge MySQL 5.7.36 (remove unused variables) https://jira.percona.com/browse/PS-7947 --- mysys/mf_iocache.c | 3 +-- storage/innobase/row/row0ftsort.cc | 2 -- storage/myisam/mi_check.c | 4 +--- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index a7e0e50e924b..91964bd4504c 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1312,7 +1312,7 @@ static void copy_to_read_buffer(IO_CACHE *write_cache, static int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count) { - size_t length, diff_length, left_length= 0, save_count, max_length; + size_t length, diff_length, save_count, max_length; my_off_t pos_in_file; save_count=Count; @@ -1365,7 +1365,6 @@ static int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count) */ goto read_append_buffer; } - left_length+=length; diff_length=0; } diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index fc5686eea4f5..56adfc5938e6 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -773,7 +773,6 @@ fts_parallel_tokenization( row_merge_block_t** block; int tmpfd[FTS_NUM_AUX_INDEX]; ulint mycount[FTS_NUM_AUX_INDEX]; - ib_uint64_t total_rec = 0; ulint num_doc_processed = 0; doc_id_t last_doc_id = 0; mem_heap_t* blob_heap = NULL; @@ -1042,7 +1041,6 @@ fts_parallel_tokenization( goto func_exit; } - total_rec += merge_file[i]->n_rec; close(tmpfd[i]); } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index afe01c76138a..23995bf91d5e 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2661,7 +2661,7 @@ int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, const char * name, int rep_quick, my_bool no_copy_stat) { int got_error; - uint i,key, total_key_length, istep; + uint i,key, istep; ulong rec_length; ha_rows start_records; my_off_t new_header_length,del; @@ -2842,7 +2842,6 @@ int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, mi_check_print_error(param,"Not enough memory for key!"); goto err; } - total_key_length=0; rec_per_key_part= param->rec_per_key_part; info->state->records=info->state->del=share->state.split=0; info->state->empty=0; @@ -2911,7 +2910,6 @@ int mi_repair_parallel(MI_CHECK *param, MI_INFO *info, if (keyseg->flag & HA_NULL_PART) sort_param[i].key_length++; } - total_key_length+=sort_param[i].key_length; if (sort_param[i].keyinfo->flag & HA_FULLTEXT) { From 85e7a08ab3fff71debf41812c930db5961695eee Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:24:58 +0200 Subject: [PATCH 23/36] PS-7947: Merge MySQL 5.7.36 (remove unused debug code in buf_read_ahead_random()) https://jira.percona.com/browse/PS-7947 There was an assertion removed in https://github.com/mysql/mysql-server/commit/98f389ec23f08caf521f9b3e262b9910ea73490d. Remove the whole debug block as it now causes 'variable set but not used' error. --- storage/innobase/buf/buf0rea.cc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index 32a90b5e0eb4..8b8e4f525300 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -323,22 +323,6 @@ buf_read_ahead_random( below: if DISCARD + IMPORT changes the actual .ibd file meanwhile, we do not try to read outside the bounds of the tablespace! */ if (fil_space_t* space = fil_space_acquire(page_id.space())) { - -#ifdef UNIV_DEBUG - if (srv_file_per_table) { - ulint size = 0; - - for (const fil_node_t* node = - UT_LIST_GET_FIRST(space->chain); - node != NULL; - node = UT_LIST_GET_NEXT(chain, node)) { - - size += os_file_get_size(node->handle) - / page_size.physical(); - } - } -#endif /* UNIV_DEBUG */ - if (high > space->size) { high = space->size; } From 5e09c16c09cdc0f40edb525f509575705d4d5897 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:26:06 +0200 Subject: [PATCH 24/36] PS-7947: Merge MySQL 5.7.36 (suppress Wno-null-pointer-subtraction) https://jira.percona.com/browse/PS-7947 Suppress Wno-null-pointer-subtraction error in mf_qsort.c when built with Clang-13. --- mysys/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index fd46f80d9509..00f0496ced72 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -67,6 +67,10 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_C_COMPILER_ID MATCHES "SunPro") PROPERTIES COMPILE_FLAGS "${CMAKE_CURRENT_SOURCE_DIR}/my_timer_cycles.il") ENDIF() +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0) + STRING_APPEND(CMAKE_C_FLAGS " -Wno-null-pointer-subtraction") +ENDIF() + IF(HAVE_LINUX_LARGE_PAGES) SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_largepage.c) ENDIF() From 3d3090b132367acc7e4f9f007cf9f937ba8543bf Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:26:57 +0200 Subject: [PATCH 25/36] PS-7947: Merge MySQL 5.7.36 (suppress Clang-13 errors in rocksdb) https://jira.percona.com/browse/PS-7947 Suppress -Wunused-but-set-variable and -Wdeprecated-copy errors in rocksdb submodule for Clang-13. --- storage/rocksdb/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 6727ed5b6bcf..4fda85d2d136 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -137,6 +137,12 @@ list(SORT COMPILE_DEFINITIONS) message(STATUS "MyRocks compile definitions: ${COMPILE_DEFINITIONS}") +# Suppress warnings for clang-13 or newer +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0) + ADD_CXX_COMPILE_FLAGS_TO_FILES(-Wno-unused-but-set-variable FILES rocksdb/utilities/env_mirror.cc) + ADD_CXX_COMPILE_FLAGS_TO_FILES(-Wno-deprecated-copy FILES rocksdb/options/db_options.cc) +ENDIF() + # Suppress warnings for clang-10 or newer IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) ADD_CXX_COMPILE_FLAGS_TO_FILES(-Wno-range-loop-construct FILES rocksdb/db/db_impl/db_impl_compaction_flush.cc rocksdb/options/options_parser.cc rocksdb/options/options_helper.cc) From af6c4335e1d4e9c410cb153ef64eaab0e44ac716 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:27:57 +0200 Subject: [PATCH 26/36] PS-7947: Merge MySQL 5.7.36 (fix -Wunused-but-set-variable for Release build) https://jira.percona.com/browse/PS-7947 Fix -Wunused-but-set-variable errors for Release build with Clang-13. --- .../src/bindings/xcom/gcs_xcom_state_exchange.cc | 4 ++++ sql/spatial.cc | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_state_exchange.cc b/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_state_exchange.cc index 3b48664a995c..c32219821648 100644 --- a/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_state_exchange.cc +++ b/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_state_exchange.cc @@ -521,7 +521,9 @@ enum_gcs_error Gcs_xcom_state_exchange::broadcast_state( */ if (exchangeable_data_len > 0) { +#ifndef NDEBUG uint64_t slider_total_len= 0; +#endif uint64_t slider_len= 0; for (it=exchangeable_data.begin(); it != it_ends; ++it) { @@ -536,7 +538,9 @@ enum_gcs_error Gcs_xcom_state_exchange::broadcast_state( ); msg_data->encode(slider, &slider_len); slider += slider_len; +#ifndef NDEBUG slider_total_len += slider_len; +#endif delete msg_data; } } diff --git a/sql/spatial.cc b/sql/spatial.cc index 95de2446fd1e..eb77813cb094 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -4438,7 +4438,10 @@ void Gis_wkb_vector::reassemble() // the space for ring count is already counted above. totlen+= (nbytes ? nbytes : (is_inns ? 0 : sizeof(uint32))); - size_t len= 0, total_len= 0, last_i= 0, numgeoms= 0; + size_t len= 0, last_i= 0, numgeoms= 0; +#ifndef NDEBUG + size_t total_len= 0; +#endif // Allocate extra space as free space for the WKB buffer, and write it as // defined pattern. const size_t extra_wkb_free_space= 32; @@ -4472,7 +4475,9 @@ void Gis_wkb_vector::reassemble() { memcpy(q, start, len= end - start); q+= len; +#ifndef NDEBUG total_len+= len; +#endif } // Set WKB header. This geometry must be one of multilinestring, @@ -4480,7 +4485,9 @@ void Gis_wkb_vector::reassemble() if (get_geotype() != Geometry::wkb_polygon_inner_rings) { q= write_wkb_header(q, veci->get_geotype()); +#ifndef NDEBUG total_len+= hdrsz; +#endif } // Copy the out of line geometry into buffer. A polygon's data isn't @@ -4499,7 +4506,9 @@ void Gis_wkb_vector::reassemble() memcpy(q, plgn_data_itr->second.first, len); } q+= len; +#ifndef NDEBUG total_len+= len; +#endif } // There may be trailing inline geometries to copy at old tail. @@ -4507,7 +4516,9 @@ void Gis_wkb_vector::reassemble() { len= get_cptr() + get_nbytes() - prev_start; memcpy(q, prev_start, len); +#ifndef NDEBUG total_len+= len; +#endif } assert(total_len == totlen); From 151c3402421a021e87822648a59520161e03cab4 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:28:31 +0200 Subject: [PATCH 27/36] PS-7947: Merge MySQL 5.7.36 (add valgrind suppressions for rocksdb) https://jira.percona.com/browse/PS-7947 Ignore valgrind 'still reachable' errors related to static variables. Ignore known leak in __tls_get_addr. --- mysql-test/valgrind.supp | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 0c978e1fd336..4177886b0762 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1942,3 +1942,69 @@ fun:*mysqld_main* fun:*main* } + +# +# RcoksDB submodule, ignore 'still reachable' notifications on +# static variables +# +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZN7rocksdb14ThreadLocalPtr10StaticMeta10SetHandlerEjPFvPvE + fun:_ZN7rocksdb14ThreadLocalPtrC1EPFvPvE +} +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZN7rocksdb19ThreadStatusUpdater14RegisterThreadENS_12ThreadStatus10ThreadTypeEm +} +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZN7rocksdb19ThreadStatusUpdater19NewColumnFamilyInfoEPKvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_SA_ +} +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZN7rocksdb24RegisterCacheDeleterRoleEPFvRKNS_5SliceEPvENS_14CacheEntryRoleE +} +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZN7rocksdb24CacheEntryStatsCollectorINS_13InternalStats19CacheEntryRoleStatsEE9GetSharedEPNS_5CacheEPNS_11SystemClockEPSt10shared_ptrIS3_E +} +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_ZN7rocksdb12_GLOBAL__N_111GetRegistryEv +} +{ + RocksDB still reachable + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:_Z41__static_initialization_and_destruction_0ii +} +{ + rocksdb tls_variables + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + ... + fun:allocate_dtv_entry + fun:allocate_and_init + fun:tls_get_addr_tail + fun:__tls_get_addr +} From fb5e98ae5877585d751f661e8199351773a888eb Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 15 Nov 2021 19:29:12 +0200 Subject: [PATCH 28/36] PS-7947: Merge MySQL 5.7.36 (fix 'bzero' macro redefined warn for macOS) https://jira.percona.com/browse/PS-7947 Remove bzero and a few other unused macros in include/m_string.h. The bmacro usage was discontinued in https://github.com/mysql/mysql-server/commit/69575a7d22296a087ec7d5706f096d490ce32ab4. --- include/m_string.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index 53fdae53f75b..1d6c6b19066c 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -28,12 +28,6 @@ #include -#define bfill please_use_memset_rather_than_bfill -#define bzero please_use_memset_rather_than_bzero -#define bmove please_use_memmove_rather_than_bmove -#define strmov please_use_my_stpcpy_or_my_stpmov_rather_than_strmov -#define strnmov please_use_my_stpncpy_or_my_stpnmov_rather_than_strnmov - #include "mysql/service_my_snprintf.h" #if defined(__cplusplus) From ca91c9218b370660e6bcfc2479ea62bbdcac53da Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Wed, 17 Nov 2021 19:09:13 +0200 Subject: [PATCH 29/36] PS-7947: Merge MySQL 5.7.36 (add python3.9 to LSAN suppressions) https://jira.percona.com/browse/PS-7947 --- mysql-test/lsan.supp | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/lsan.supp b/mysql-test/lsan.supp index d424c78ca562..d1556a1e0b33 100644 --- a/mysql-test/lsan.supp +++ b/mysql-test/lsan.supp @@ -32,3 +32,4 @@ leak:/bin/bash leak:/usr/bin/sed leak:/usr/bin/python2.7 leak:/usr/bin/python3.8 +leak:/usr/bin/python3.9 From 1c9dc1ccf88960c6b6bb40af777d5e871937b258 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Thu, 18 Nov 2021 16:57:27 +0200 Subject: [PATCH 30/36] PS-7947: Merge MySQL 5.7.36 (fix tests on ubuntu hirsute) https://jira.percona.com/browse/PS-7947 The innodb.alter_kill and innodb.innodb-multiple-tablespaces tests expect 'Operating system error 2' during file operations. On Ubuntu Hirsuite in the same situation OS returns different error number 22. Added additional suppression for affected tests. --- mysql-test/suite/innodb/t/alter_kill.test | 1 + mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test index 41c2f72c5773..00f46369f138 100644 --- a/mysql-test/suite/innodb/t/alter_kill.test +++ b/mysql-test/suite/innodb/t/alter_kill.test @@ -16,6 +16,7 @@ call mtr.add_suppression("Found 1 prepared XA transactions"); call mtr.add_suppression("InnoDB: .*test.*bug16720368.*missing"); call mtr.add_suppression("InnoDB: Operating system error.*in a file operation"); call mtr.add_suppression("InnoDB: \(The error means\|If you are\)"); +call mtr.add_suppression("InnoDB: Error number 22 means"); call mtr.add_suppression("InnoDB: Ignoring tablespace `test/bug16720368` because it could not be opened"); -- enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test b/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test index 163de8b36fa3..286f2c692fed 100644 --- a/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test +++ b/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test @@ -31,6 +31,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Could not find a valid tablespace call mtr.add_suppression("\\[ERROR\\] InnoDB: Default location:"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Dictionary location:"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 11 means 'Resource temporarily unavailable'"); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 22 means 'Invalid argument'"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 35 means 'Resource temporarily unavailable'"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 38 means 'Function not implemented'."); call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to find tablespace for table `test`.`.*` in the cache. Attempting to load"); @@ -38,6 +39,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, reme call mtr.add_suppression("\\[ERROR\\] InnoDB: In file '.*', tablespace id and flags are .* but in the InnoDB data dictionary they are"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation."); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 11 in a file operation."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 22 in a file operation."); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 35 in a file operation."); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 38 in a file operation."); call mtr.add_suppression("\\[ERROR\\] InnoDB: Remote location:"); From 434b4e9228c3cf2f313022f7234b2da5026d614e Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Thu, 18 Nov 2021 17:21:02 +0200 Subject: [PATCH 31/36] PS-7947: Merge MySQL 5.7.36 (fix ASAN errors suppression for rocksdb) https://jira.percona.com/browse/PS-7947 After changes in https://github.com/facebook/rocksdb/commit/311a544c2aa513a1f9b33823996f6b3e7843b6c5 rocksdb::Cache::DisownData() cannot properly determine if code is running under ASAN and if it should avoid dropping the data. The reason for this is that MUST_FREE_HEAP_ALLOCATIONS is not defined in scope of cache/lru_cache.cc. Added additional check if ASAN is used in rocksdb_done_func() before DisownData() method invocation. --- storage/rocksdb/ha_rocksdb.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index ab854ecf9e2d..1cda32d11c8e 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -5584,8 +5584,8 @@ static int rocksdb_done_func(void *const p) { // Disown the cache data since we're shutting down. // This results in memory leaks but it improved the shutdown time. -// Don't disown when running under valgrind -#ifndef HAVE_VALGRIND +// Don't disown when running under valgrind or ASAN +#if !defined(HAVE_VALGRIND) && !defined(HAVE_ASAN) if (rocksdb_tbl_options->block_cache) { rocksdb_tbl_options->block_cache->DisownData(); } From 37e6f6c57b90e038ea206c429b18cef46d41068a Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Fri, 19 Nov 2021 23:32:33 +0200 Subject: [PATCH 32/36] PS-7947: Merge MySQL 5.7.36 (fix memory leak in mysql_write_frm()) https://jira.percona.com/browse/PS-7947 --- sql/sql_table.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2ce6468baa80..f9e8052b7b86 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1863,6 +1863,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) char *part_syntax_buf; uint syntax_len; handler *new_handler= lpt->table->file; + bool is_handler_allocated = false; DBUG_ENTER("mysql_write_frm"); if (flags & (WFRM_WRITE_SHADOW | WFRM_INSTALL_SHADOW)) @@ -1879,6 +1880,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) assert(lpt->create_info->db_type->partition_flags != NULL); new_handler= get_new_handler(NULL, lpt->thd->mem_root, lpt->create_info->db_type); + is_handler_allocated = true; if (new_handler == NULL) { DBUG_RETURN(true); @@ -2026,6 +2028,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) } end: + if (is_handler_allocated && new_handler != NULL) delete new_handler; DBUG_RETURN(error); } From 5e0f87aa735fcfc84b1fb83955cd555c2e142f93 Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 22 Nov 2021 15:35:39 +0200 Subject: [PATCH 33/36] PS-7947: Merge MySQL 5.7.36 (disable unstable test innodb.undo_encrypt_basic) https://jira.percona.com/browse/PS-7947 --- mysql-test/suite/innodb/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def index 888298bbb09e..c2bc67b1c7a5 100644 --- a/mysql-test/suite/innodb/t/disabled.def +++ b/mysql-test/suite/innodb/t/disabled.def @@ -9,3 +9,4 @@ # Do not use any TAB characters for whitespace. # ############################################################################## +innodb.undo_encrypt_basic : Bug#nnnnnnnn 2021-11-22 Disable unstable test From 6f46427e5c0665ef4b1510426c9c7f16e47bb2ed Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Mon, 22 Nov 2021 23:54:13 +0200 Subject: [PATCH 34/36] PS-7947: Merge MySQL 5.7.36 (Suppress sigignore() deprecation error) https://jira.percona.com/browse/PS-7947 Build fails because of sigignore() deprecation error in case -DWITH_INNODB_MEMCACHED=ON. Add -Wno-deprecated-declarations flag for daemon/memcached.c file to suppress the error. --- plugin/innodb_memcached/daemon_memcached/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt b/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt index c94f10b9e0f4..7afa02274b0c 100644 --- a/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt +++ b/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt @@ -55,6 +55,9 @@ IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") ENDIF() ENDIF() +# Suppress 'sigignore' deprecation error +ADD_COMPILE_FLAGS("daemon/memcached.c" COMPILE_FLAGS "-Wno-deprecated-declarations") + SET(LIBMEMCACHED_UTILITIES_SOURCES include/memcached/config_parser.h include/memcached/genhash.h From 322674d517a4eb4e580f69dc9483d047ee13f45a Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Tue, 23 Nov 2021 17:57:28 +0200 Subject: [PATCH 35/36] PS-7947: Merge MySQL 5.7.36 (fix unstable test keyring_vault.keyring_udf) https://jira.percona.com/browse/PS-7947 The keyring_vault.keyring_udf test may fail on attempt to copy keyring_vault plugin file into $KEYRING_UDF_DIR directory in case it is run in parallel. Remove corresponding code in test as there is no need to keep both keyring_vault and keyring_udf plugins in the same directory. --- plugin/keyring_vault/tests/mtr/keyring_udf.test | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugin/keyring_vault/tests/mtr/keyring_udf.test b/plugin/keyring_vault/tests/mtr/keyring_udf.test index 43dfce96db9c..7ff3983e8990 100644 --- a/plugin/keyring_vault/tests/mtr/keyring_udf.test +++ b/plugin/keyring_vault/tests/mtr/keyring_udf.test @@ -39,15 +39,6 @@ call mtr.add_suppression("\\[Warning\\] Plugin keyring_vault reported: 'vault_ca --echo # Check what happens when we have not yet loaded keyring_udf or keyring_vault --source include/keyring_udf_missing_plugin.inc -# We need both plugins - keyring_vault and keyring_udf in one place - to be able to load both plugins -if ($KEYRING_UDF_DIR != $KEYRING_PLUGIN_DIR) -{ - --replace_regex /\.dll/.so/ - --error 0,1 - --remove_file $KEYRING_UDF_DIR/$KEYRING_VAULT_PLUGIN - --replace_regex /\.dll/.so/ - --copy_file $KEYRING_VAULT_PLUGIN_DIR/$KEYRING_VAULT_PLUGIN $KEYRING_UDF_DIR/$KEYRING_VAULT_PLUGIN -} --echo # Re-starting mysql server with keyring_vault plugin. --let $restart_hide_args = 1 --let $restart_parameters = restart: $KEYRING_VAULT_PLUGIN_EARLY_LOAD --loose-keyring_vault_config=$conf_file1 From 4b446217b6483d36670f22188b0d8042b86d870d Mon Sep 17 00:00:00 2001 From: Oleksandr Kachan Date: Wed, 1 Dec 2021 18:34:41 +0200 Subject: [PATCH 36/36] PS-7947: Merge MySQL 5.7.36 (update PerconaFT version) https://jira.percona.com/browse/PS-7947 New version includes Clang ASAN fix for assertion in toku_memory_startup(). --- storage/tokudb/PerconaFT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/tokudb/PerconaFT b/storage/tokudb/PerconaFT index 8876fae1ef75..01acb540d4b3 160000 --- a/storage/tokudb/PerconaFT +++ b/storage/tokudb/PerconaFT @@ -1 +1 @@ -Subproject commit 8876fae1ef751a4b62acb13616feb8d64c7daa6a +Subproject commit 01acb540d4b3581139adba6a5c5d7fd3624afde1