Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e384299e
Commit
e384299e
authored
Dec 02, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.7 into 10.8
parents
02de93d1
1e54a971
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
104 deletions
+34
-104
mysql-test/main/opt_trace,ps.rdiff
mysql-test/main/opt_trace,ps.rdiff
+0
-92
mysql-test/main/opt_trace.test
mysql-test/main/opt_trace.test
+0
-1
sql/opt_subselect.cc
sql/opt_subselect.cc
+9
-0
storage/innobase/fil/fil0fil.cc
storage/innobase/fil/fil0fil.cc
+2
-1
storage/innobase/fsp/fsp0file.cc
storage/innobase/fsp/fsp0file.cc
+21
-9
storage/innobase/include/fsp0file.h
storage/innobase/include/fsp0file.h
+2
-1
No files found.
mysql-test/main/opt_trace,ps.rdiff
deleted
100644 → 0
View file @
02de93d1
--- /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"
}
]
mysql-test/main/opt_trace.test
View file @
e384299e
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_sequence
.
inc
--
source
include
/
protocol
.
inc
SELECT
table_name
,
column_name
FROM
information_schema
.
columns
where
table_name
=
"OPTIMIZER_TRACE"
;
set
optimizer_trace
=
"enabled=on"
;
show
variables
like
'optimizer_trace'
;
...
...
sql/opt_subselect.cc
View file @
e384299e
...
...
@@ -717,6 +717,15 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
if
(
arena
)
thd
->
restore_active_arena
(
arena
,
&
backup
);
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
,
select_lex
->
select_number
,
"IN (SELECT)"
,
"semijoin"
);
...
...
storage/innobase/fil/fil0fil.cc
View file @
e384299e
...
...
@@ -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.
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
;
case
DB_SUCCESS
:
deferred_space
=
file
.
m_defer
;
...
...
storage/innobase/fsp/fsp0file.cc
View file @
e384299e
...
...
@@ -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
corrupt and needs to be restored from the doublewrite buffer, we will
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.
m_is_valid is also set true on success, else false. */
dberr_t
Datafile
::
validate_for_recovery
()
Datafile
::
validate_for_recovery
(
uint32_t
space_id
)
{
dberr_t
err
;
...
...
@@ -432,15 +433,23 @@ Datafile::validate_for_recovery()
}
}
if
(
m_space_id
==
UINT32_MAX
)
{
return
DB_SUCCESS
;
/* empty file */
const
bool
empty_tablespace
=
(
m_space_id
==
UINT32_MAX
);
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
(
m_defer
)
{
if
(
!
m_defer
)
{
return
DB_CORRUPTION
;
}
if
(
!
empty_tablespace
)
{
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. */
...
...
@@ -768,10 +777,13 @@ Datafile::restore_from_doublewrite()
in the doublewrite buffer, then the recovery is going to fail
now. Hence this is treated as an error. */
ib
::
error
()
<<
"Corrupted page "
<<
page_id
<<
" of datafile '"
<<
m_filepath
<<
"' could not be found in the doublewrite buffer."
;
if
(
!
m_defer
)
{
ib
::
error
()
<<
"Corrupted page "
<<
page_id
<<
" of datafile '"
<<
m_filepath
<<
"' could not be found in the "
<<
"doublewrite buffer."
;
}
return
(
true
);
}
...
...
storage/innobase/include/fsp0file.h
View file @
e384299e
...
...
@@ -207,9 +207,10 @@ class Datafile {
However, if the first page is corrupt and needs to be restored
from the doublewrite buffer, we will 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.
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
));
/** Checks the consistency of the first page of a datafile when the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment