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
7cbba084
Commit
7cbba084
authored
May 17, 2006
by
lars@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new
into mysql.com:/users/lthalmann/bk/mysql-5.1-new-rpl
parents
9f9a76eb
66766ad5
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
77 additions
and
27 deletions
+77
-27
mysql-test/r/create.result
mysql-test/r/create.result
+0
-6
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+6
-0
mysql-test/t/create.test
mysql-test/t/create.test
+0
-8
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+8
-0
mysql-test/t/rpl_rbr_to_sbr.test
mysql-test/t/rpl_rbr_to_sbr.test
+1
-0
mysql-test/t/rpl_row_basic_8partition.test
mysql-test/t/rpl_row_basic_8partition.test
+1
-0
sql/log.cc
sql/log.cc
+10
-1
sql/set_var.cc
sql/set_var.cc
+10
-1
sql/set_var.h
sql/set_var.h
+7
-2
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_class.cc
sql/sql_class.cc
+6
-0
sql/sql_class.h
sql/sql_class.h
+16
-6
sql/sql_insert.cc
sql/sql_insert.cc
+8
-2
sql/sql_table.cc
sql/sql_table.cc
+2
-1
No files found.
mysql-test/r/create.result
View file @
7cbba084
...
...
@@ -772,9 +772,3 @@ t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295
drop table t1;
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;
mysql-test/r/innodb_mysql.result
View file @
7cbba084
drop table if exists t1,t2;
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;
create table t1 (
c_id int(11) not null default '0',
org_id int(11) default null,
...
...
mysql-test/t/create.test
View file @
7cbba084
...
...
@@ -667,12 +667,4 @@ alter table t1 max_rows=100000000000;
show
create
table
t1
;
drop
table
t1
;
#
# Bug#17530: Incorrect key truncation on table creation caused server crash.
#
create
table
t1
(
f1
varchar
(
800
)
binary
not
null
,
key
(
f1
))
engine
=
innodb
character
set
utf8
collate
utf8_general_ci
;
insert
into
t1
values
(
'aaa'
);
drop
table
t1
;
# End of 5.0 tests
mysql-test/t/innodb_mysql.test
View file @
7cbba084
...
...
@@ -4,6 +4,14 @@
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
#
# Bug#17530: Incorrect key truncation on table creation caused server crash.
#
create
table
t1
(
f1
varchar
(
800
)
binary
not
null
,
key
(
f1
))
engine
=
innodb
character
set
utf8
collate
utf8_general_ci
;
insert
into
t1
values
(
'aaa'
);
drop
table
t1
;
# BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
# (repeatable only w/innodb).
create
table
t1
(
...
...
mysql-test/t/rpl_rbr_to_sbr.test
View file @
7cbba084
--
source
include
/
have_row_based
.
inc
--
source
include
/
have_binlog_format_statement
.
inc
--
source
include
/
master
-
slave
.
inc
...
...
mysql-test/t/rpl_row_basic_8partition.test
View file @
7cbba084
...
...
@@ -7,6 +7,7 @@
# partition tables with same engine (MyISAM) in both ends. #
############################################################
--
source
include
/
have_row_based
.
inc
--
source
include
/
have_partition
.
inc
--
source
include
/
master
-
slave
.
inc
connection
master
;
...
...
sql/log.cc
View file @
7cbba084
...
...
@@ -63,11 +63,17 @@ static int binlog_prepare(THD *thd, bool all);
struct
binlog_trx_data
{
bool
empty
()
const
{
#ifdef HAVE_ROW_BASED_REPLICATION
return
pending
==
NULL
&&
my_b_tell
(
&
trans_log
)
==
0
;
#else
return
my_b_tell
(
&
trans_log
)
==
0
;
#endif
}
binlog_trx_data
()
{}
IO_CACHE
trans_log
;
// The transaction cache
#ifdef HAVE_ROW_BASED_REPLICATION
Rows_log_event
*
pending
;
// The pending binrows event
#endif
};
static
const
char
binlog_hton_name
[]
=
"binlog"
;
...
...
@@ -1095,6 +1101,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, Log_event *end_ev)
#endif
error
=
mysql_bin_log
.
write
(
thd
,
trans_log
,
end_ev
);
}
#ifdef HAVE_ROW_BASED_REPLICATION
else
{
#ifdef HAVE_ROW_BASED_REPLICATION
...
...
@@ -1114,6 +1121,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, Log_event *end_ev)
transaction cache.
*/
mysql_bin_log
.
update_table_map_version
();
#endif
statistic_increment
(
binlog_cache_use
,
&
LOCK_status
);
if
(
trans_log
->
disk_writes
!=
0
)
...
...
@@ -2660,6 +2668,7 @@ int THD::binlog_setup_trx_data()
engine has registered for the transaction.
*/
#ifdef HAVE_ROW_BASED_REPLICATION
int
THD
::
binlog_write_table_map
(
TABLE
*
table
,
bool
is_trans
)
{
int
error
;
...
...
@@ -2835,6 +2844,7 @@ bool MYSQL_LOG::write(Log_event *event_info)
we are inside a stored function, we do not end the statement since
this will close all tables on the slave.
*/
#ifdef HAVE_ROW_BASED_REPLICATION
bool
const
end_stmt
=
thd
->
prelocked_mode
&&
thd
->
lex
->
requires_prelocking
();
#ifdef HAVE_ROW_BASED_REPLICATION
...
...
@@ -2890,7 +2900,6 @@ bool MYSQL_LOG::write(Log_event *event_info)
(
binlog_trx_data
*
)
thd
->
ha_data
[
binlog_hton
.
slot
];
IO_CACHE
*
trans_log
=
&
trx_data
->
trans_log
;
bool
trans_log_in_use
=
my_b_tell
(
trans_log
)
!=
0
;
if
(
event_info
->
get_cache_stmt
()
&&
!
trans_log_in_use
)
trans_register_ha
(
thd
,
(
thd
->
options
&
...
...
sql/set_var.cc
View file @
7cbba084
...
...
@@ -1269,8 +1269,14 @@ bool sys_var_thd_binlog_format::is_readonly() const
if global or not here.
And this test will also prevent switching from RBR to RBR (a no-op which
should not happen too often).
If we don't have row-based replication compiled in, the variable
is always read-only.
*/
#ifdef HAVE_ROW_BASED_REPLICATION
#ifndef HAVE_ROW_BASED_REPLICATION
my_error
(
ER_RBR_NOT_AVAILABLE
,
MYF
(
0
));
return
1
;
#else
if
((
thd
->
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
)
&&
thd
->
temporary_tables
)
{
...
...
@@ -1297,14 +1303,17 @@ bool sys_var_thd_binlog_format::is_readonly() const
}
#endif
return
sys_var_thd_enum
::
is_readonly
();
#endif
}
#ifdef HAVE_ROW_BASED_REPLICATION
void
fix_binlog_format_after_update
(
THD
*
thd
,
enum_var_type
type
)
{
#ifdef HAVE_ROW_BASED_REPLICATION
thd
->
reset_current_stmt_binlog_row_based
();
#endif
/*HAVE_ROW_BASED_REPLICATION*/
}
#endif
static
void
fix_max_binlog_size
(
THD
*
thd
,
enum_var_type
type
)
{
...
...
sql/set_var.h
View file @
7cbba084
...
...
@@ -851,15 +851,20 @@ class sys_var_event_executor :public sys_var_bool_ptr
bool
update
(
THD
*
thd
,
set_var
*
var
);
};
#ifdef HAVE_ROW_BASED_REPLICATION
extern
void
fix_binlog_format_after_update
(
THD
*
thd
,
enum_var_type
type
);
#endif
class
sys_var_thd_binlog_format
:
public
sys_var_thd_enum
{
public:
sys_var_thd_binlog_format
(
const
char
*
name_arg
,
ulong
SV
::*
offset_arg
)
:
sys_var_thd_enum
(
name_arg
,
offset_arg
,
&
binlog_format_typelib
,
fix_binlog_format_after_update
)
&
binlog_format_typelib
#ifdef HAVE_ROW_BASED_REPLICATION
,
fix_binlog_format_after_update
#endif
)
{};
bool
is_readonly
()
const
;
};
...
...
sql/share/errmsg.txt
View file @
7cbba084
...
...
@@ -5842,3 +5842,5 @@ ER_WRONG_PARTITION_NAME
swe "Felaktigt partitionsnamn"
ER_CANT_CHANGE_TX_ISOLATION 25001
eng "Transaction isolation level can't be changed while a transaction is in progress"
ER_RBR_NOT_AVAILABLE
eng "The server was not built with row-based replication"
sql/sql_class.cc
View file @
7cbba084
...
...
@@ -2115,7 +2115,9 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
if
((
!
lex
->
requires_prelocking
()
||
is_update_query
(
lex
->
sql_command
))
&&
!
current_stmt_binlog_row_based
)
{
options
&=
~
OPTION_BIN_LOG
;
}
/* Disable result sets */
client_capabilities
&=
~
CLIENT_MULTI_RESULTS
;
in_sub_stmt
|=
new_state
;
...
...
@@ -2704,6 +2706,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
to how you treat this.
*/
case
THD
:
:
ROW_QUERY_TYPE
:
#ifdef HAVE_ROW_BASED_REPLICATION
if
(
current_stmt_binlog_row_based
)
{
/*
...
...
@@ -2724,6 +2727,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
#endif
/*HAVE_ROW_BASED_REPLICATION*/
DBUG_RETURN
(
0
);
}
#endif
/* Otherwise, we fall through */
case
THD
:
:
STMT_QUERY_TYPE
:
/*
...
...
@@ -2732,7 +2736,9 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
*/
{
Query_log_event
qinfo
(
this
,
query
,
query_len
,
is_trans
,
suppress_use
);
#ifdef HAVE_ROW_BASED_REPLICATION
qinfo
.
flags
|=
LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F
;
#endif
/*
Binlog table maps will be irrelevant after a Query_log_event
(they are just removed on the slave side) so after the query
...
...
sql/sql_class.h
View file @
7cbba084
...
...
@@ -890,8 +890,10 @@ class THD :public Statement,
/* container for handler's private per-connection data */
void
*
ha_data
[
MAX_HA
];
#ifdef HAVE_ROW_BASED_REPLICATION
#ifndef MYSQL_CLIENT
int
binlog_setup_trx_data
();
#ifdef HAVE_ROW_BASED_REPLICATION
/*
Public interface to write RBR events to the binlog
...
...
@@ -921,7 +923,6 @@ class THD :public Statement,
RowsEventT
*
hint
);
Rows_log_event
*
binlog_get_pending_rows_event
()
const
;
void
binlog_set_pending_rows_event
(
Rows_log_event
*
ev
);
int
binlog_setup_trx_data
();
my_size_t
max_row_length_blob
(
TABLE
*
table
,
const
byte
*
data
)
const
;
my_size_t
max_row_length
(
TABLE
*
table
,
const
byte
*
data
)
const
...
...
@@ -945,8 +946,9 @@ class THD :public Statement,
public:
#endif
#endif
/* HAVE_ROW_BASED_REPLICATION */
#endif
/* MYSQL_CLIENT */
#ifndef MYSQL_CLIENT
enum
enum_binlog_query_type
{
/*
...
...
@@ -1384,15 +1386,21 @@ class THD :public Statement,
inline
void
set_current_stmt_binlog_row_based_if_mixed
()
{
if
(
variables
.
binlog_format
==
BINLOG_FORMAT_MIXED
)
current_stmt_binlog_row_based
=
1
;
current_stmt_binlog_row_based
=
TRUE
;
}
inline
void
set_current_stmt_binlog_row_based
()
{
current_stmt_binlog_row_based
=
1
;
current_stmt_binlog_row_based
=
TRUE
;
}
#endif
inline
void
reset_current_stmt_binlog_row_based
()
{
current_stmt_binlog_row_based
=
test
(
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
);
#ifdef HAVE_ROW_BASED_REPLICATION
current_stmt_binlog_row_based
=
test
(
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
);
#else
current_stmt_binlog_row_based
=
FALSE
;
#endif
}
#endif
/*HAVE_ROW_BASED_REPLICATION*/
}
;
...
...
@@ -1586,7 +1594,9 @@ class select_create: public select_insert {
{}
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
#ifdef HAVE_ROW_BASED_REPLICATION
void
binlog_show_create_table
(
TABLE
**
tables
,
uint
count
);
#endif
void
store_values
(
List
<
Item
>
&
values
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
...
...
sql/sql_insert.cc
View file @
7cbba084
...
...
@@ -2523,6 +2523,8 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
{
DBUG_ENTER
(
"select_create::prepare"
);
TABLEOP_HOOKS
*
hook_ptr
=
NULL
;
#ifdef HAVE_ROW_BASED_REPLICATION
class
MY_HOOKS
:
public
TABLEOP_HOOKS
{
public:
MY_HOOKS
(
select_create
*
x
)
:
ptr
(
x
)
{
}
...
...
@@ -2537,11 +2539,14 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
};
MY_HOOKS
hooks
(
this
);
hook_ptr
=
&
hooks
;
#endif
unit
=
u
;
table
=
create_table_from_items
(
thd
,
create_info
,
create_table
,
extra_fields
,
keys
,
&
values
,
&
lock
,
&
hooks
);
hook_ptr
);
if
(
!
table
)
DBUG_RETURN
(
-
1
);
// abort() deletes table
...
...
@@ -2579,6 +2584,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
}
#ifdef HAVE_ROW_BASED_REPLICATION
void
select_create
::
binlog_show_create_table
(
TABLE
**
tables
,
uint
count
)
{
...
...
@@ -2622,7 +2628,7 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
/* is_trans */
TRUE
,
/* suppress_use */
FALSE
);
}
#endif // HAVE_ROW_BASED_REPLICATION
void
select_create
::
store_values
(
List
<
Item
>
&
values
)
{
...
...
sql/sql_table.cc
View file @
7cbba084
...
...
@@ -3514,7 +3514,8 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
save us from that ?
*/
table
->
reginfo
.
lock_type
=
TL_WRITE
;
hooks
->
prelock
(
&
table
,
1
);
// Call prelock hooks
if
(
hooks
)
hooks
->
prelock
(
&
table
,
1
);
// Call prelock hooks
if
(
!
((
*
lock
)
=
mysql_lock_tables
(
thd
,
&
table
,
1
,
MYSQL_LOCK_IGNORE_FLUSH
,
&
not_used
)))
{
...
...
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