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
4145ebf9
Commit
4145ebf9
authored
Jul 02, 2021
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra
parent
164a64ba
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
3 deletions
+149
-3
mysql-test/main/flush.result
mysql-test/main/flush.result
+34
-0
mysql-test/main/flush.test
mysql-test/main/flush.test
+38
-0
mysql-test/main/flush_notembedded.result
mysql-test/main/flush_notembedded.result
+41
-1
mysql-test/main/flush_notembedded.test
mysql-test/main/flush_notembedded.test
+35
-1
sql/sql_reload.cc
sql/sql_reload.cc
+1
-1
No files found.
mysql-test/main/flush.result
View file @
4145ebf9
...
@@ -626,3 +626,37 @@ show status like "Threads_cached";
...
@@ -626,3 +626,37 @@ show status like "Threads_cached";
Variable_name Value
Variable_name Value
Threads_cached 0
Threads_cached 0
set @@global.thread_cache_size=@save_thread_cache_size;
set @@global.thread_cache_size=@save_thread_cache_size;
#
# MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra
#
CREATE VIEW v0 AS SELECT 1;
CREATE VIEW v1 AS SELECT 1 FROM (SELECT 1) AS d;
CREATE VIEW v2 AS SELECT * FROM v1;
FLUSH TABLE v0 WITH READ LOCK;
DROP VIEW v0;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
FLUSH TABLE v1 WITH READ LOCK;
DROP VIEW v1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
FLUSH TABLE v2 WITH READ LOCK;
DROP VIEW v2;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
FLUSH TABLE v0 FOR EXPORT;
DROP VIEW v0;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
FLUSH TABLE v1 FOR EXPORT;
DROP VIEW v1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
FLUSH TABLE v2 FOR EXPORT;
DROP VIEW v2;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
DROP VIEW v2, v1, v0;
#
# End of 10.6 tests
#
mysql-test/main/flush.test
View file @
4145ebf9
...
@@ -745,3 +745,41 @@ set @@global.thread_cache_size=0;
...
@@ -745,3 +745,41 @@ set @@global.thread_cache_size=0;
flush
threads
;
flush
threads
;
show
status
like
"Threads_cached"
;
show
status
like
"Threads_cached"
;
set
@@
global
.
thread_cache_size
=@
save_thread_cache_size
;
set
@@
global
.
thread_cache_size
=@
save_thread_cache_size
;
--
echo
#
--
echo
# MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra
--
echo
#
CREATE
VIEW
v0
AS
SELECT
1
;
CREATE
VIEW
v1
AS
SELECT
1
FROM
(
SELECT
1
)
AS
d
;
CREATE
VIEW
v2
AS
SELECT
*
FROM
v1
;
FLUSH
TABLE
v0
WITH
READ
LOCK
;
--
error
ER_LOCK_OR_ACTIVE_TRANSACTION
DROP
VIEW
v0
;
UNLOCK
TABLES
;
FLUSH
TABLE
v1
WITH
READ
LOCK
;
--
error
ER_LOCK_OR_ACTIVE_TRANSACTION
DROP
VIEW
v1
;
UNLOCK
TABLES
;
FLUSH
TABLE
v2
WITH
READ
LOCK
;
--
error
ER_LOCK_OR_ACTIVE_TRANSACTION
DROP
VIEW
v2
;
UNLOCK
TABLES
;
FLUSH
TABLE
v0
FOR
EXPORT
;
--
error
ER_LOCK_OR_ACTIVE_TRANSACTION
DROP
VIEW
v0
;
UNLOCK
TABLES
;
FLUSH
TABLE
v1
FOR
EXPORT
;
--
error
ER_LOCK_OR_ACTIVE_TRANSACTION
DROP
VIEW
v1
;
UNLOCK
TABLES
;
FLUSH
TABLE
v2
FOR
EXPORT
;
--
error
ER_LOCK_OR_ACTIVE_TRANSACTION
DROP
VIEW
v2
;
UNLOCK
TABLES
;
DROP
VIEW
v2
,
v1
,
v0
;
--
echo
#
--
echo
# End of 10.6 tests
--
echo
#
mysql-test/main/flush_notembedded.result
View file @
4145ebf9
...
@@ -14,15 +14,55 @@ flush tables mysqltest1.t1 for export;
...
@@ -14,15 +14,55 @@ flush tables mysqltest1.t1 for export;
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
create view v as select * from mysqltest1.t1;
create view v as select * from mysqltest1.t1;
create view v2 as select * from v;
create view v2 as select * from v;
create view v3 as select * from (select * from mysqltest1.t1) x;
flush tables v for export;
flush tables v for export;
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
flush tables v2 for export;
flush tables v2 for export;
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
flush tables v3 for export;
ERROR 42000: Access denied for user 'u1'@'localhost' to database 'mysqltest1'
disconnect u1;
disconnect u1;
connection default;
connection default;
drop database mysqltest1;
drop database mysqltest1;
drop view v, v2;
drop view v, v2
, v3
;
drop user u1@localhost;
drop user u1@localhost;
#
#
# MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra
#
CREATE VIEW v0 AS SELECT * FROM information_schema.columns;
CREATE VIEW v1 AS SELECT * FROM information_schema.collations;
CREATE VIEW v2 AS SELECT * FROM performance_schema.accounts;
#
# first try to flush tables directly
#
FLUSH TABLE information_schema.collations WITH READ LOCK;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE performance_schema.accounts WITH READ LOCK;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'
FLUSH TABLE information_schema.colums WITH READ LOCK;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE information_schema.collations FOR EXPORT;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE performance_schema.accounts FOR EXPORT;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'
FLUSH TABLE information_schema.colums FOR EXPORT;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
#
# and now via views
#
FLUSH TABLE v0 WITH READ LOCK;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE v1 WITH READ LOCK;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE v2 WITH READ LOCK;
ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
FLUSH TABLE v0 FOR EXPORT;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE v1 FOR EXPORT;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
FLUSH TABLE v2 FOR EXPORT;
ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP VIEW v0, v1, v2;
#
# End of 10.6 tests
# End of 10.6 tests
#
#
mysql-test/main/flush_notembedded.test
View file @
4145ebf9
source
include
/
not_embedded
.
inc
;
source
include
/
not_embedded
.
inc
;
source
include
/
have_perfschema
.
inc
;
--
echo
#
--
echo
#
--
echo
# MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views.
--
echo
# MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views.
...
@@ -17,16 +18,49 @@ error ER_DBACCESS_DENIED_ERROR;
...
@@ -17,16 +18,49 @@ error ER_DBACCESS_DENIED_ERROR;
flush
tables
mysqltest1
.
t1
for
export
;
flush
tables
mysqltest1
.
t1
for
export
;
create
view
v
as
select
*
from
mysqltest1
.
t1
;
create
view
v
as
select
*
from
mysqltest1
.
t1
;
create
view
v2
as
select
*
from
v
;
create
view
v2
as
select
*
from
v
;
create
view
v3
as
select
*
from
(
select
*
from
mysqltest1
.
t1
)
x
;
error
ER_DBACCESS_DENIED_ERROR
;
error
ER_DBACCESS_DENIED_ERROR
;
flush
tables
v
for
export
;
flush
tables
v
for
export
;
error
ER_DBACCESS_DENIED_ERROR
;
error
ER_DBACCESS_DENIED_ERROR
;
flush
tables
v2
for
export
;
flush
tables
v2
for
export
;
error
ER_DBACCESS_DENIED_ERROR
;
flush
tables
v3
for
export
;
disconnect
u1
;
disconnect
u1
;
connection
default
;
connection
default
;
drop
database
mysqltest1
;
drop
database
mysqltest1
;
drop
view
v
,
v2
;
drop
view
v
,
v2
,
v3
;
drop
user
u1
@
localhost
;
drop
user
u1
@
localhost
;
--
echo
#
--
echo
# MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra
--
echo
#
CREATE
VIEW
v0
AS
SELECT
*
FROM
information_schema
.
columns
;
# Aria
CREATE
VIEW
v1
AS
SELECT
*
FROM
information_schema
.
collations
;
# Heap
CREATE
VIEW
v2
AS
SELECT
*
FROM
performance_schema
.
accounts
;
--
disable_abort_on_error
--
echo
#
--
echo
# first try to flush tables directly
--
echo
#
FLUSH
TABLE
information_schema
.
collations
WITH
READ
LOCK
;
FLUSH
TABLE
performance_schema
.
accounts
WITH
READ
LOCK
;
FLUSH
TABLE
information_schema
.
colums
WITH
READ
LOCK
;
FLUSH
TABLE
information_schema
.
collations
FOR
EXPORT
;
FLUSH
TABLE
performance_schema
.
accounts
FOR
EXPORT
;
FLUSH
TABLE
information_schema
.
colums
FOR
EXPORT
;
--
echo
#
--
echo
# and now via views
--
echo
#
FLUSH
TABLE
v0
WITH
READ
LOCK
;
FLUSH
TABLE
v1
WITH
READ
LOCK
;
FLUSH
TABLE
v2
WITH
READ
LOCK
;
FLUSH
TABLE
v0
FOR
EXPORT
;
FLUSH
TABLE
v1
FOR
EXPORT
;
FLUSH
TABLE
v2
FOR
EXPORT
;
--
enable_abort_on_error
DROP
VIEW
v0
,
v1
,
v2
;
--
echo
#
--
echo
#
--
echo
# End of 10.6 tests
--
echo
# End of 10.6 tests
--
echo
#
--
echo
#
sql/sql_reload.cc
View file @
4145ebf9
...
@@ -598,7 +598,7 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
...
@@ -598,7 +598,7 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
table_list
->
hide_view_error
(
thd
);
table_list
->
hide_view_error
(
thd
);
goto
error_reset_bits
;
goto
error_reset_bits
;
}
}
if
(
table_list
->
is_view
())
if
(
table_list
->
is_view
_or_derived
())
continue
;
continue
;
if
(
thd
->
lex
->
type
&
REFRESH_FOR_EXPORT
&&
if
(
thd
->
lex
->
type
&
REFRESH_FOR_EXPORT
&&
!
(
table_list
->
table
->
file
->
ha_table_flags
()
&
HA_CAN_EXPORT
))
!
(
table_list
->
table
->
file
->
ha_table_flags
()
&
HA_CAN_EXPORT
))
...
...
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