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
2c6859d2
Commit
2c6859d2
authored
May 17, 2006
by
holyfoot@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-5.1-kt
into mysql.com:/home/hf/work/mysql-5.1.mrg
parents
d8d222f2
f047262b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
4 deletions
+44
-4
config/ac-macros/ha_ndbcluster.m4
config/ac-macros/ha_ndbcluster.m4
+1
-1
config/ac-macros/replication.m4
config/ac-macros/replication.m4
+1
-1
include/my_global.h
include/my_global.h
+9
-0
sql/log.cc
sql/log.cc
+10
-0
sql/mysqld.cc
sql/mysqld.cc
+1
-1
sql/set_var.cc
sql/set_var.cc
+4
-0
sql/sql_base.cc
sql/sql_base.cc
+2
-0
sql/sql_class.cc
sql/sql_class.cc
+10
-1
sql/sql_class.h
sql/sql_class.h
+2
-0
sql/sql_parse.cc
sql/sql_parse.cc
+4
-0
No files found.
config/ac-macros/ha_ndbcluster.m4
View file @
2c6859d2
...
@@ -237,7 +237,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
...
@@ -237,7 +237,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
if test X"$have_ndb_binlog" = Xyes
if test X"$have_ndb_binlog" = Xyes
then
then
AC_DEFINE([
HAVE
_NDB_BINLOG], [1],
AC_DEFINE([
WITH
_NDB_BINLOG], [1],
[Including Ndb Cluster Binlog])
[Including Ndb Cluster Binlog])
AC_MSG_RESULT([Including Ndb Cluster Binlog])
AC_MSG_RESULT([Including Ndb Cluster Binlog])
else
else
...
...
config/ac-macros/replication.m4
View file @
2c6859d2
...
@@ -15,7 +15,7 @@ AC_DEFUN([MYSQL_CHECK_REPLICATION], [
...
@@ -15,7 +15,7 @@ AC_DEFUN([MYSQL_CHECK_REPLICATION], [
case "$row_based" in
case "$row_based" in
yes )
yes )
AC_DEFINE([
HAVE
_ROW_BASED_REPLICATION], [1], [Define to have row-based replication])
AC_DEFINE([
WITH
_ROW_BASED_REPLICATION], [1], [Define to have row-based replication])
AC_MSG_RESULT([-- including row-based replication])
AC_MSG_RESULT([-- including row-based replication])
[have_row_based=yes]
[have_row_based=yes]
;;
;;
...
...
include/my_global.h
View file @
2c6859d2
...
@@ -78,6 +78,15 @@
...
@@ -78,6 +78,15 @@
#endif
#endif
#endif
/* _WIN32... */
#endif
/* _WIN32... */
#ifndef EMBEDDED_LIBRARY
#ifdef WITH_ROW_BASED_REPLICATION
#define HAVE_ROW_BASED_REPLICATION 1
#endif
#ifdef WITH_NDB_BINLOG
#define HAVE_NDB_BINLOG 1
#endif
#endif
/* !EMBEDDED_LIBRARY */
/* Some defines to avoid ifdefs in the code */
/* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD
#ifndef NETWARE_YIELD
#define NETWARE_YIELD
#define NETWARE_YIELD
...
...
sql/log.cc
View file @
2c6859d2
...
@@ -1090,12 +1090,16 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, Log_event *end_ev)
...
@@ -1090,12 +1090,16 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, Log_event *end_ev)
were, we would have to ensure that we're not ending a statement
were, we would have to ensure that we're not ending a statement
inside a stored function.
inside a stored function.
*/
*/
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
binlog_flush_pending_rows_event
(
TRUE
);
thd
->
binlog_flush_pending_rows_event
(
TRUE
);
#endif
error
=
mysql_bin_log
.
write
(
thd
,
trans_log
,
end_ev
);
error
=
mysql_bin_log
.
write
(
thd
,
trans_log
,
end_ev
);
}
}
else
else
{
{
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
binlog_delete_pending_rows_event
();
thd
->
binlog_delete_pending_rows_event
();
#endif
}
}
/*
/*
...
@@ -2620,6 +2624,7 @@ bool MYSQL_LOG::is_query_in_union(THD *thd, query_id_t query_id_param)
...
@@ -2620,6 +2624,7 @@ bool MYSQL_LOG::is_query_in_union(THD *thd, query_id_t query_id_param)
}
}
#ifdef HAVE_ROW_BASED_REPLICATION
/*
/*
These functions are placed in this file since they need access to
These functions are placed in this file since they need access to
binlog_hton, which has internal linkage.
binlog_hton, which has internal linkage.
...
@@ -2797,6 +2802,7 @@ int MYSQL_LOG::flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event)
...
@@ -2797,6 +2802,7 @@ int MYSQL_LOG::flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event)
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
#endif
/*HAVE_ROW_BASED_REPLICATION*/
/*
/*
Write an event to the binary log
Write an event to the binary log
...
@@ -2831,7 +2837,9 @@ bool MYSQL_LOG::write(Log_event *event_info)
...
@@ -2831,7 +2837,9 @@ bool MYSQL_LOG::write(Log_event *event_info)
*/
*/
bool
const
end_stmt
=
bool
const
end_stmt
=
thd
->
prelocked_mode
&&
thd
->
lex
->
requires_prelocking
();
thd
->
prelocked_mode
&&
thd
->
lex
->
requires_prelocking
();
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
binlog_flush_pending_rows_event
(
end_stmt
);
thd
->
binlog_flush_pending_rows_event
(
end_stmt
);
#endif
/*HAVE_ROW_BASED_REPLICATION*/
pthread_mutex_lock
(
&
LOCK_log
);
pthread_mutex_lock
(
&
LOCK_log
);
...
@@ -2873,8 +2881,10 @@ bool MYSQL_LOG::write(Log_event *event_info)
...
@@ -2873,8 +2881,10 @@ bool MYSQL_LOG::write(Log_event *event_info)
*/
*/
if
(
opt_using_transactions
&&
thd
)
if
(
opt_using_transactions
&&
thd
)
{
{
#ifdef HAVE_ROW_BASED_REPLICATION
if
(
thd
->
binlog_setup_trx_data
())
if
(
thd
->
binlog_setup_trx_data
())
goto
err
;
goto
err
;
#endif
/*HAVE_ROW_BASED_REPLICATION*/
binlog_trx_data
*
const
trx_data
=
binlog_trx_data
*
const
trx_data
=
(
binlog_trx_data
*
)
thd
->
ha_data
[
binlog_hton
.
slot
];
(
binlog_trx_data
*
)
thd
->
ha_data
[
binlog_hton
.
slot
];
...
...
sql/mysqld.cc
View file @
2c6859d2
...
@@ -3092,7 +3092,7 @@ with --log-bin instead.");
...
@@ -3092,7 +3092,7 @@ with --log-bin instead.");
}
}
if
(
global_system_variables
.
binlog_format
==
BINLOG_FORMAT_UNSPEC
)
if
(
global_system_variables
.
binlog_format
==
BINLOG_FORMAT_UNSPEC
)
{
{
#if
def HAVE_NDB_BINLOG
#if
defined(HAVE_NDB_BINLOG) && defined(HAVE_ROW_BASED_REPLICATION)
if
(
opt_bin_log
&&
have_ndbcluster
==
SHOW_OPTION_YES
)
if
(
opt_bin_log
&&
have_ndbcluster
==
SHOW_OPTION_YES
)
global_system_variables
.
binlog_format
=
BINLOG_FORMAT_ROW
;
global_system_variables
.
binlog_format
=
BINLOG_FORMAT_ROW
;
else
else
...
...
sql/set_var.cc
View file @
2c6859d2
...
@@ -1270,12 +1270,14 @@ bool sys_var_thd_binlog_format::is_readonly() const
...
@@ -1270,12 +1270,14 @@ bool sys_var_thd_binlog_format::is_readonly() const
And this test will also prevent switching from RBR to RBR (a no-op which
And this test will also prevent switching from RBR to RBR (a no-op which
should not happen too often).
should not happen too often).
*/
*/
#ifdef HAVE_ROW_BASED_REPLICATION
if
((
thd
->
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
)
&&
if
((
thd
->
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
)
&&
thd
->
temporary_tables
)
thd
->
temporary_tables
)
{
{
my_error
(
ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
,
MYF
(
0
));
my_error
(
ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
,
MYF
(
0
));
return
1
;
return
1
;
}
}
#endif
/*HAVE_ROW_BASED_REPLICATION*/
/*
/*
if in a stored function, it's too late to change mode
if in a stored function, it's too late to change mode
*/
*/
...
@@ -1299,7 +1301,9 @@ bool sys_var_thd_binlog_format::is_readonly() const
...
@@ -1299,7 +1301,9 @@ bool sys_var_thd_binlog_format::is_readonly() const
void
fix_binlog_format_after_update
(
THD
*
thd
,
enum_var_type
type
)
void
fix_binlog_format_after_update
(
THD
*
thd
,
enum_var_type
type
)
{
{
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
reset_current_stmt_binlog_row_based
();
thd
->
reset_current_stmt_binlog_row_based
();
#endif
/*HAVE_ROW_BASED_REPLICATION*/
}
}
static
void
fix_max_binlog_size
(
THD
*
thd
,
enum_var_type
type
)
static
void
fix_max_binlog_size
(
THD
*
thd
,
enum_var_type
type
)
...
...
sql/sql_base.cc
View file @
2c6859d2
...
@@ -1069,7 +1069,9 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
...
@@ -1069,7 +1069,9 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
handled either before writing a query log event (inside
handled either before writing a query log event (inside
binlog_query()) or when preparing a pending event.
binlog_query()) or when preparing a pending event.
*/
*/
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
binlog_flush_pending_rows_event
(
TRUE
);
thd
->
binlog_flush_pending_rows_event
(
TRUE
);
#endif
/*HAVE_ROW_BASED_REPLICATION*/
mysql_unlock_tables
(
thd
,
thd
->
lock
);
mysql_unlock_tables
(
thd
,
thd
->
lock
);
thd
->
lock
=
0
;
thd
->
lock
=
0
;
}
}
...
...
sql/sql_class.cc
View file @
2c6859d2
...
@@ -197,7 +197,10 @@ THD::THD()
...
@@ -197,7 +197,10 @@ THD::THD()
:
Statement
(
CONVENTIONAL_EXECUTION
,
0
,
ALLOC_ROOT_MIN_BLOCK_SIZE
,
0
),
:
Statement
(
CONVENTIONAL_EXECUTION
,
0
,
ALLOC_ROOT_MIN_BLOCK_SIZE
,
0
),
Open_tables_state
(
refresh_version
),
rli_fake
(
0
),
Open_tables_state
(
refresh_version
),
rli_fake
(
0
),
lock_id
(
&
main_lock_id
),
lock_id
(
&
main_lock_id
),
user_time
(
0
),
in_sub_stmt
(
0
),
binlog_table_maps
(
0
),
user_time
(
0
),
in_sub_stmt
(
0
),
#ifdef HAVE_ROW_BASED_REPLICATION
binlog_table_maps
(
0
),
#endif
/*HAVE_ROW_BASED_REPLICATION*/
global_read_lock
(
0
),
is_fatal_error
(
0
),
global_read_lock
(
0
),
is_fatal_error
(
0
),
rand_used
(
0
),
time_zone_used
(
0
),
rand_used
(
0
),
time_zone_used
(
0
),
last_insert_id_used
(
0
),
insert_id_used
(
0
),
clear_next_insert_id
(
0
),
last_insert_id_used
(
0
),
insert_id_used
(
0
),
clear_next_insert_id
(
0
),
...
@@ -333,7 +336,9 @@ void THD::init(void)
...
@@ -333,7 +336,9 @@ void THD::init(void)
bzero
((
char
*
)
warn_count
,
sizeof
(
warn_count
));
bzero
((
char
*
)
warn_count
,
sizeof
(
warn_count
));
total_warn_count
=
0
;
total_warn_count
=
0
;
update_charset
();
update_charset
();
#ifdef HAVE_ROW_BASED_REPLICATION
reset_current_stmt_binlog_row_based
();
reset_current_stmt_binlog_row_based
();
#endif
/*HAVE_ROW_BASED_REPLICATION*/
bzero
((
char
*
)
&
status_var
,
sizeof
(
status_var
));
bzero
((
char
*
)
&
status_var
,
sizeof
(
status_var
));
}
}
...
@@ -2713,8 +2718,10 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
...
@@ -2713,8 +2718,10 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
the flushing will be done inside the top-most
the flushing will be done inside the top-most
close_thread_tables().
close_thread_tables().
*/
*/
#ifdef HAVE_ROW_BASED_REPLICATION
if
(
this
->
lock
)
if
(
this
->
lock
)
DBUG_RETURN
(
binlog_flush_pending_rows_event
(
TRUE
));
DBUG_RETURN
(
binlog_flush_pending_rows_event
(
TRUE
));
#endif
/*HAVE_ROW_BASED_REPLICATION*/
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
/* Otherwise, we fall through */
/* Otherwise, we fall through */
...
@@ -2733,7 +2740,9 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
...
@@ -2733,7 +2740,9 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
table maps were written.
table maps were written.
*/
*/
int
error
=
mysql_bin_log
.
write
(
&
qinfo
);
int
error
=
mysql_bin_log
.
write
(
&
qinfo
);
#ifdef HAVE_ROW_BASED_REPLICATION
binlog_table_maps
=
0
;
binlog_table_maps
=
0
;
#endif
/*HAVE_ROW_BASED_REPLICATION*/
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
break
;
break
;
...
...
sql/sql_class.h
View file @
2c6859d2
...
@@ -1380,6 +1380,7 @@ class THD :public Statement,
...
@@ -1380,6 +1380,7 @@ class THD :public Statement,
void
restore_sub_statement_state
(
Sub_statement_state
*
backup
);
void
restore_sub_statement_state
(
Sub_statement_state
*
backup
);
void
set_n_backup_active_arena
(
Query_arena
*
set
,
Query_arena
*
backup
);
void
set_n_backup_active_arena
(
Query_arena
*
set
,
Query_arena
*
backup
);
void
restore_active_arena
(
Query_arena
*
set
,
Query_arena
*
backup
);
void
restore_active_arena
(
Query_arena
*
set
,
Query_arena
*
backup
);
#ifdef HAVE_ROW_BASED_REPLICATION
inline
void
set_current_stmt_binlog_row_based_if_mixed
()
inline
void
set_current_stmt_binlog_row_based_if_mixed
()
{
{
if
(
variables
.
binlog_format
==
BINLOG_FORMAT_MIXED
)
if
(
variables
.
binlog_format
==
BINLOG_FORMAT_MIXED
)
...
@@ -1393,6 +1394,7 @@ class THD :public Statement,
...
@@ -1393,6 +1394,7 @@ class THD :public Statement,
{
{
current_stmt_binlog_row_based
=
test
(
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
);
current_stmt_binlog_row_based
=
test
(
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
);
}
}
#endif
/*HAVE_ROW_BASED_REPLICATION*/
}
;
}
;
...
...
sql/sql_parse.cc
View file @
2c6859d2
...
@@ -2468,8 +2468,10 @@ mysql_execute_command(THD *thd)
...
@@ -2468,8 +2468,10 @@ mysql_execute_command(THD *thd)
statistic_increment
(
thd
->
status_var
.
com_stat
[
lex
->
sql_command
],
statistic_increment
(
thd
->
status_var
.
com_stat
[
lex
->
sql_command
],
&
LOCK_status
);
&
LOCK_status
);
#ifdef HAVE_ROW_BASED_REPLICATION
if
(
lex
->
binlog_row_based_if_mixed
)
if
(
lex
->
binlog_row_based_if_mixed
)
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
#endif
/*HAVE_ROW_BASED_REPLICATION*/
switch
(
lex
->
sql_command
)
{
switch
(
lex
->
sql_command
)
{
case
SQLCOM_SELECT
:
case
SQLCOM_SELECT
:
...
@@ -5133,7 +5135,9 @@ mysql_execute_command(THD *thd)
...
@@ -5133,7 +5135,9 @@ mysql_execute_command(THD *thd)
*/
*/
if
(
thd
->
one_shot_set
&&
lex
->
sql_command
!=
SQLCOM_SET_OPTION
)
if
(
thd
->
one_shot_set
&&
lex
->
sql_command
!=
SQLCOM_SET_OPTION
)
reset_one_shot_variables
(
thd
);
reset_one_shot_variables
(
thd
);
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
reset_current_stmt_binlog_row_based
();
thd
->
reset_current_stmt_binlog_row_based
();
#endif
/*HAVE_ROW_BASED_REPLICATION*/
/*
/*
The return value for ROW_COUNT() is "implementation dependent" if the
The return value for ROW_COUNT() is "implementation dependent" if the
...
...
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