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
1b7f67d6
Commit
1b7f67d6
authored
Dec 19, 2003
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed memory overrun bug in DELETE ... ORDER BY
parent
c4977323
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
sql/sql_delete.cc
sql/sql_delete.cc
+6
-6
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
sql/mysql_priv.h
View file @
1b7f67d6
...
@@ -537,7 +537,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
...
@@ -537,7 +537,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
List
<
List_item
>
&
values
,
List
<
Item
>
&
update_fields
,
List
<
List_item
>
&
values
,
List
<
Item
>
&
update_fields
,
List
<
Item
>
&
update_values
,
enum_duplicates
flag
);
List
<
Item
>
&
update_values
,
enum_duplicates
flag
);
void
kill_delayed_threads
(
void
);
void
kill_delayed_threads
(
void
);
int
mysql_delete
(
THD
*
thd
,
TABLE_LIST
*
table
,
COND
*
conds
,
ORDER
*
order
,
int
mysql_delete
(
THD
*
thd
,
TABLE_LIST
*
table
,
COND
*
conds
,
SQL_LIST
*
order
,
ha_rows
rows
,
ulong
options
);
ha_rows
rows
,
ulong
options
);
int
mysql_truncate
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
bool
dont_send_ok
=
0
);
int
mysql_truncate
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
bool
dont_send_ok
=
0
);
TABLE
*
open_ltable
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
thr_lock_type
update
);
TABLE
*
open_ltable
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
thr_lock_type
update
);
...
...
sql/sql_delete.cc
View file @
1b7f67d6
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include "ha_innodb.h"
#include "ha_innodb.h"
#include "sql_select.h"
#include "sql_select.h"
int
mysql_delete
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
COND
*
conds
,
ORDER
*
order
,
int
mysql_delete
(
THD
*
thd
,
TABLE_LIST
*
table_list
,
COND
*
conds
,
SQL_LIST
*
order
,
ha_rows
limit
,
ulong
options
)
ha_rows
limit
,
ulong
options
)
{
{
int
error
;
int
error
;
...
@@ -116,7 +116,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
...
@@ -116,7 +116,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
if
(
options
&
OPTION_QUICK
)
if
(
options
&
OPTION_QUICK
)
(
void
)
table
->
file
->
extra
(
HA_EXTRA_QUICK
);
(
void
)
table
->
file
->
extra
(
HA_EXTRA_QUICK
);
if
(
order
)
if
(
order
&&
order
->
elements
)
{
{
uint
length
;
uint
length
;
SORT_FIELD
*
sortorder
;
SORT_FIELD
*
sortorder
;
...
@@ -130,10 +130,10 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
...
@@ -130,10 +130,10 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
table
->
sort
.
io_cache
=
(
IO_CACHE
*
)
my_malloc
(
sizeof
(
IO_CACHE
),
table
->
sort
.
io_cache
=
(
IO_CACHE
*
)
my_malloc
(
sizeof
(
IO_CACHE
),
MYF
(
MY_FAE
|
MY_ZEROFILL
));
MYF
(
MY_FAE
|
MY_ZEROFILL
));
if
(
thd
->
lex
.
select_lex
.
setup_ref_array
(
thd
,
0
)
||
if
(
thd
->
lex
.
select_lex
.
setup_ref_array
(
thd
,
order
->
elements
)
||
setup_order
(
thd
,
thd
->
lex
.
select_lex
.
ref_pointer_array
,
&
tables
,
setup_order
(
thd
,
thd
->
lex
.
select_lex
.
ref_pointer_array
,
&
tables
,
fields
,
all_fields
,
order
)
||
fields
,
all_fields
,
(
ORDER
*
)
order
->
first
)
||
!
(
sortorder
=
make_unireg_sortorder
(
order
,
&
length
))
||
!
(
sortorder
=
make_unireg_sortorder
(
(
ORDER
*
)
order
->
first
,
&
length
))
||
(
table
->
sort
.
found_records
=
filesort
(
thd
,
table
,
sortorder
,
length
,
(
table
->
sort
.
found_records
=
filesort
(
thd
,
table
,
sortorder
,
length
,
select
,
HA_POS_ERROR
,
select
,
HA_POS_ERROR
,
&
examined_rows
))
&
examined_rows
))
...
@@ -613,7 +613,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
...
@@ -613,7 +613,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
{
{
/* Probably InnoDB table */
/* Probably InnoDB table */
table_list
->
lock_type
=
TL_WRITE
;
table_list
->
lock_type
=
TL_WRITE
;
DBUG_RETURN
(
mysql_delete
(
thd
,
table_list
,
(
COND
*
)
0
,
(
ORDER
*
)
0
,
DBUG_RETURN
(
mysql_delete
(
thd
,
table_list
,
(
COND
*
)
0
,
(
SQL_LIST
*
)
0
,
HA_POS_ERROR
,
0
));
HA_POS_ERROR
,
0
));
}
}
if
(
lock_and_wait_for_table_name
(
thd
,
table_list
))
if
(
lock_and_wait_for_table_name
(
thd
,
table_list
))
...
...
sql/sql_parse.cc
View file @
1b7f67d6
...
@@ -2626,7 +2626,7 @@ mysql_execute_command(THD *thd)
...
@@ -2626,7 +2626,7 @@ mysql_execute_command(THD *thd)
// Set privilege for the WHERE clause
// Set privilege for the WHERE clause
tables
->
grant
.
want_privilege
=
(
SELECT_ACL
&
~
tables
->
grant
.
privilege
);
tables
->
grant
.
want_privilege
=
(
SELECT_ACL
&
~
tables
->
grant
.
privilege
);
res
=
mysql_delete
(
thd
,
tables
,
select_lex
->
where
,
res
=
mysql_delete
(
thd
,
tables
,
select_lex
->
where
,
(
ORDER
*
)
select_lex
->
order_list
.
fir
st
,
&
select_lex
->
order_li
st
,
select_lex
->
select_limit
,
select_lex
->
options
);
select_lex
->
select_limit
,
select_lex
->
options
);
if
(
thd
->
net
.
report_error
)
if
(
thd
->
net
.
report_error
)
res
=
-
1
;
res
=
-
1
;
...
...
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