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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f60e47fd
Commit
f60e47fd
authored
Nov 28, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
INSERT ... UPDATE syntax (syntax only)
sql_yacc.yy and sql_parse.cc cleanup
parent
27dc59e7
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
75 deletions
+71
-75
sql/lex.h
sql/lex.h
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+14
-20
sql/sql_yacc.yy
sql/sql_yacc.yy
+55
-54
No files found.
sql/lex.h
View file @
f60e47fd
...
...
@@ -135,6 +135,7 @@ static SYMBOL symbols[] = {
{
"DROP"
,
SYM
(
DROP
),
0
,
0
},
{
"DUMPFILE"
,
SYM
(
DUMPFILE
),
0
,
0
},
{
"DYNAMIC"
,
SYM
(
DYNAMIC_SYM
),
0
,
0
},
{
"DUPLICATE"
,
SYM
(
DUPLICATE
),
0
,
0
},
{
"ERRORS"
,
SYM
(
ERRORS
),
0
,
0
},
{
"END"
,
SYM
(
END
),
0
,
0
},
{
"ELSE"
,
SYM
(
ELSE
),
0
,
0
},
...
...
sql/sql_parse.cc
View file @
f60e47fd
...
...
@@ -1961,25 +1961,19 @@ mysql_execute_command(THD *thd)
close_thread_tables
(
thd
);
}
break
;
case
SQLCOM_REPLACE
:
case
SQLCOM_INSERT
:
if
(
check_access
(
thd
,
INSERT_ACL
,
tables
->
db
,
&
tables
->
grant
.
privilege
))
{
ulong
privilege
=
(
lex
->
duplicates
==
DUP_REPLACE
?
INSERT_ACL
|
DELETE_ACL
:
INSERT_ACL
);
if
(
check_access
(
thd
,
privilege
,
tables
->
db
,
&
tables
->
grant
.
privilege
))
goto
error
;
/* purecov: inspected */
if
(
grant_option
&&
check_grant
(
thd
,
INSERT_ACL
,
tables
))
if
(
grant_option
&&
check_grant
(
thd
,
privilege
,
tables
))
goto
error
;
res
=
mysql_insert
(
thd
,
tables
,
lex
->
field_list
,
lex
->
many_values
,
lex
->
duplicates
);
break
;
case
SQLCOM_REPLACE
:
if
(
check_access
(
thd
,
INSERT_ACL
|
DELETE_ACL
,
tables
->
db
,
&
tables
->
grant
.
privilege
))
goto
error
;
/* purecov: inspected */
if
(
grant_option
&&
check_grant
(
thd
,
INSERT_ACL
|
DELETE_ACL
,
tables
))
goto
error
;
res
=
mysql_insert
(
thd
,
tables
,
lex
->
field_list
,
lex
->
many_values
,
DUP_REPLACE
);
break
;
}
case
SQLCOM_REPLACE_SELECT
:
case
SQLCOM_INSERT_SELECT
:
{
...
...
@@ -1989,8 +1983,8 @@ mysql_execute_command(THD *thd)
select privileges for the rest
*/
{
ulong
privilege
=
(
lex
->
sql_command
==
SQLCOM_INSERT_SELECT
?
INSERT_ACL
:
INSERT_ACL
|
DELETE
_ACL
);
ulong
privilege
=
(
lex
->
duplicates
==
DUP_REPLACE
?
INSERT_ACL
|
DELETE_ACL
:
INSERT
_ACL
);
TABLE_LIST
*
save_next
=
tables
->
next
;
tables
->
next
=
0
;
if
(
check_access
(
thd
,
privilege
,
...
...
sql/sql_yacc.yy
View file @
f60e47fd
This diff is collapsed.
Click to expand it.
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