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
7ae4c06d
Commit
7ae4c06d
authored
Feb 10, 2010
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge from mysql-next-mr bug branch.
Conflicts ========= Text conflict in sql/sql_base.cc
parents
4eda0bf0
87a589f8
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
167 additions
and
77 deletions
+167
-77
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
...l-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+37
-7
sql/event_db_repository.cc
sql/event_db_repository.cc
+5
-3
sql/events.cc
sql/events.cc
+18
-10
sql/sp.cc
sql/sp.cc
+15
-9
sql/sql_acl.cc
sql/sql_acl.cc
+70
-34
sql/sql_base.cc
sql/sql_base.cc
+0
-3
sql/sql_class.h
sql/sql_class.h
+0
-1
sql/sql_udf.cc
sql/sql_udf.cc
+22
-10
No files found.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
View file @
7ae4c06d
...
...
@@ -744,8 +744,9 @@ ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=3
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2))
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 3 */;
count(*)
...
...
@@ -761,8 +762,9 @@ count(*)
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3)
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 5 */;
count(*)
...
...
@@ -784,6 +786,10 @@ insert into t2 values (bug27417(1));
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 1 */;
count(*)
1
...
...
@@ -795,6 +801,10 @@ insert into t2 select bug27417(1) union select bug27417(2);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 2 */;
count(*)
2
...
...
@@ -806,8 +816,11 @@ ERROR 23000: Duplicate entry '4' for key 'b'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 2 */;
count(*)
...
...
@@ -821,6 +834,10 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 4 */;
count(*)
4
...
...
@@ -834,7 +851,7 @@ UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
1
2
drop table t4;
delete from t1;
delete from t2;
...
...
@@ -848,6 +865,11 @@ delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 1 */;
count(*)
1
...
...
@@ -864,6 +886,10 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
select count(*) from t1 /* must be 1 */;
count(*)
1
...
...
@@ -881,6 +907,10 @@ count(*)
2
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;
drop function bug27417;
sql/event_db_repository.cc
View file @
7ae4c06d
...
...
@@ -1053,8 +1053,8 @@ update_timing_fields_for_event(THD *thd,
Turn off row binlogging of event timing updates. These are not used
for RBR of events replicated to the slave.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
DBUG_ASSERT
(
thd
->
security_ctx
->
master_access
&
SUPER_ACL
);
...
...
@@ -1097,7 +1097,9 @@ end:
if
(
table
)
close_thread_tables
(
thd
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
test
(
ret
));
}
...
...
sql/events.cc
View file @
7ae4c06d
...
...
@@ -335,8 +335,8 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
Turn off row binlogging of this statement and use statement-based
so that all supporting tables are updated for CREATE EVENT command.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
mysql_mutex_lock
(
&
LOCK_event_metadata
);
...
...
@@ -377,7 +377,9 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
sql_print_error
(
"Event Error: An error occurred while creating query string, "
"before writing it into binary log."
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
TRUE
);
}
/* If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER
...
...
@@ -387,7 +389,9 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
}
mysql_mutex_unlock
(
&
LOCK_event_metadata
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
ret
);
}
...
...
@@ -471,8 +475,8 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
Turn off row binlogging of this statement and use statement-based
so that all supporting tables are updated for UPDATE EVENT command.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
mysql_mutex_lock
(
&
LOCK_event_metadata
);
...
...
@@ -509,7 +513,9 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
}
mysql_mutex_unlock
(
&
LOCK_event_metadata
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
ret
);
}
...
...
@@ -570,8 +576,8 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
Turn off row binlogging of this statement and use statement-based so
that all supporting tables are updated for DROP EVENT command.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
mysql_mutex_lock
(
&
LOCK_event_metadata
);
/* On error conditions my_error() is called so no need to handle here */
...
...
@@ -585,7 +591,9 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
}
mysql_mutex_unlock
(
&
LOCK_event_metadata
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
ret
);
}
...
...
sql/sp.cc
View file @
7ae4c06d
...
...
@@ -927,8 +927,8 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
row-based replication. The flag will be reset at the end of the
statement.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
saved_count_cuted_fields
=
thd
->
count_cuted_fields
;
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
...
...
@@ -1136,7 +1136,9 @@ done:
close_thread_tables
(
thd
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
ret
);
}
...
...
@@ -1174,8 +1176,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name)
row-based replication. The flag will be reset at the end of the
statement.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
if
(
!
(
table
=
open_proc_table_for_update
(
thd
)))
DBUG_RETURN
(
SP_OPEN_TABLE_FAILED
);
...
...
@@ -1194,7 +1196,9 @@ sp_drop_routine(THD *thd, int type, sp_name *name)
close_thread_tables
(
thd
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
ret
);
}
...
...
@@ -1233,8 +1237,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
row-based replication. The flag will be reset at the end of the
statement.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
if
(
!
(
table
=
open_proc_table_for_update
(
thd
)))
DBUG_RETURN
(
SP_OPEN_TABLE_FAILED
);
...
...
@@ -1269,7 +1273,9 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
close_thread_tables
(
thd
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
ret
);
}
...
...
sql/sql_acl.cc
View file @
7ae4c06d
This diff is collapsed.
Click to expand it.
sql/sql_base.cc
View file @
7ae4c06d
...
...
@@ -5180,10 +5180,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
*/
if
(
thd
->
variables
.
binlog_format
!=
BINLOG_FORMAT_ROW
&&
tables
&&
has_write_table_with_auto_increment
(
thd
->
lex
->
first_not_own_table
()))
{
thd
->
lex
->
set_stmt_unsafe
(
LEX
::
BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS
);
thd
->
set_current_stmt_binlog_format_row_if_mixed
();
}
}
DEBUG_SYNC
(
thd
,
"before_lock_tables_takes_lock"
);
...
...
sql/sql_class.h
View file @
7ae4c06d
...
...
@@ -1723,7 +1723,6 @@ public:
bool
slave_thread
,
one_shot_set
;
/* tells if current statement should binlog row-based(1) or stmt-based(0) */
bool
current_stmt_binlog_row_based
;
bool
locked
,
some_tables_deleted
;
bool
last_cuted_field
;
bool
no_errors
,
password
;
...
...
sql/sql_udf.cc
View file @
7ae4c06d
...
...
@@ -461,8 +461,8 @@ int mysql_create_function(THD *thd,udf_func *udf)
Turn off row binlogging of this statement and use statement-based
so that all supporting tables are updated for CREATE FUNCTION command.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
mysql_rwlock_wrlock
(
&
THR_LOCK_udf
);
if
((
my_hash_search
(
&
udf_hash
,(
uchar
*
)
udf
->
name
.
str
,
udf
->
name
.
length
)))
...
...
@@ -533,11 +533,15 @@ int mysql_create_function(THD *thd,udf_func *udf)
if
(
write_bin_log
(
thd
,
TRUE
,
thd
->
query
(),
thd
->
query_length
()))
{
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
1
);
}
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
0
);
err:
...
...
@@ -545,7 +549,9 @@ int mysql_create_function(THD *thd,udf_func *udf)
dlclose
(
dl
);
mysql_rwlock_unlock
(
&
THR_LOCK_udf
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
1
);
}
...
...
@@ -573,8 +579,8 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
Turn off row binlogging of this statement and use statement-based
so that all supporting tables are updated for DROP FUNCTION command.
*/
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
();
thd
->
clear_current_stmt_binlog_format_row
();
if
((
save_binlog_row_based
=
thd
->
is_current_stmt_binlog_format_row
()))
thd
->
clear_current_stmt_binlog_format_row
();
mysql_rwlock_wrlock
(
&
THR_LOCK_udf
);
if
(
!
(
udf
=
(
udf_func
*
)
my_hash_search
(
&
udf_hash
,(
uchar
*
)
udf_name
->
str
,
...
...
@@ -617,16 +623,22 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
if
(
write_bin_log
(
thd
,
TRUE
,
thd
->
query
(),
thd
->
query_length
()))
{
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
1
);
}
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
0
);
err:
mysql_rwlock_unlock
(
&
THR_LOCK_udf
);
/* Restore the state of binlog format */
thd
->
current_stmt_binlog_row_based
=
save_binlog_row_based
;
DBUG_ASSERT
(
!
thd
->
is_current_stmt_binlog_format_row
());
if
(
save_binlog_row_based
)
thd
->
set_current_stmt_binlog_format_row
();
DBUG_RETURN
(
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