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
373abaf4
Commit
373abaf4
authored
Jan 09, 2006
by
mats@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/users/mkindahl/bk/b15923-mysql-5.1-new
parents
1c599c8e
fb0145c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
26 deletions
+47
-26
mysql-test/r/binlog_row_mix_innodb_myisam.result
mysql-test/r/binlog_row_mix_innodb_myisam.result
+17
-16
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+1
-1
sql/sql_delete.cc
sql/sql_delete.cc
+29
-9
No files found.
mysql-test/r/binlog_row_mix_innodb_myisam.result
View file @
373abaf4
...
@@ -262,21 +262,22 @@ master-bin.000001 209 Write_rows 1 #
...
@@ -262,21 +262,22 @@ master-bin.000001 209 Write_rows 1 #
master-bin.000001 243 Table_map 1 # test.t1
master-bin.000001 243 Table_map 1 # test.t1
master-bin.000001 282 Write_rows 1 #
master-bin.000001 282 Write_rows 1 #
master-bin.000001 316 Xid 1 # COMMIT /* xid= */
master-bin.000001 316 Xid 1 # COMMIT /* xid= */
master-bin.000001 343 Table_map 1 # test.t1
master-bin.000001 343 Query 1 # use `test`; delete from t1
master-bin.000001 382 Delete_rows 1 #
master-bin.000001 420 Xid 1 # COMMIT /* xid= */
master-bin.000001 421 Xid 1 # COMMIT /* xid= */
master-bin.000001 447 Query 1 # use `test`; delete from t2
master-bin.000001 448 Query 1 # use `test`; alter table t2 type=MyISAM
master-bin.000001 524 Xid 1 # COMMIT /* xid= */
master-bin.000001 537 Table_map 1 # test.t1
master-bin.000001 551 Query 1 # use `test`; alter table t2 type=MyISAM
master-bin.000001 576 Write_rows 1 #
master-bin.000001 640 Table_map 1 # test.t1
master-bin.000001 610 Xid 1 # COMMIT /* xid= */
master-bin.000001 679 Write_rows 1 #
master-bin.000001 637 Table_map 1 # test.t2
master-bin.000001 713 Xid 1 # COMMIT /* xid= */
master-bin.000001 676 Write_rows 1 #
master-bin.000001 740 Table_map 1 # test.t2
master-bin.000001 710 Query 1 # use `test`; drop table t1,t2
master-bin.000001 779 Write_rows 1 #
master-bin.000001 789 Query 1 # use `test`; create table t0 (n int)
master-bin.000001 813 Query 1 # use `test`; drop table t1,t2
master-bin.000001 875 Table_map 1 # test.t0
master-bin.000001 892 Query 1 # use `test`; create table t0 (n int)
master-bin.000001 914 Write_rows 1 #
master-bin.000001 978 Table_map 1 # test.t0
master-bin.000001 948 Table_map 1 # test.t0
master-bin.000001 1017 Write_rows 1 #
master-bin.000001 987 Write_rows 1 #
master-bin.000001 1051 Table_map 1 # test.t0
master-bin.000001 1021 Query 1 # use `test`; create table t2 (n int) engine=innodb
master-bin.000001 1090 Write_rows 1 #
master-bin.000001 1124 Query 1 # use `test`; create table t2 (n int) engine=innodb
do release_lock("lock1");
do release_lock("lock1");
drop table t0,t2;
drop table t0,t2;
mysql-test/t/disabled.def
View file @
373abaf4
...
@@ -21,6 +21,6 @@ innodb_concurrent : Results are not deterministic, Elliot will fix (BUG#3300)
...
@@ -21,6 +21,6 @@ innodb_concurrent : Results are not deterministic, Elliot will fix (BUG#3300)
subselect : Bug#15706
subselect : Bug#15706
type_time : Bug#15805
type_time : Bug#15805
#rpl000002 : Bug#15920 Temporary tables are not binlogged in SBR
#rpl000002 : Bug#15920 Temporary tables are not binlogged in SBR
ps_7ndb : Bug#15923 Core dump in RBR mode when executing test suite
#
ps_7ndb : Bug#15923 Core dump in RBR mode when executing test suite
rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
mysqlslap : Bug#16167
mysqlslap : Bug#16167
sql/sql_delete.cc
View file @
373abaf4
...
@@ -40,7 +40,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
...
@@ -40,7 +40,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
ha_rows
deleted
;
ha_rows
deleted
;
uint
usable_index
=
MAX_KEY
;
uint
usable_index
=
MAX_KEY
;
SELECT_LEX
*
select_lex
=
&
thd
->
lex
->
select_lex
;
SELECT_LEX
*
select_lex
=
&
thd
->
lex
->
select_lex
;
bool
ha_delete_
row_bypassed
=
0
;
bool
ha_delete_
all_rows
=
0
;
DBUG_ENTER
(
"mysql_delete"
);
DBUG_ENTER
(
"mysql_delete"
);
if
(
open_and_lock_tables
(
thd
,
table_list
))
if
(
open_and_lock_tables
(
thd
,
table_list
))
...
@@ -79,17 +79,20 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
...
@@ -79,17 +79,20 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
!
(
table
->
triggers
&&
table
->
triggers
->
has_delete_triggers
()))
!
(
table
->
triggers
&&
table
->
triggers
->
has_delete_triggers
()))
{
{
ha_rows
const
maybe_deleted
=
table
->
file
->
records
;
ha_rows
const
maybe_deleted
=
table
->
file
->
records
;
/*
If all rows shall be deleted, we always log this statement-based
(see [binlog], below), so we set this flag and test it below.
*/
ha_delete_all_rows
=
1
;
if
(
!
(
error
=
table
->
file
->
delete_all_rows
()))
if
(
!
(
error
=
table
->
file
->
delete_all_rows
()))
{
{
error
=
-
1
;
// ok
error
=
-
1
;
// ok
deleted
=
maybe_deleted
;
deleted
=
maybe_deleted
;
ha_delete_row_bypassed
=
1
;
goto
cleanup
;
goto
cleanup
;
}
}
if
(
error
!=
HA_ERR_WRONG_COMMAND
)
if
(
error
!=
HA_ERR_WRONG_COMMAND
)
{
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
table
->
file
->
print_error
(
error
,
MYF
(
0
));
ha_delete_row_bypassed
=
1
;
error
=
0
;
error
=
0
;
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -200,6 +203,16 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
...
@@ -200,6 +203,16 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
init_ftfuncs
(
thd
,
select_lex
,
1
);
init_ftfuncs
(
thd
,
select_lex
,
1
);
thd
->
proc_info
=
"updating"
;
thd
->
proc_info
=
"updating"
;
will_batch
=
!
table
->
file
->
start_bulk_delete
();
will_batch
=
!
table
->
file
->
start_bulk_delete
();
/*
Save the thread options before clearing the OPTION_BIN_LOG,
effectively disabling the binary log (unless it was already
disabled, of course).
*/
ulonglong
const
saved_options
=
thd
->
options
;
if
(
ha_delete_all_rows
)
thd
->
options
&=
~
static_cast
<
ulonglong
>
(
OPTION_BIN_LOG
);
while
(
!
(
error
=
info
.
read_record
(
&
info
))
&&
!
thd
->
killed
&&
while
(
!
(
error
=
info
.
read_record
(
&
info
))
&&
!
thd
->
killed
&&
!
thd
->
net
.
report_error
)
!
thd
->
net
.
report_error
)
{
{
...
@@ -290,6 +303,13 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
...
@@ -290,6 +303,13 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
delete
select
;
delete
select
;
transactional_table
=
table
->
file
->
has_transactions
();
transactional_table
=
table
->
file
->
has_transactions
();
/*
Restore the saved value of the OPTION_BIN_LOG bit in the thread
options before executing binlog_query() below.
*/
thd
->
options
|=
(
saved_options
&
OPTION_BIN_LOG
);
/* See similar binlogging code in sql_update.cc, for comments */
/* See similar binlogging code in sql_update.cc, for comments */
if
((
error
<
0
)
||
(
deleted
&&
!
transactional_table
))
if
((
error
<
0
)
||
(
deleted
&&
!
transactional_table
))
{
{
...
@@ -299,14 +319,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
...
@@ -299,14 +319,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
thd
->
clear_error
();
thd
->
clear_error
();
/*
/*
If 'handler::delete_all_rows()' was called, we replicat
e
[binlog]: If 'handler::delete_all_rows()' was called, w
e
statement-based; otherwise, 'ha_delete_row()' was used to
replicate statement-based; otherwise, 'ha_delete_row()' was
delete specific rows which we might log row-based.
used to
delete specific rows which we might log row-based.
*/
*/
THD
::
enum_binlog_query_type
const
THD
::
enum_binlog_query_type
const
query_type
(
ha_delete_row_bypassed
?
query_type
(
ha_delete_all_rows
?
THD
::
STMT_QUERY_TYPE
:
THD
::
STMT_QUERY_TYPE
:
THD
::
ROW_QUERY_TYPE
);
THD
::
ROW_QUERY_TYPE
);
int
log_result
=
thd
->
binlog_query
(
query_type
,
int
log_result
=
thd
->
binlog_query
(
query_type
,
thd
->
query
,
thd
->
query_length
,
thd
->
query
,
thd
->
query_length
,
transactional_table
,
FALSE
);
transactional_table
,
FALSE
);
...
...
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