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
7d9a9fd9
Commit
7d9a9fd9
authored
Apr 12, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing return statement
parent
8b72dde8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
62 deletions
+72
-62
sql/sql_delete.cc
sql/sql_delete.cc
+4
-3
sql/sql_lex.cc
sql/sql_lex.cc
+16
-13
sql/sql_parse.cc
sql/sql_parse.cc
+52
-46
No files found.
sql/sql_delete.cc
View file @
7d9a9fd9
...
...
@@ -254,9 +254,9 @@ cleanup:
*/
int
mysql_prepare_delete
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
Item
**
conds
)
{
TABLE_LIST
*
delete_table_list
=
(
TABLE_LIST
*
)
thd
->
lex
->
select_lex
.
table_list
.
first
;
DBUG_ENTER
(
"
mysql_prepare_delete"
);
TABLE_LIST
*
delete_table_list
=
((
TABLE_LIST
*
)
thd
->
lex
->
select_lex
.
table_list
.
first
)
;
DBUG_ENTER
(
"mysql_prepare_delete"
);
if
(
setup_conds
(
thd
,
delete_table_list
,
conds
)
||
setup_ftfuncs
(
&
thd
->
lex
->
select_lex
))
...
...
@@ -267,6 +267,7 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
my_error
(
ER_UPDATE_TABLE_USED
,
MYF
(
0
),
table_list
->
real_name
);
DBUG_RETURN
(
-
1
);
}
DBUG_RETURN
(
0
);
}
...
...
sql/sql_lex.cc
View file @
7d9a9fd9
...
...
@@ -1636,17 +1636,21 @@ void st_select_lex::print_limit(THD *thd, String *str)
/*
Unlink first table from global table list and first
must outer select lis
t
(lex->select_lex)
Unlink first table from global table list and first
table from outer selec
t
list
(lex->select_lex)
SYNOPSIS
unlink_first_table()
tables - global table list
global_first - save first global table passed using this parameter
local_first - save first local table passed using this parameter
tables Global table list
global_first Save first global table here
local_first Save first local table here
NORES
global_first & local_first are used to save result for link_first_table_back
RETURN
global list without first table
*/
TABLE_LIST
*
st_lex
::
unlink_first_table
(
TABLE_LIST
*
tables
,
TABLE_LIST
**
global_first
,
...
...
@@ -1655,16 +1659,15 @@ TABLE_LIST *st_lex::unlink_first_table(TABLE_LIST *tables,
*
global_first
=
tables
;
*
local_first
=
(
TABLE_LIST
*
)
select_lex
.
table_list
.
first
;
/*
e
xclude from global table list
E
xclude from global table list
*/
tables
=
tables
->
next
;
/*
and from local list if it is not the same
*/
if
(
&
select_lex
!=
all_selects_list
)
select_lex
.
table_list
.
first
=
(
gptr
)(
*
local_first
)
->
next
;
else
select_lex
.
table_list
.
first
=
(
gptr
)
tables
;
select_lex
.
table_list
.
first
=
((
&
select_lex
!=
all_selects_list
)
?
(
gptr
)
(
*
local_first
)
->
next
:
(
gptr
)
tables
);
(
*
global_first
)
->
next
=
0
;
return
tables
;
}
...
...
@@ -1675,9 +1678,9 @@ TABLE_LIST *st_lex::unlink_first_table(TABLE_LIST *tables,
SYNOPSIS
link_first_table_back()
tables
- g
lobal table list
global_first
- save
first global table
local_first
- save
first local table
tables
G
lobal table list
global_first
Saved
first global table
local_first
Saved
first local table
RETURN
global list
...
...
sql/sql_parse.cc
View file @
7d9a9fd9
...
...
@@ -2136,8 +2136,7 @@ mysql_execute_command(THD *thd)
if
(
grant_option
)
{
/* Check that the first table has CREATE privilege */
bool
error
=
check_grant
(
thd
,
CREATE_ACL
,
tables
,
0
,
1
,
0
);
if
(
error
)
if
(
check_grant
(
thd
,
CREATE_ACL
,
tables
,
0
,
1
,
0
))
goto
error
;
}
if
(
strlen
(
tables
->
real_name
)
>
NAME_LEN
)
...
...
@@ -2638,14 +2637,14 @@ unsent_create_error:
{
TABLE_LIST
*
aux_tables
=
(
TABLE_LIST
*
)
thd
->
lex
->
auxilliary_table_list
.
first
;
TABLE_LIST
*
target_tbl
;
uint
table_count
;
multi_delete
*
result
;
if
((
res
=
multi_delete_precheck
(
thd
,
tables
,
&
table_count
)))
break
;
/
/ condition will be TRUE on SP re esexcuting
/
* condition will be TRUE on SP re-excuting */
if
(
select_lex
->
item_list
.
elements
!=
0
)
select_lex
->
item_list
.
empty
();
if
(
add_item_to_list
(
thd
,
new
Item_null
()))
...
...
@@ -3387,18 +3386,18 @@ error:
0 - OK
1 - access denied, error is sent to client
*/
int
check_one_table_access
(
THD
*
thd
,
ulong
privilege
,
TABLE_LIST
*
tables
)
int
check_one_table_access
(
THD
*
thd
,
ulong
privilege
,
TABLE_LIST
*
tables
)
{
if
(
check_access
(
thd
,
privilege
,
tables
->
db
,
&
tables
->
grant
.
privilege
,
0
,
0
))
return
1
;
/
/ Show only 1 table for check_grant
/
* Show only 1 table for check_grant */
if
(
grant_option
&&
check_grant
(
thd
,
privilege
,
tables
,
0
,
1
,
0
))
return
1
;
/
/ check rights on tables of subselect (if exists)
/
* Check rights on tables of subselect (if exists) */
TABLE_LIST
*
subselects_tables
;
if
((
subselects_tables
=
tables
->
next
))
{
...
...
@@ -3851,6 +3850,7 @@ void mysql_init_multi_delete(LEX *lex)
When you modify mysql_parse(), you may need to mofify
mysql_test_parse_for_slave() in this same file.
*/
void
mysql_parse
(
THD
*
thd
,
char
*
inBuf
,
uint
length
)
{
DBUG_ENTER
(
"mysql_parse"
);
...
...
@@ -4928,14 +4928,15 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop)
SYNOPSIS
multi_update_precheck()
thd
- t
hread handler
tables
- g
lobal table list
thd
T
hread handler
tables
G
lobal table list
RETURN VALUE
0
-
OK
1
- e
rror (message is sent to user)
-1
- e
rror (message is not sent to user)
0 OK
1
E
rror (message is sent to user)
-1
E
rror (message is not sent to user)
*/
int
multi_update_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
DBUG_ENTER
(
"multi_update_precheck"
);
...
...
@@ -5016,14 +5017,14 @@ int multi_update_precheck(THD *thd, TABLE_LIST *tables)
SYNOPSIS
multi_delete_precheck()
thd
- t
hread handler
tables
- g
lobal table list
table_count
- p
ointer to table counter
thd
T
hread handler
tables
G
lobal table list
table_count
P
ointer to table counter
RETURN VALUE
0
-
OK
1
-
error (message is sent to user)
-1
-
error (message is not sent to user)
0 OK
1 error (message is sent to user)
-1 error (message is not sent to user)
*/
int
multi_delete_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
,
uint
*
table_count
)
{
...
...
@@ -5083,14 +5084,15 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count)
SYNOPSIS
multi_delete_precheck()
thd
- t
hread handler
tables
- g
lobal table list
thd
T
hread handler
tables
G
lobal table list
RETURN VALUE
0
-
OK
1
- e
rror (message is sent to user)
-1
- e
rror (message is not sent to user)
0 OK
1
E
rror (message is sent to user)
-1
E
rror (message is not sent to user)
*/
int
insert_select_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
DBUG_ENTER
(
"insert_select_precheck"
);
...
...
@@ -5109,14 +5111,15 @@ int insert_select_precheck(THD *thd, TABLE_LIST *tables)
SYNOPSIS
update_precheck()
thd
- t
hread handler
tables
- g
lobal table list
thd
T
hread handler
tables
G
lobal table list
RETURN VALUE
0
-
OK
1
- e
rror (message is sent to user)
-1
- e
rror (message is not sent to user)
0 OK
1
E
rror (message is sent to user)
-1
E
rror (message is not sent to user)
*/
int
update_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
DBUG_ENTER
(
"update_precheck"
);
...
...
@@ -5135,20 +5138,21 @@ int update_precheck(THD *thd, TABLE_LIST *tables)
SYNOPSIS
delete_precheck()
thd
- t
hread handler
tables
- g
lobal table list
thd
T
hread handler
tables
G
lobal table list
RETURN VALUE
0
-
OK
1
-
error (message is sent to user)
-1
-
error (message is not sent to user)
0 OK
1 error (message is sent to user)
-1 error (message is not sent to user)
*/
int
delete_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
DBUG_ENTER
(
"delete_precheck"
);
if
(
check_one_table_access
(
thd
,
DELETE_ACL
,
tables
))
DBUG_RETURN
(
1
);
/
/ Set privilege for the WHERE clause
/
* Set privilege for the WHERE clause */
tables
->
grant
.
want_privilege
=
(
SELECT_ACL
&
~
tables
->
grant
.
privilege
);
DBUG_RETURN
(
0
);
}
...
...
@@ -5159,14 +5163,15 @@ int delete_precheck(THD *thd, TABLE_LIST *tables)
SYNOPSIS
insert_precheck()
thd
- t
hread handler
tables
- g
lobal table list
thd
T
hread handler
tables
G
lobal table list
RETURN VALUE
0
-
OK
1
-
error (message is sent to user)
-1
-
error (message is not sent to user)
0 OK
1 error (message is sent to user)
-1 error (message is not sent to user)
*/
int
insert_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
,
bool
update
)
{
LEX
*
lex
=
thd
->
lex
;
...
...
@@ -5192,15 +5197,16 @@ int insert_precheck(THD *thd, TABLE_LIST *tables, bool update)
SYNOPSIS
create_table_precheck()
thd
- t
hread handler
tables
- g
lobal table list
create_table
- t
able which will be created
thd
T
hread handler
tables
G
lobal table list
create_table
T
able which will be created
RETURN VALUE
0
-
OK
1
- e
rror (message is sent to user)
-1
- e
rror (message is not sent to user)
0 OK
1
E
rror (message is sent to user)
-1
E
rror (message is not sent to user)
*/
int
create_table_precheck
(
THD
*
thd
,
TABLE_LIST
*
tables
,
TABLE_LIST
*
create_table
)
{
...
...
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