mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.6 into 10.7
This commit is contained in:
@@ -1,92 +0,0 @@
|
|||||||
--- /Users/shulga/projects/mariadb/server-10.6/mysql-test/main/opt_trace.result 2021-07-21 19:17:11.000000000 +0700
|
|
||||||
+++ /Users/shulga/projects/mariadb/server-10.6/mysql-test/main/opt_trace.reject 2021-07-21 19:17:48.000000000 +0700
|
|
||||||
@@ -2829,14 +2829,6 @@
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- "transformation": {
|
|
||||||
- "select_id": 2,
|
|
||||||
- "from": "IN (SELECT)",
|
|
||||||
- "to": "semijoin",
|
|
||||||
- "chosen": true
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- {
|
|
||||||
"expanded_query": "/* select#2 */ select t10.pk from t10"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -4402,14 +4394,6 @@
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- "transformation": {
|
|
||||||
- "select_id": 2,
|
|
||||||
- "from": "IN (SELECT)",
|
|
||||||
- "to": "semijoin",
|
|
||||||
- "chosen": true
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- {
|
|
||||||
"expanded_query": "/* select#2 */ select t_inner_1.a from t1 t_inner_1 join t1 t_inner_2"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -4852,14 +4836,6 @@
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- "transformation": {
|
|
||||||
- "select_id": 2,
|
|
||||||
- "from": "IN (SELECT)",
|
|
||||||
- "to": "semijoin",
|
|
||||||
- "chosen": true
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- {
|
|
||||||
"expanded_query": "/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -4879,14 +4855,6 @@
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- "transformation": {
|
|
||||||
- "select_id": 3,
|
|
||||||
- "from": "IN (SELECT)",
|
|
||||||
- "to": "semijoin",
|
|
||||||
- "chosen": true
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- {
|
|
||||||
"expanded_query": "/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -6432,14 +6400,6 @@
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- "transformation": {
|
|
||||||
- "select_id": 2,
|
|
||||||
- "from": "IN (SELECT)",
|
|
||||||
- "to": "semijoin",
|
|
||||||
- "chosen": true
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- {
|
|
||||||
"expanded_query": "/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -6459,14 +6419,6 @@
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
- "transformation": {
|
|
||||||
- "select_id": 3,
|
|
||||||
- "from": "IN (SELECT)",
|
|
||||||
- "to": "semijoin",
|
|
||||||
- "chosen": true
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- {
|
|
||||||
"expanded_query": "/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4"
|
|
||||||
}
|
|
||||||
]
|
|
@@ -1,6 +1,5 @@
|
|||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
--source include/have_sequence.inc
|
--source include/have_sequence.inc
|
||||||
--source include/protocol.inc
|
|
||||||
SELECT table_name, column_name FROM information_schema.columns where table_name="OPTIMIZER_TRACE";
|
SELECT table_name, column_name FROM information_schema.columns where table_name="OPTIMIZER_TRACE";
|
||||||
set optimizer_trace="enabled=on";
|
set optimizer_trace="enabled=on";
|
||||||
show variables like 'optimizer_trace';
|
show variables like 'optimizer_trace';
|
||||||
|
@@ -717,6 +717,15 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
|
|||||||
if (arena)
|
if (arena)
|
||||||
thd->restore_active_arena(arena, &backup);
|
thd->restore_active_arena(arena, &backup);
|
||||||
in_subs->is_registered_semijoin= TRUE;
|
in_subs->is_registered_semijoin= TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Print the transformation into trace. Do it when we've just set
|
||||||
|
is_registered_semijoin=TRUE above, and also do it when we've already
|
||||||
|
had it set.
|
||||||
|
*/
|
||||||
|
if (in_subs->is_registered_semijoin)
|
||||||
|
{
|
||||||
OPT_TRACE_TRANSFORM(thd, trace_wrapper, trace_transform,
|
OPT_TRACE_TRANSFORM(thd, trace_wrapper, trace_transform,
|
||||||
select_lex->select_number,
|
select_lex->select_number,
|
||||||
"IN (SELECT)", "semijoin");
|
"IN (SELECT)", "semijoin");
|
||||||
|
@@ -2544,7 +2544,8 @@ fil_ibd_load(uint32_t space_id, const char *filename, fil_space_t *&space)
|
|||||||
|
|
||||||
/* Read and validate the first page of the tablespace.
|
/* Read and validate the first page of the tablespace.
|
||||||
Assign a tablespace name based on the tablespace type. */
|
Assign a tablespace name based on the tablespace type. */
|
||||||
switch (file.validate_for_recovery()) {
|
switch (file.validate_for_recovery(
|
||||||
|
static_cast<uint32_t>(space_id))) {
|
||||||
os_offset_t minimum_size;
|
os_offset_t minimum_size;
|
||||||
case DB_SUCCESS:
|
case DB_SUCCESS:
|
||||||
deferred_space = file.m_defer;
|
deferred_space = file.m_defer;
|
||||||
|
@@ -386,10 +386,11 @@ exist and be successfully opened. We initially open it in read-only mode
|
|||||||
because we just want to read the SpaceID. However, if the first page is
|
because we just want to read the SpaceID. However, if the first page is
|
||||||
corrupt and needs to be restored from the doublewrite buffer, we will
|
corrupt and needs to be restored from the doublewrite buffer, we will
|
||||||
reopen it in write mode and ry to restore that page.
|
reopen it in write mode and ry to restore that page.
|
||||||
|
@param space_id space id to validate for recovery
|
||||||
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
|
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
|
||||||
m_is_valid is also set true on success, else false. */
|
m_is_valid is also set true on success, else false. */
|
||||||
dberr_t
|
dberr_t
|
||||||
Datafile::validate_for_recovery()
|
Datafile::validate_for_recovery(uint32_t space_id)
|
||||||
{
|
{
|
||||||
dberr_t err;
|
dberr_t err;
|
||||||
|
|
||||||
@@ -432,15 +433,23 @@ Datafile::validate_for_recovery()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_space_id == UINT32_MAX) {
|
const bool empty_tablespace = (m_space_id == UINT32_MAX);
|
||||||
return DB_SUCCESS; /* empty file */
|
if (empty_tablespace && space_id) {
|
||||||
|
/* Set space id to find out whether
|
||||||
|
the page exist in double write buffer */
|
||||||
|
m_space_id = space_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restore_from_doublewrite()) {
|
if (restore_from_doublewrite()) {
|
||||||
if (m_defer) {
|
if (!m_defer) {
|
||||||
|
return DB_CORRUPTION;
|
||||||
|
}
|
||||||
|
if (!empty_tablespace) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
return(DB_CORRUPTION);
|
/* InnoDB may rebuild the file from redo log */
|
||||||
|
m_space_id = UINT32_MAX;
|
||||||
|
return DB_SUCCESS; /* empty file */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the previously read first page and then re-validate. */
|
/* Free the previously read first page and then re-validate. */
|
||||||
@@ -768,10 +777,13 @@ Datafile::restore_from_doublewrite()
|
|||||||
in the doublewrite buffer, then the recovery is going to fail
|
in the doublewrite buffer, then the recovery is going to fail
|
||||||
now. Hence this is treated as an error. */
|
now. Hence this is treated as an error. */
|
||||||
|
|
||||||
ib::error()
|
if (!m_defer) {
|
||||||
<< "Corrupted page " << page_id
|
ib::error()
|
||||||
<< " of datafile '" << m_filepath
|
<< "Corrupted page " << page_id
|
||||||
<< "' could not be found in the doublewrite buffer.";
|
<< " of datafile '" << m_filepath
|
||||||
|
<< "' could not be found in the "
|
||||||
|
<< "doublewrite buffer.";
|
||||||
|
}
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
@@ -207,9 +207,10 @@ public:
|
|||||||
However, if the first page is corrupt and needs to be restored
|
However, if the first page is corrupt and needs to be restored
|
||||||
from the doublewrite buffer, we will reopen it in write mode and
|
from the doublewrite buffer, we will reopen it in write mode and
|
||||||
ry to restore that page.
|
ry to restore that page.
|
||||||
|
@param space_id space id to validate for recovery
|
||||||
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
|
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
|
||||||
m_is_valid is also set true on success, else false. */
|
m_is_valid is also set true on success, else false. */
|
||||||
dberr_t validate_for_recovery()
|
dberr_t validate_for_recovery(uint32_t space_id=0)
|
||||||
MY_ATTRIBUTE((warn_unused_result));
|
MY_ATTRIBUTE((warn_unused_result));
|
||||||
|
|
||||||
/** Checks the consistency of the first page of a datafile when the
|
/** Checks the consistency of the first page of a datafile when the
|
||||||
|
Reference in New Issue
Block a user