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
81c92d5a
Commit
81c92d5a
authored
Feb 20, 2001
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanups...
parent
a78f9ad0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
145 additions
and
120 deletions
+145
-120
client/mysql.cc
client/mysql.cc
+5
-5
client/mysqltest.c
client/mysqltest.c
+46
-29
sql/ha_myisam.cc
sql/ha_myisam.cc
+7
-7
sql/mysqld.cc
sql/mysqld.cc
+72
-66
sql/slave.cc
sql/slave.cc
+15
-13
No files found.
client/mysql.cc
View file @
81c92d5a
...
@@ -2212,14 +2212,14 @@ com_status(String *buffer __attribute__((unused)),
...
@@ -2212,14 +2212,14 @@ com_status(String *buffer __attribute__((unused)),
if
(
safe_updates
)
if
(
safe_updates
)
{
{
vidattr
(
A_BOLD
);
vidattr
(
A_BOLD
);
tee_fprintf
(
stdout
,
"
\n
Note that
we
are running in safe_update_mode:
\n
"
);
tee_fprintf
(
stdout
,
"
\n
Note that
you
are running in safe_update_mode:
\n
"
);
vidattr
(
A_NORMAL
);
vidattr
(
A_NORMAL
);
tee_fprintf
(
stdout
,
"\
tee_fprintf
(
stdout
,
"\
UPDATE
and DELETE that doesn't use a key in the WHERE clause are not allowed
\n
\
UPDATE
s and DELETEs that don't use a key in the WHERE clause are not allowed.
\n
\
(One can force
UPDATE/DELETE by adding LIMIT # at the end of the command
)
\n
\
(One can force
an UPDATE/DELETE by adding LIMIT # at the end of the command.
)
\n
\
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used
\n
\
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used
.
\n
\
Max number of examined row combination in a join is set to: %lu
\n\n
"
,
Max number of examined row combination in a join is set to: %lu
\n\n
"
,
select_limit
,
max_join_size
);
select_limit
,
max_join_size
);
}
}
tee_puts
(
"--------------
\n
"
,
stdout
);
tee_puts
(
"--------------
\n
"
,
stdout
);
return
0
;
return
0
;
...
...
client/mysqltest.c
View file @
81c92d5a
...
@@ -145,19 +145,36 @@ struct st_query
...
@@ -145,19 +145,36 @@ struct st_query
uint
expected_errno
[
MAX_EXPECTED_ERRORS
];
uint
expected_errno
[
MAX_EXPECTED_ERRORS
];
char
record_file
[
FN_REFLEN
];
char
record_file
[
FN_REFLEN
];
/* Add new commands before Q_UNKNOWN */
/* Add new commands before Q_UNKNOWN */
enum
{
Q_CONNECTION
=
1
,
Q_QUERY
,
Q_CONNECT
,
enum
{
Q_CONNECTION
=
1
,
Q_QUERY
,
Q_SLEEP
,
Q_INC
,
Q_DEC
,
Q_SOURCE
,
Q_CONNECT
,
Q_SLEEP
,
Q_DISCONNECT
,
Q_LET
,
Q_ECHO
,
Q_WHILE
,
Q_END_BLOCK
,
Q_INC
,
Q_DEC
,
Q_SYSTEM
,
Q_RESULT
,
Q_REQUIRE
,
Q_SAVE_MASTER_POS
,
Q_SOURCE
,
Q_DISCONNECT
,
Q_SYNC_WITH_MASTER
,
Q_ERROR
,
Q_SEND
,
Q_REAP
,
Q_DIRTY_CLOSE
,
Q_LET
,
Q_ECHO
,
Q_REPLACE
,
Q_WHILE
,
Q_END_BLOCK
,
Q_UNKNOWN
,
Q_COMMENT
,
Q_COMMENT_WITH_COMMAND
}
type
;
Q_SYSTEM
,
Q_RESULT
,
Q_REQUIRE
,
Q_SAVE_MASTER_POS
,
Q_SYNC_WITH_MASTER
,
Q_ERROR
,
Q_SEND
,
Q_REAP
,
Q_DIRTY_CLOSE
,
Q_REPLACE
,
Q_UNKNOWN
,
/* Unknown command. */
Q_COMMENT
,
/* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
}
type
;
};
};
const
char
*
command_names
[]
=
{
const
char
*
command_names
[]
=
{
"connection"
,
"query"
,
"connect"
,
"sleep"
,
"inc"
,
"dec"
,
"source"
,
"disconnect"
,
"connection"
,
"query"
,
"let"
,
"echo"
,
"while"
,
"end"
,
"system"
,
"result"
,
"require"
,
"save_master_pos"
,
"connect"
,
"sleep"
,
"sync_with_master"
,
"error"
,
"send"
,
"reap"
,
"dirty_close"
,
"replace_result"
,
0
"inc"
,
"dec"
,
"source"
,
"disconnect"
,
"let"
,
"echo"
,
"while"
,
"end"
,
"system"
,
"result"
,
"require"
,
"save_master_pos"
,
"sync_with_master"
,
"error"
,
"send"
,
"reap"
,
"dirty_close"
,
"replace_result"
,
0
};
};
TYPELIB
command_typelib
=
{
array_elements
(
command_names
),
""
,
TYPELIB
command_typelib
=
{
array_elements
(
command_names
),
""
,
...
@@ -873,9 +890,9 @@ int do_connect(struct st_query* q)
...
@@ -873,9 +890,9 @@ int do_connect(struct st_query* q)
p
=
safe_get_param
(
p
,
&
con_pass
,
"missing connection password"
);
p
=
safe_get_param
(
p
,
&
con_pass
,
"missing connection password"
);
p
=
safe_get_param
(
p
,
&
con_db
,
"missing connection db"
);
p
=
safe_get_param
(
p
,
&
con_db
,
"missing connection db"
);
p
=
safe_get_param
(
p
,
&
con_port_str
,
"missing connection port"
);
p
=
safe_get_param
(
p
,
&
con_port_str
,
"missing connection port"
);
p
=
safe_get_param
(
p
,
&
con_sock
,
"missing connection s
co
ket"
);
p
=
safe_get_param
(
p
,
&
con_sock
,
"missing connection s
oc
ket"
);
if
(
next_con
==
cons_end
)
if
(
next_con
==
cons_end
)
die
(
"Connection limit exhausted - increa
d
MAX_CONS in mysqltest.c"
);
die
(
"Connection limit exhausted - increa
se
MAX_CONS in mysqltest.c"
);
if
(
!
mysql_init
(
&
next_con
->
mysql
))
if
(
!
mysql_init
(
&
next_con
->
mysql
))
die
(
"Failed on mysql_init()"
);
die
(
"Failed on mysql_init()"
);
...
@@ -914,7 +931,7 @@ int do_while(struct st_query* q)
...
@@ -914,7 +931,7 @@ int do_while(struct st_query* q)
char
*
expr_start
,
*
expr_end
;
char
*
expr_start
,
*
expr_end
;
VAR
v
;
VAR
v
;
if
(
cur_block
==
block_stack_end
)
if
(
cur_block
==
block_stack_end
)
die
(
"Nesting too deep"
);
die
(
"Nesting too deep
ly
"
);
if
(
!
block_ok
)
if
(
!
block_ok
)
{
{
++
false_block_depth
;
++
false_block_depth
;
...
@@ -1220,7 +1237,7 @@ struct option long_options[] =
...
@@ -1220,7 +1237,7 @@ struct option long_options[] =
{
"user"
,
required_argument
,
0
,
'u'
},
{
"user"
,
required_argument
,
0
,
'u'
},
{
"verbose"
,
no_argument
,
0
,
'v'
},
{
"verbose"
,
no_argument
,
0
,
'v'
},
{
"version"
,
no_argument
,
0
,
'V'
},
{
"version"
,
no_argument
,
0
,
'V'
},
{
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
}
};
};
...
...
sql/ha_myisam.cc
View file @
81c92d5a
...
@@ -369,7 +369,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt)
...
@@ -369,7 +369,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt)
MI_NAME_DEXT
,
4
),
MYF
(
MY_WME
)))
MI_NAME_DEXT
,
4
),
MYF
(
MY_WME
)))
{
{
error
=
HA_ADMIN_FAILED
;
error
=
HA_ADMIN_FAILED
;
errmsg
=
"
failed in my_copy(
Error %d)"
;
errmsg
=
"
Failed in my_copy (
Error %d)"
;
goto
err
;
goto
err
;
}
}
...
@@ -402,7 +402,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
...
@@ -402,7 +402,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
if
(
!
fn_format
(
dst_path
,
table_name
,
backup_dir
,
reg_ext
,
4
+
64
))
if
(
!
fn_format
(
dst_path
,
table_name
,
backup_dir
,
reg_ext
,
4
+
64
))
{
{
errmsg
=
"
failed in fn_format() for .frm file: errno=
%d"
;
errmsg
=
"
Failed in fn_format() for .frm file: errno =
%d"
;
error
=
HA_ADMIN_INVALID
;
error
=
HA_ADMIN_INVALID
;
goto
err
;
goto
err
;
}
}
...
@@ -418,7 +418,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
...
@@ -418,7 +418,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
if
(
!
fn_format
(
dst_path
,
table_name
,
backup_dir
,
MI_NAME_DEXT
,
4
+
64
))
if
(
!
fn_format
(
dst_path
,
table_name
,
backup_dir
,
MI_NAME_DEXT
,
4
+
64
))
{
{
errmsg
=
"
failed in fn_format() for .MYD file: errno=
%d"
;
errmsg
=
"
Failed in fn_format() for .MYD file: errno =
%d"
;
error
=
HA_ADMIN_INVALID
;
error
=
HA_ADMIN_INVALID
;
goto
err
;
goto
err
;
}
}
...
@@ -579,7 +579,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
...
@@ -579,7 +579,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
error
=
chk_key
(
&
param
,
file
);
error
=
chk_key
(
&
param
,
file
);
}
}
}
}
thd
->
proc_info
=
"
s
aving state"
;
thd
->
proc_info
=
"
S
aving state"
;
if
(
!
error
)
if
(
!
error
)
{
{
if
((
share
->
state
.
changed
&
STATE_CHANGED
)
||
mi_is_crashed
(
file
))
if
((
share
->
state
.
changed
&
STATE_CHANGED
)
||
mi_is_crashed
(
file
))
...
@@ -636,7 +636,7 @@ bool ha_myisam::activate_all_index(THD *thd)
...
@@ -636,7 +636,7 @@ bool ha_myisam::activate_all_index(THD *thd)
if
(
share
->
state
.
key_map
!=
((
ulonglong
)
1L
<<
share
->
base
.
keys
)
-
1
)
if
(
share
->
state
.
key_map
!=
((
ulonglong
)
1L
<<
share
->
base
.
keys
)
-
1
)
{
{
const
char
*
save_proc_info
=
thd
->
proc_info
;
const
char
*
save_proc_info
=
thd
->
proc_info
;
thd
->
proc_info
=
"
c
reating index"
;
thd
->
proc_info
=
"
C
reating index"
;
myisamchk_init
(
&
param
);
myisamchk_init
(
&
param
);
param
.
op_name
=
(
char
*
)
"recreating_index"
;
param
.
op_name
=
(
char
*
)
"recreating_index"
;
param
.
testflag
=
(
T_SILENT
|
T_REP_BY_SORT
|
param
.
testflag
=
(
T_SILENT
|
T_REP_BY_SORT
|
...
...
sql/mysqld.cc
View file @
81c92d5a
...
@@ -193,8 +193,8 @@ int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
...
@@ -193,8 +193,8 @@ int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
extern
MASTER_INFO
glob_mi
;
extern
MASTER_INFO
glob_mi
;
extern
int
init_master_info
(
MASTER_INFO
*
mi
);
extern
int
init_master_info
(
MASTER_INFO
*
mi
);
// if sql_bin_update is true, SQL_LOG_UPDATE and SQL_LOG_BIN are kept in sync,
and are
// if sql_bin_update is true, SQL_LOG_UPDATE and SQL_LOG_BIN are kept in sync,
// treated as aliases for each other
//
and are
treated as aliases for each other
static
bool
kill_in_progress
=
FALSE
;
static
bool
kill_in_progress
=
FALSE
;
static
struct
rand_struct
sql_rand
;
static
struct
rand_struct
sql_rand
;
...
@@ -1110,9 +1110,9 @@ inline __volatile__ void trace_stack()
...
@@ -1110,9 +1110,9 @@ inline __volatile__ void trace_stack()
LINT_INIT
(
stack_bottom
);
LINT_INIT
(
stack_bottom
);
fprintf
(
stderr
,
fprintf
(
stderr
,
"Attemping backtrace. You can use the following information to find out
\n
\
"Attemp
t
ing backtrace. You can use the following information to find out
\n
\
where mysqld died. If you see no messages after this, something went
\n
\
where mysqld died. If you see no messages after this, something went
\n
\
terribly wrong
\n
"
);
terribly wrong
...
\n
"
);
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
uint
frame_count
=
0
;
uint
frame_count
=
0
;
__asm
__volatile__
(
"movl %%ebp,%0"
__asm
__volatile__
(
"movl %%ebp,%0"
...
@@ -1121,12 +1121,12 @@ terribly wrong\n");
...
@@ -1121,12 +1121,12 @@ terribly wrong\n");
if
(
!
ebp
)
if
(
!
ebp
)
{
{
fprintf
(
stderr
,
"frame pointer (ebp) is NULL, did you compile with
\n
\
fprintf
(
stderr
,
"frame pointer (ebp) is NULL, did you compile with
\n
\
-fomit-frame-pointer? Aborting backtrace
\n
"
);
-fomit-frame-pointer? Aborting backtrace
!
\n
"
);
return
;
return
;
}
}
if
(
!
thd
)
if
(
!
thd
)
{
{
fprintf
(
stderr
,
"Cannot determine thread, ebp=%p, backtrace may not be correct
\n
"
,
ebp
);
fprintf
(
stderr
,
"Cannot determine thread, ebp=%p, backtrace may not be correct
.
\n
"
,
ebp
);
/* Assume that the stack starts at the previous even 65K */
/* Assume that the stack starts at the previous even 65K */
ulong
tmp
=
min
(
0x10000
,
thread_stack
);
ulong
tmp
=
min
(
0x10000
,
thread_stack
);
stack_bottom
=
(
uchar
**
)
(((
ulong
)
&
stack_bottom
+
tmp
)
&
stack_bottom
=
(
uchar
**
)
(((
ulong
)
&
stack_bottom
+
tmp
)
&
...
@@ -1137,11 +1137,11 @@ terribly wrong\n");
...
@@ -1137,11 +1137,11 @@ terribly wrong\n");
if
(
ebp
>
stack_bottom
||
ebp
<
stack_bottom
-
thread_stack
)
if
(
ebp
>
stack_bottom
||
ebp
<
stack_bottom
-
thread_stack
)
{
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"Bogus stack limit or frame pointer, aborting backtrace
\n
"
);
"Bogus stack limit or frame pointer, aborting backtrace
.
\n
"
);
return
;
return
;
}
}
fprintf
(
stderr
,
"
stack range sanity check, ok, backtrace follows
\n
"
);
fprintf
(
stderr
,
"
Stack range sanity check OK, backtrace follows:
\n
"
);
while
(
ebp
<
stack_bottom
)
while
(
ebp
<
stack_bottom
)
{
{
...
@@ -1151,22 +1151,22 @@ terribly wrong\n");
...
@@ -1151,22 +1151,22 @@ terribly wrong\n");
if
(
new_ebp
<=
ebp
)
if
(
new_ebp
<=
ebp
)
{
{
fprintf
(
stderr
,
"\
fprintf
(
stderr
,
"\
New value of ebp failed sanity check
terminating backtrace
\n
"
);
New value of ebp failed sanity check
, terminating backtrace!
\n
"
);
return
;
return
;
}
}
ebp
=
new_ebp
;
ebp
=
new_ebp
;
++
frame_count
;
++
frame_count
;
}
}
fprintf
(
stderr
,
"
stack trace successful, now will try to get some
\n
\
fprintf
(
stderr
,
"
Stack trace successful, tryint to get some variables.
\n
\
variables. Some pointers may be invalid and cause dump abort
\n
"
);
Some pointers may be invalid and cause the dump to abort...
\n
"
);
heap_start
=
__bss_start
;
heap_start
=
__bss_start
;
heap_end
=
(
char
*
)
sbrk
(
0
);
heap_end
=
(
char
*
)
sbrk
(
0
);
print_str
(
"thd->query"
,
thd
->
query
,
1024
);
print_str
(
"thd->query"
,
thd
->
query
,
1024
);
fprintf
(
stderr
,
"thd->thread_id = %ld
\n
"
,
thd
->
thread_id
);
fprintf
(
stderr
,
"thd->thread_id = %ld
\n
"
,
thd
->
thread_id
);
fprintf
(
stderr
,
"
successfully dumped variables, if you ran with --log
\n
\
fprintf
(
stderr
,
"
Successfully dumped variables, if you ran with --log,
\n
\
take a look at the details of what thread %ld did to cause the crash.
\n
\
take a look at the details of what thread %ld did to cause the crash.
\n
\
In some cases of really bad corruption, this value
can be invalid
\n
"
,
In some cases of really bad corruption, this value
may be invalid
\n
"
,
thd
->
thread_id
);
thd
->
thread_id
);
fprintf
(
stderr
,
"Please use the information above to create a repeatable
\n
\
fprintf
(
stderr
,
"Please use the information above to create a repeatable
\n
\
test case for the crash, and send it to bugs@lists.mysql.com
\n
"
);
test case for the crash, and send it to bugs@lists.mysql.com
\n
"
);
...
@@ -1187,7 +1187,7 @@ static sig_handler handle_segfault(int sig)
...
@@ -1187,7 +1187,7 @@ static sig_handler handle_segfault(int sig)
mysqld got signal %d;
\n
\
mysqld got signal %d;
\n
\
The manual section 'Debugging a MySQL server' tells you how to use a
\n
\
The manual section 'Debugging a MySQL server' tells you how to use a
\n
\
stack trace and/or the core file to produce a readable backtrace that may
\n
\
stack trace and/or the core file to produce a readable backtrace that may
\n
\
help in finding out why mysqld died
\n
"
,
sig
);
help in finding out why mysqld died
.
\n
"
,
sig
);
#if defined(HAVE_LINUXTHREADS)
#if defined(HAVE_LINUXTHREADS)
#ifdef __i386__
#ifdef __i386__
trace_stack
();
trace_stack
();
...
@@ -1676,13 +1676,14 @@ int main(int argc, char **argv)
...
@@ -1676,13 +1676,14 @@ int main(int argc, char **argv)
#ifdef EXTRA_DEBUG
#ifdef EXTRA_DEBUG
case
1
:
case
1
:
sql_print_error
(
"\
sql_print_error
(
"\
Warning: one should set server-id to a non-0 value if log-bin is enabled.
\n
\
Warning: You should set server-id to a non-0 value if log-bin is enabled.
\n
\
mysqld log updates to binary log, but will not accept connections from slaves."
);
mysqld will log updates to the binary log, but will not accept connections
\n
\
from slaves."
);
break
;
break
;
#endif
#endif
case
2
:
case
2
:
sql_print_error
(
"\
sql_print_error
(
"\
Warning:
one
should set server-id to a non-0 value if master_host is set.
\n
\
Warning:
You
should set server-id to a non-0 value if master_host is set.
\n
\
The server will not act as a slave."
);
The server will not act as a slave."
);
break
;
break
;
}
}
...
@@ -2019,7 +2020,7 @@ static void create_new_thread(THD *thd)
...
@@ -2019,7 +2020,7 @@ static void create_new_thread(THD *thd)
/* don't allow too many connections */
/* don't allow too many connections */
if
(
thread_count
-
delayed_insert_threads
>=
max_connections
+
1
||
abort_loop
)
if
(
thread_count
-
delayed_insert_threads
>=
max_connections
+
1
||
abort_loop
)
{
{
DBUG_PRINT
(
"error"
,(
"
t
oo many connections"
));
DBUG_PRINT
(
"error"
,(
"
T
oo many connections"
));
close_connection
(
net
,
ER_CON_COUNT_ERROR
);
close_connection
(
net
,
ER_CON_COUNT_ERROR
);
delete
thd
;
delete
thd
;
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -2392,23 +2393,28 @@ enum options {
...
@@ -2392,23 +2393,28 @@ enum options {
OPT_BDB_TMP
,
OPT_BDB_NOSYNC
,
OPT_BDB_TMP
,
OPT_BDB_NOSYNC
,
OPT_BDB_LOCK
,
OPT_BDB_SKIP
,
OPT_BDB_LOCK
,
OPT_BDB_SKIP
,
OPT_BDB_NO_RECOVER
,
OPT_BDB_SHARED
,
OPT_BDB_NO_RECOVER
,
OPT_BDB_SHARED
,
OPT_MASTER_HOST
,
OPT_MASTER_HOST
,
OPT_MASTER_USER
,
OPT_MASTER_USER
,
OPT_MASTER_PASSWORD
,
OPT_MASTER_PASSWORD
,
OPT_MASTER_PORT
,
OPT_MASTER_PORT
,
OPT_MASTER_INFO_FILE
,
OPT_MASTER_INFO_FILE
,
OPT_MASTER_CONNECT_RETRY
,
OPT_MASTER_CONNECT_RETRY
,
OPT_SQL_BIN_UPDATE_SAME
,
OPT_SQL_BIN_UPDATE_SAME
,
OPT_REPLICATE_DO_DB
,
OPT_REPLICATE_DO_DB
,
OPT_REPLICATE_IGNORE_DB
,
OPT_REPLICATE_IGNORE_DB
,
OPT_LOG_SLAVE_UPDATES
,
OPT_LOG_SLAVE_UPDATES
,
OPT_BINLOG_DO_DB
,
OPT_BINLOG_DO_DB
,
OPT_BINLOG_IGNORE_DB
,
OPT_BINLOG_IGNORE_DB
,
OPT_WANT_CORE
,
OPT_WANT_CORE
,
OPT_SKIP_CONCURRENT_INSERT
,
OPT_SKIP_CONCURRENT_INSERT
,
OPT_MEMLOCK
,
OPT_MYISAM_RECOVER
,
OPT_MEMLOCK
,
OPT_MYISAM_RECOVER
,
OPT_REPLICATE_REWRITE_DB
,
OPT_SERVER_ID
,
OPT_SKIP_SLAVE_START
,
OPT_REPLICATE_REWRITE_DB
,
OPT_SERVER_ID
,
OPT_SKIP_INNOBASE
,
OPT_SAFEMALLOC_MEM_LIMIT
,
OPT_SKIP_SLAVE_START
,
OPT_SKIP_INNOBASE
,
OPT_REPLICATE_DO_TABLE
,
OPT_REPLICATE_IGNORE_TABLE
,
OPT_SAFEMALLOC_MEM_LIMIT
,
OPT_REPLICATE_DO_TABLE
,
OPT_REPLICATE_WILD_DO_TABLE
,
OPT_REPLICATE_WILD_IGNORE_TABLE
,
OPT_REPLICATE_IGNORE_TABLE
,
OPT_REPLICATE_WILD_DO_TABLE
,
OPT_DISCONNECT_SLAVE_EVENT_COUNT
,
OPT_ABORT_SLAVE_EVENT_COUNT
,
OPT_REPLICATE_WILD_IGNORE_TABLE
,
OPT_INNOBASE_DATA_HOME_DIR
,
OPT_INNOBASE_DATA_FILE_PATH
,
OPT_DISCONNECT_SLAVE_EVENT_COUNT
,
OPT_ABORT_SLAVE_EVENT_COUNT
,
OPT_INNOBASE_DATA_HOME_DIR
,
OPT_INNOBASE_DATA_FILE_PATH
,
OPT_INNOBASE_LOG_GROUP_HOME_DIR
,
OPT_INNOBASE_LOG_GROUP_HOME_DIR
,
OPT_INNOBASE_LOG_ARCH_DIR
,
OPT_INNOBASE_LOG_ARCHIVE
,
OPT_INNOBASE_LOG_ARCH_DIR
,
OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT
,
OPT_SAFE_SHOW_DB
,
OPT_INNOBASE_LOG_ARCHIVE
,
OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT
,
OPT_SAFE_SHOW_DB
,
OPT_GEMINI_SKIP
,
OPT_INNOBASE_SKIP
,
OPT_GEMINI_SKIP
,
OPT_INNOBASE_SKIP
,
OPT_TEMP_POOL
OPT_TEMP_POOL
};
};
...
@@ -3180,7 +3186,7 @@ static void get_options(int argc,char **argv)
...
@@ -3180,7 +3186,7 @@ static void get_options(int argc,char **argv)
if
(
!
p
)
if
(
!
p
)
{
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"
bad syntax in replicate-rewrite-db - missing ->
\n
"
);
"
Bad syntax in replicate-rewrite-db - missing '->'!
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
val
=
p
--
;
val
=
p
--
;
...
@@ -3188,7 +3194,7 @@ static void get_options(int argc,char **argv)
...
@@ -3188,7 +3194,7 @@ static void get_options(int argc,char **argv)
if
(
p
==
optarg
)
if
(
p
==
optarg
)
{
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"
bad syntax in replicate-rewrite-db - empty FROM db
\n
"
);
"
Bad syntax in replicate-rewrite-db - empty FROM db!
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
*
val
=
0
;
*
val
=
0
;
...
@@ -3197,7 +3203,7 @@ static void get_options(int argc,char **argv)
...
@@ -3197,7 +3203,7 @@ static void get_options(int argc,char **argv)
if
(
!*
val
)
if
(
!*
val
)
{
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"
bad syntax in replicate-rewrite-db - empty TO db
\n
"
);
"
Bad syntax in replicate-rewrite-db - empty TO db!
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -3224,7 +3230,7 @@ static void get_options(int argc,char **argv)
...
@@ -3224,7 +3230,7 @@ static void get_options(int argc,char **argv)
init_table_rule_hash
(
&
replicate_do_table
,
&
do_table_inited
);
init_table_rule_hash
(
&
replicate_do_table
,
&
do_table_inited
);
if
(
add_table_rule
(
&
replicate_do_table
,
optarg
))
if
(
add_table_rule
(
&
replicate_do_table
,
optarg
))
{
{
fprintf
(
stderr
,
"
could not add do table rule '%s'
\n
"
,
optarg
);
fprintf
(
stderr
,
"
Could not add do table rule '%s'!
\n
"
,
optarg
);
exit
(
1
);
exit
(
1
);
}
}
table_rules_on
=
1
;
table_rules_on
=
1
;
...
@@ -3237,7 +3243,7 @@ static void get_options(int argc,char **argv)
...
@@ -3237,7 +3243,7 @@ static void get_options(int argc,char **argv)
&
wild_do_table_inited
);
&
wild_do_table_inited
);
if
(
add_wild_table_rule
(
&
replicate_wild_do_table
,
optarg
))
if
(
add_wild_table_rule
(
&
replicate_wild_do_table
,
optarg
))
{
{
fprintf
(
stderr
,
"
could not add do table rule '%s'
\n
"
,
optarg
);
fprintf
(
stderr
,
"
Could not add do table rule '%s'!
\n
"
,
optarg
);
exit
(
1
);
exit
(
1
);
}
}
table_rules_on
=
1
;
table_rules_on
=
1
;
...
@@ -3250,7 +3256,7 @@ static void get_options(int argc,char **argv)
...
@@ -3250,7 +3256,7 @@ static void get_options(int argc,char **argv)
&
wild_ignore_table_inited
);
&
wild_ignore_table_inited
);
if
(
add_wild_table_rule
(
&
replicate_wild_ignore_table
,
optarg
))
if
(
add_wild_table_rule
(
&
replicate_wild_ignore_table
,
optarg
))
{
{
fprintf
(
stderr
,
"
could not add do table rule '%s'
\n
"
,
optarg
);
fprintf
(
stderr
,
"
Could not add ignore table rule '%s'!
\n
"
,
optarg
);
exit
(
1
);
exit
(
1
);
}
}
table_rules_on
=
1
;
table_rules_on
=
1
;
...
@@ -3262,7 +3268,7 @@ static void get_options(int argc,char **argv)
...
@@ -3262,7 +3268,7 @@ static void get_options(int argc,char **argv)
init_table_rule_hash
(
&
replicate_ignore_table
,
&
ignore_table_inited
);
init_table_rule_hash
(
&
replicate_ignore_table
,
&
ignore_table_inited
);
if
(
add_table_rule
(
&
replicate_ignore_table
,
optarg
))
if
(
add_table_rule
(
&
replicate_ignore_table
,
optarg
))
{
{
fprintf
(
stderr
,
"
could not add ignore table rule '%s'
\n
"
,
optarg
);
fprintf
(
stderr
,
"
Could not add ignore table rule '%s'!
\n
"
,
optarg
);
exit
(
1
);
exit
(
1
);
}
}
table_rules_on
=
1
;
table_rules_on
=
1
;
...
...
sql/slave.cc
View file @
81c92d5a
...
@@ -379,7 +379,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
...
@@ -379,7 +379,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
check_opt
.
init
();
check_opt
.
init
();
check_opt
.
flags
|=
T_VERY_SILENT
;
check_opt
.
flags
|=
T_VERY_SILENT
;
check_opt
.
quick
=
1
;
check_opt
.
quick
=
1
;
thd
->
proc_info
=
"
r
ebuilding the index on master dump table"
;
thd
->
proc_info
=
"
R
ebuilding the index on master dump table"
;
Vio
*
save_vio
=
thd
->
net
.
vio
;
Vio
*
save_vio
=
thd
->
net
.
vio
;
// we do not want repair() to spam us with messages
// we do not want repair() to spam us with messages
// just send them to the error log, and report the failure in case of
// just send them to the error log, and report the failure in case of
...
@@ -1027,7 +1027,7 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
...
@@ -1027,7 +1027,7 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
if
(
!
sql_error
)
if
(
!
sql_error
)
sql_error
=
ER_UNKNOWN_ERROR
;
sql_error
=
ER_UNKNOWN_ERROR
;
sql_print_error
(
"Slave:
e
rror '%s' running load data infile "
,
sql_print_error
(
"Slave:
E
rror '%s' running load data infile "
,
ER
(
sql_error
));
ER
(
sql_error
));
delete
ev
;
delete
ev
;
free_root
(
&
thd
->
mem_root
,
0
);
free_root
(
&
thd
->
mem_root
,
0
);
...
@@ -1106,8 +1106,10 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
...
@@ -1106,8 +1106,10 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
}
}
else
else
{
{
sql_print_error
(
"Could not parse log event entry, check the master for binlog corruption
\n
\
sql_print_error
(
"\
This may also be a network problem, or just a bug in the master or slave code"
);
Could not parse log event entry, check the master for binlog corruption
\n
\
This may also be a network problem, or just a bug in the master or slave code.\
"
);
return
1
;
return
1
;
}
}
return
0
;
return
0
;
...
@@ -1173,7 +1175,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
...
@@ -1173,7 +1175,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
goto
err
;
goto
err
;
}
}
thd
->
proc_info
=
"
c
onnecting to master"
;
thd
->
proc_info
=
"
C
onnecting to master"
;
#ifndef DBUG_OFF
#ifndef DBUG_OFF
sql_print_error
(
"Slave thread initialized"
);
sql_print_error
(
"Slave thread initialized"
);
#endif
#endif
...
@@ -1189,14 +1191,14 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
...
@@ -1189,14 +1191,14 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
while
(
!
slave_killed
(
thd
))
while
(
!
slave_killed
(
thd
))
{
{
thd
->
proc_info
=
"
r
equesting binlog dump"
;
thd
->
proc_info
=
"
R
equesting binlog dump"
;
if
(
request_dump
(
mysql
,
&
glob_mi
))
if
(
request_dump
(
mysql
,
&
glob_mi
))
{
{
sql_print_error
(
"Failed on request_dump()"
);
sql_print_error
(
"Failed on request_dump()"
);
if
(
slave_killed
(
thd
))
if
(
slave_killed
(
thd
))
goto
err
;
goto
err
;
thd
->
proc_info
=
"
w
aiting to reconnect after a failed dump request"
;
thd
->
proc_info
=
"
W
aiting to reconnect after a failed dump request"
;
if
(
mysql
->
net
.
vio
)
if
(
mysql
->
net
.
vio
)
vio_close
(
mysql
->
net
.
vio
);
vio_close
(
mysql
->
net
.
vio
);
// first time retry immediately, assuming that we can recover
// first time retry immediately, assuming that we can recover
...
@@ -1210,7 +1212,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
...
@@ -1210,7 +1212,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
if
(
slave_killed
(
thd
))
if
(
slave_killed
(
thd
))
goto
err
;
goto
err
;
thd
->
proc_info
=
"
r
econnecting after a failed dump request"
;
thd
->
proc_info
=
"
R
econnecting after a failed dump request"
;
sql_print_error
(
"Slave: failed dump request, reconnecting to \
sql_print_error
(
"Slave: failed dump request, reconnecting to \
try again, log '%s' at postion %ld"
,
RPL_LOG_NAME
,
try again, log '%s' at postion %ld"
,
RPL_LOG_NAME
,
last_failed_pos
=
glob_mi
.
pos
);
last_failed_pos
=
glob_mi
.
pos
);
...
@@ -1223,14 +1225,14 @@ try again, log '%s' at postion %ld", RPL_LOG_NAME,
...
@@ -1223,14 +1225,14 @@ try again, log '%s' at postion %ld", RPL_LOG_NAME,
while
(
!
slave_killed
(
thd
))
while
(
!
slave_killed
(
thd
))
{
{
thd
->
proc_info
=
"
r
eading master update"
;
thd
->
proc_info
=
"
R
eading master update"
;
uint
event_len
=
read_event
(
mysql
,
&
glob_mi
);
uint
event_len
=
read_event
(
mysql
,
&
glob_mi
);
if
(
slave_killed
(
thd
))
if
(
slave_killed
(
thd
))
goto
err
;
goto
err
;
if
(
event_len
==
packet_error
)
if
(
event_len
==
packet_error
)
{
{
thd
->
proc_info
=
"
w
aiting to reconnect after a failed read"
;
thd
->
proc_info
=
"
W
aiting to reconnect after a failed read"
;
if
(
mysql
->
net
.
vio
)
if
(
mysql
->
net
.
vio
)
vio_close
(
mysql
->
net
.
vio
);
vio_close
(
mysql
->
net
.
vio
);
if
(
retried_once
)
// punish repeat offender with sleep
if
(
retried_once
)
// punish repeat offender with sleep
...
@@ -1240,7 +1242,7 @@ try again, log '%s' at postion %ld", RPL_LOG_NAME,
...
@@ -1240,7 +1242,7 @@ try again, log '%s' at postion %ld", RPL_LOG_NAME,
if
(
slave_killed
(
thd
))
if
(
slave_killed
(
thd
))
goto
err
;
goto
err
;
thd
->
proc_info
=
"
r
econnecting after a failed read"
;
thd
->
proc_info
=
"
R
econnecting after a failed read"
;
sql_print_error
(
"Slave: Failed reading log event, \
sql_print_error
(
"Slave: Failed reading log event, \
reconnecting to retry, log '%s' position %ld"
,
RPL_LOG_NAME
,
reconnecting to retry, log '%s' position %ld"
,
RPL_LOG_NAME
,
last_failed_pos
=
glob_mi
.
pos
);
last_failed_pos
=
glob_mi
.
pos
);
...
@@ -1249,7 +1251,7 @@ reconnecting to retry, log '%s' position %ld", RPL_LOG_NAME,
...
@@ -1249,7 +1251,7 @@ reconnecting to retry, log '%s' position %ld", RPL_LOG_NAME,
break
;
break
;
}
}
thd
->
proc_info
=
"
p
rocessing master log event"
;
thd
->
proc_info
=
"
P
rocessing master log event"
;
if
(
exec_event
(
thd
,
&
mysql
->
net
,
&
glob_mi
,
event_len
))
if
(
exec_event
(
thd
,
&
mysql
->
net
,
&
glob_mi
,
event_len
))
{
{
sql_print_error
(
"\
sql_print_error
(
"\
...
@@ -1303,7 +1305,7 @@ position %ld",
...
@@ -1303,7 +1305,7 @@ position %ld",
thd
->
query
=
thd
->
db
=
0
;
// extra safety
thd
->
query
=
thd
->
db
=
0
;
// extra safety
if
(
mysql
)
if
(
mysql
)
mc_mysql_close
(
mysql
);
mc_mysql_close
(
mysql
);
thd
->
proc_info
=
"
w
aiting for slave mutex on exit"
;
thd
->
proc_info
=
"
W
aiting for slave mutex on exit"
;
pthread_mutex_lock
(
&
LOCK_slave
);
pthread_mutex_lock
(
&
LOCK_slave
);
slave_running
=
0
;
slave_running
=
0
;
abort_slave
=
0
;
abort_slave
=
0
;
...
...
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