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
fec5ab5a
Commit
fec5ab5a
authored
Oct 12, 2014
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6396: ANALYZE INSERT/REPLACE is accepted, but does not produce a plan
Add ANALYZE STMT handling into INSERT command.
parent
5c33632b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
mysql-test/r/analyze_stmt.result
mysql-test/r/analyze_stmt.result
+17
-0
mysql-test/t/analyze_stmt.test
mysql-test/t/analyze_stmt.test
+11
-0
sql/sql_insert.cc
sql/sql_insert.cc
+5
-0
No files found.
mysql-test/r/analyze_stmt.result
View file @
fec5ab5a
...
...
@@ -259,3 +259,20 @@ analyze delete from t1 returning *;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 0 0 100.00 100.00
drop table t1;
#
# MDEV-6396: ANALYZE INSERT/REPLACE is accepted, but does not produce a plan
#
create table t1 (a int primary key, b int);
analyze insert into t1 values (1,1);
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
select * from t1;
a b
1 1
analyze replace t1 values (1,2);
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
select * from t1;
a b
1 2
drop table t1;
mysql-test/t/analyze_stmt.test
View file @
fec5ab5a
...
...
@@ -206,3 +206,14 @@ create table t1 (i int);
analyze
delete
from
t1
returning
*
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-6396: ANALYZE INSERT/REPLACE is accepted, but does not produce a plan
--
echo
#
create
table
t1
(
a
int
primary
key
,
b
int
);
analyze
insert
into
t1
values
(
1
,
1
);
select
*
from
t1
;
analyze
replace
t1
values
(
1
,
2
);
select
*
from
t1
;
drop
table
t1
;
sql/sql_insert.cc
View file @
fec5ab5a
...
...
@@ -1100,6 +1100,11 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if
(
error
)
goto
abort
;
if
(
thd
->
lex
->
analyze_stmt
)
{
retval
=
thd
->
lex
->
explain
->
send_explain
(
thd
);
goto
abort
;
}
if
(
values_list
.
elements
==
1
&&
(
!
(
thd
->
variables
.
option_bits
&
OPTION_WARNINGS
)
||
!
thd
->
cuted_fields
))
{
...
...
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