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
11196347
Commit
11196347
authored
Nov 30, 2020
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make LEX::print support single-table DELETE.
parent
e34e53b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
sql/sql_lex.cc
sql/sql_lex.cc
+39
-2
No files found.
sql/sql_lex.cc
View file @
11196347
...
...
@@ -3567,8 +3567,10 @@ void LEX::print(String *str, enum_query_type query_type)
str
->
append
(
STRING_WITH_LEN
(
"UPDATE "
));
if
(
ignore
)
str
->
append
(
STRING_WITH_LEN
(
"IGNORE "
));
// table name
str
->
append
(
query_tables
->
alias
);
// table name. If the query was using a view, we need
// the underlying table name, not the view name
TABLE_LIST
*
base_tbl
=
query_tables
->
table
->
pos_in_table_list
;
base_tbl
->
print
(
thd
,
table_map
(
0
),
str
,
query_type
);
str
->
append
(
STRING_WITH_LEN
(
" SET "
));
// print item assignments
List_iterator
<
Item
>
it
(
sel
->
item_list
);
...
...
@@ -3608,6 +3610,41 @@ void LEX::print(String *str, enum_query_type query_type)
sel
->
select_limit
->
print
(
str
,
query_type
);
}
}
else
if
(
sql_command
==
SQLCOM_DELETE
)
{
SELECT_LEX
*
sel
=
first_select_lex
();
str
->
append
(
STRING_WITH_LEN
(
"DELETE "
));
if
(
ignore
)
str
->
append
(
STRING_WITH_LEN
(
"IGNORE "
));
str
->
append
(
STRING_WITH_LEN
(
"FROM "
));
// table name. If the query was using a view, we need
// the underlying table name, not the view name
TABLE_LIST
*
base_tbl
=
query_tables
->
table
->
pos_in_table_list
;
base_tbl
->
print
(
thd
,
table_map
(
0
),
str
,
query_type
);
if
(
sel
->
where
)
{
str
->
append
(
STRING_WITH_LEN
(
" WHERE "
));
sel
->
where
->
print
(
str
,
query_type
);
}
if
(
sel
->
order_list
.
elements
)
{
str
->
append
(
STRING_WITH_LEN
(
" ORDER BY "
));
for
(
ORDER
*
ord
=
sel
->
order_list
.
first
;
ord
;
ord
=
ord
->
next
)
{
if
(
ord
!=
sel
->
order_list
.
first
)
str
->
append
(
STRING_WITH_LEN
(
", "
));
(
*
ord
->
item
)
->
print
(
str
,
query_type
);
}
}
if
(
sel
->
select_limit
)
{
str
->
append
(
STRING_WITH_LEN
(
" LIMIT "
));
sel
->
select_limit
->
print
(
str
,
query_type
);
}
}
else
DBUG_ASSERT
(
0
);
// Not implemented yet
}
...
...
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