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
46751d4b
Commit
46751d4b
authored
May 03, 2024
by
Monty
Committed by
Sergei Golubchik
May 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-34060 Unexpected behavior upon reading I_S.ALL_PLUGINS under limited tmp space.
parent
7d1467e9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
7 deletions
+74
-7
mysql-test/main/tmp_space_usage.result
mysql-test/main/tmp_space_usage.result
+14
-0
mysql-test/main/tmp_space_usage.test
mysql-test/main/tmp_space_usage.test
+16
-0
sql/sql_select.cc
sql/sql_select.cc
+4
-1
sql/sql_show.cc
sql/sql_show.cc
+40
-6
No files found.
mysql-test/main/tmp_space_usage.result
View file @
46751d4b
...
@@ -199,4 +199,18 @@ set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
...
@@ -199,4 +199,18 @@ set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
SET max_tmp_session_space_usage= 64*1024;
SET max_tmp_session_space_usage= 64*1024;
SELECT MIN(VARIABLE_VALUE) OVER (), NTILE(1) OVER (), MAX(VARIABLE_NAME) OVER () FROM information_schema.SESSION_STATUS;
SELECT MIN(VARIABLE_VALUE) OVER (), NTILE(1) OVER (), MAX(VARIABLE_NAME) OVER () FROM information_schema.SESSION_STATUS;
ERROR HY000: Local temporary space limit reached
ERROR HY000: Local temporary space limit reached
#
# MDEV-34060 Unexpected behavior upon reading I_S.ALL_PLUGINS under
# limited tmp space
#
connect c1, localhost, root,,;
set @@binlog_format=row;
CREATE OR REPLACE TABLE t1 (a DATETIME) ENGINE=MyISAM;
INSERT INTO t1 SELECT NOW() FROM seq_1_to_6000;
SET max_tmp_session_space_usage = 64*1024;
SELECT * FROM information_schema.ALL_PLUGINS LIMIT 2;
ERROR HY000: Local temporary space limit reached
drop table t1;
connection default;
disconnect c1;
# End of 11.5 tests
# End of 11.5 tests
mysql-test/main/tmp_space_usage.test
View file @
46751d4b
...
@@ -259,4 +259,20 @@ SET max_tmp_session_space_usage= 64*1024;
...
@@ -259,4 +259,20 @@ SET max_tmp_session_space_usage= 64*1024;
--
error
200
--
error
200
SELECT
MIN
(
VARIABLE_VALUE
)
OVER
(),
NTILE
(
1
)
OVER
(),
MAX
(
VARIABLE_NAME
)
OVER
()
FROM
information_schema
.
SESSION_STATUS
;
SELECT
MIN
(
VARIABLE_VALUE
)
OVER
(),
NTILE
(
1
)
OVER
(),
MAX
(
VARIABLE_NAME
)
OVER
()
FROM
information_schema
.
SESSION_STATUS
;
--
echo
#
--
echo
# MDEV-34060 Unexpected behavior upon reading I_S.ALL_PLUGINS under
--
echo
# limited tmp space
--
echo
#
connect
(
c1
,
localhost
,
root
,,);
set
@@
binlog_format
=
row
;
CREATE
OR
REPLACE
TABLE
t1
(
a
DATETIME
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
SELECT
NOW
()
FROM
seq_1_to_6000
;
SET
max_tmp_session_space_usage
=
64
*
1024
;
--
error
200
SELECT
*
FROM
information_schema
.
ALL_PLUGINS
LIMIT
2
;
drop
table
t1
;
connection
default
;
disconnect
c1
;
--
echo
# End of 11.5 tests
--
echo
# End of 11.5 tests
sql/sql_select.cc
View file @
46751d4b
...
@@ -4972,7 +4972,10 @@ int JOIN::exec_inner()
...
@@ -4972,7 +4972,10 @@ int JOIN::exec_inner()
if ((this->select_lex->options & OPTION_SCHEMA_TABLE) &&
if ((this->select_lex->options & OPTION_SCHEMA_TABLE) &&
get_schema_tables_result(this, PROCESSED_BY_JOIN_EXEC))
get_schema_tables_result(this, PROCESSED_BY_JOIN_EXEC))
DBUG_RETURN(0);
{
error= thd->is_error();
DBUG_RETURN(error);
}
if (select_options & SELECT_DESCRIBE)
if (select_options & SELECT_DESCRIBE)
{
{
sql/sql_show.cc
View file @
46751d4b
...
@@ -345,11 +345,32 @@ int fill_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -345,11 +345,32 @@ int fill_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
}
}
/* Ignore common errors from plugin load */
class
plugin_show_error_handler
:
public
Internal_error_handler
{
public:
bool
handle_condition
(
THD
*
thd
,
uint
sql_errno
,
const
char
*
sqlstate
,
Sql_condition
::
enum_warning_level
*
level
,
const
char
*
msg
,
Sql_condition
**
cond_hdl
)
{
if
(
sql_errno
==
ER_CANT_FIND_DL_ENTRY
)
return
true
;
return
false
;
}
};
int
fill_all_plugins
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
*
cond
)
int
fill_all_plugins
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
*
cond
)
{
{
DBUG_ENTER
(
"fill_all_plugins"
);
DBUG_ENTER
(
"fill_all_plugins"
);
TABLE
*
table
=
tables
->
table
;
TABLE
*
table
=
tables
->
table
;
LOOKUP_FIELD_VALUES
lookup
;
LOOKUP_FIELD_VALUES
lookup
;
plugin_show_error_handler
err_handler
;
const
char
*
wstr
,
*
wend
;
if
(
get_lookup_field_values
(
thd
,
cond
,
true
,
tables
,
&
lookup
))
if
(
get_lookup_field_values
(
thd
,
cond
,
true
,
tables
,
&
lookup
))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
@@ -364,10 +385,16 @@ int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -364,10 +385,16 @@ int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
thd
->
push_internal_handler
(
&
err_handler
);
if
(
!
lookup
.
db_value
.
str
)
if
(
!
lookup
.
db_value
.
str
)
plugin_dl_foreach
(
thd
,
0
,
show_plugins
,
table
);
{
if
(
plugin_dl_foreach
(
thd
,
0
,
show_plugins
,
table
)
&&
thd
->
is_error
())
goto
end
;
}
const
char
*
wstr
=
lookup
.
db_value
.
str
,
*
wend
=
wstr
+
lookup
.
db_value
.
length
;
wstr
=
lookup
.
db_value
.
str
;
wend
=
wstr
+
lookup
.
db_value
.
length
;
for
(
size_t
i
=
0
;
i
<
dirp
->
number_of_files
;
i
++
)
for
(
size_t
i
=
0
;
i
<
dirp
->
number_of_files
;
i
++
)
{
{
FILEINFO
*
file
=
dirp
->
dir_entry
+
i
;
FILEINFO
*
file
=
dirp
->
dir_entry
+
i
;
...
@@ -394,12 +421,14 @@ int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -394,12 +421,14 @@ int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
}
}
}
}
plugin_dl_foreach
(
thd
,
&
dl
,
show_plugins
,
table
);
if
(
plugin_dl_foreach
(
thd
,
&
dl
,
show_plugins
,
table
)
&&
thd
->
is_error
())
thd
->
clear_error
()
;
break
;
}
}
end:
thd
->
pop_internal_handler
();
my_dirend
(
dirp
);
my_dirend
(
dirp
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
thd
->
is_error
()
);
}
}
...
@@ -4810,12 +4839,17 @@ fill_schema_table_by_open(THD *thd, MEM_ROOT *mem_root,
...
@@ -4810,12 +4839,17 @@ fill_schema_table_by_open(THD *thd, MEM_ROOT *mem_root,
&&
thd
->
get_stmt_da
()
->
sql_errno
()
!=
ER_WRONG_OBJECT
&&
thd
->
get_stmt_da
()
->
sql_errno
()
!=
ER_WRONG_OBJECT
&&
thd
->
get_stmt_da
()
->
sql_errno
()
!=
ER_NOT_SEQUENCE
;
&&
thd
->
get_stmt_da
()
->
sql_errno
()
!=
ER_NOT_SEQUENCE
;
if
(
!
run
)
if
(
!
run
)
{
thd
->
clear_error
();
thd
->
clear_error
();
result
=
false
;
}
else
if
(
!
ext_error_handling
)
else
if
(
!
ext_error_handling
)
{
convert_error_to_warning
(
thd
);
convert_error_to_warning
(
thd
);
result
=
false
;
result
=
false
;
}
}
}
}
}
if
(
run
&&
(
!
open_result
||
ext_error_handling
))
if
(
run
&&
(
!
open_result
||
ext_error_handling
))
{
{
...
...
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