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
3e9e629c
Commit
3e9e629c
authored
Feb 06, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
ma_control_file.c:
SCCS merged storage/maria/ma_control_file.c: SCCS merged
parents
7223b4ed
20bbcc35
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
53 additions
and
29 deletions
+53
-29
include/my_dbug.h
include/my_dbug.h
+2
-0
mysys/my_thr_init.c
mysys/my_thr_init.c
+15
-0
sql/handler.cc
sql/handler.cc
+5
-5
sql/log.cc
sql/log.cc
+1
-1
sql/mysql_priv.h
sql/mysql_priv.h
+2
-2
storage/maria/ha_maria.cc
storage/maria/ha_maria.cc
+1
-2
storage/maria/ma_blockrec.c
storage/maria/ma_blockrec.c
+1
-5
storage/maria/ma_check.c
storage/maria/ma_check.c
+3
-6
storage/maria/ma_checkpoint.c
storage/maria/ma_checkpoint.c
+1
-5
storage/maria/ma_control_file.c
storage/maria/ma_control_file.c
+13
-1
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+9
-2
No files found.
include/my_dbug.h
View file @
3e9e629c
...
...
@@ -85,6 +85,7 @@ extern void _db_force_flush();
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
#define IF_DBUG(A) A
#define DBUG_ABORT() ((void)fflush(DBUG_FILE), abort())
#else
/* No debugger */
#define DBUG_ENTER(a1)
...
...
@@ -114,6 +115,7 @@ extern void _db_force_flush();
#define DEBUGGER_OFF do { } while(0)
#define DEBUGGER_ON do { } while(0)
#define IF_DBUG(A)
#define DBUG_ABORT() ((void)(0))
#endif
#ifdef __cplusplus
}
...
...
mysys/my_thr_init.c
View file @
3e9e629c
...
...
@@ -444,3 +444,18 @@ static uint get_thread_lib(void)
}
#endif
/* THREAD */
#ifdef __WIN__
/*
With Windows debug builds abort() causes a popup from CRT; as abort()
is used in tests it is annoying so we use a custom one.
*/
void
abort
(
void
)
{
#ifdef REENABLE_AFTER_FIX_FOR_BUG_31745
/* don't want a popup */
raise
(
SIGABRT
);
#endif
_exit
(
3
);
}
#endif
sql/handler.cc
View file @
3e9e629c
...
...
@@ -719,7 +719,7 @@ int ha_commit_trans(THD *thd, bool all)
goto
end
;
}
DBUG_EXECUTE_IF
(
"crash_commit_before"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_before"
,
DBUG_ABORT
(););
/* Close all cursors that can not survive COMMIT */
if
(
is_real_trans
)
/* not a statement commit */
...
...
@@ -737,7 +737,7 @@ int ha_commit_trans(THD *thd, bool all)
}
status_var_increment
(
thd
->
status_var
.
ha_prepare_count
);
}
DBUG_EXECUTE_IF
(
"crash_commit_after_prepare"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_after_prepare"
,
DBUG_ABORT
(););
if
(
error
||
(
is_real_trans
&&
xid
&&
(
error
=
!
(
cookie
=
tc_log
->
log_xid
(
thd
,
xid
)))))
{
...
...
@@ -745,13 +745,13 @@ int ha_commit_trans(THD *thd, bool all)
error
=
1
;
goto
end
;
}
DBUG_EXECUTE_IF
(
"crash_commit_after_log"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_after_log"
,
DBUG_ABORT
(););
}
error
=
ha_commit_one_phase
(
thd
,
all
)
?
(
cookie
?
2
:
1
)
:
0
;
DBUG_EXECUTE_IF
(
"crash_commit_before_unlog"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_before_unlog"
,
DBUG_ABORT
(););
if
(
cookie
)
tc_log
->
unlog
(
cookie
,
xid
);
DBUG_EXECUTE_IF
(
"crash_commit_after"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_after"
,
DBUG_ABORT
(););
end:
if
(
is_real_trans
)
start_waiting_global_read_lock
(
thd
);
...
...
sql/log.cc
View file @
3e9e629c
...
...
@@ -4049,7 +4049,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
goto
err
;
if
(
flush_and_sync
())
goto
err
;
DBUG_EXECUTE_IF
(
"half_binlogged_transaction"
,
abort
(););
DBUG_EXECUTE_IF
(
"half_binlogged_transaction"
,
DBUG_ABORT
(););
if
(
cache
->
error
)
// Error on read
{
sql_print_error
(
ER
(
ER_ERROR_ON_READ
),
cache
->
file_name
,
errno
);
...
...
sql/mysql_priv.h
View file @
3e9e629c
...
...
@@ -930,7 +930,7 @@ check_and_unset_inject_value(int value)
#define SET_ERROR_INJECT_VALUE(x) \
current_thd->error_inject_value= (x)
#define ERROR_INJECT_CRASH(code) \
DBUG_EVALUATE_IF(code, (
abort
(), 0), 0)
DBUG_EVALUATE_IF(code, (
DBUG_ABORT
(), 0), 0)
#define ERROR_INJECT_ACTION(code, action) \
(check_and_unset_keyword(code) ? ((action), 0) : 0)
#define ERROR_INJECT(code) \
...
...
@@ -940,7 +940,7 @@ check_and_unset_inject_value(int value)
#define ERROR_INJECT_VALUE_ACTION(value,action) \
(check_and_unset_inject_value(value) ? (action) : 0)
#define ERROR_INJECT_VALUE_CRASH(value) \
ERROR_INJECT_VALUE_ACTION(value, (
abort
(), 0))
ERROR_INJECT_VALUE_ACTION(value, (
DBUG_ABORT
(), 0))
#endif
...
...
storage/maria/ha_maria.cc
View file @
3e9e629c
...
...
@@ -1678,8 +1678,7 @@ int ha_maria::enable_indexes(uint mode)
DBUG_EXECUTE_IF
(
"maria_crash_enable_index"
,
{
DBUG_PRINT
(
"maria_crash_enable_index"
,
(
"now"
));
fflush
(
DBUG_FILE
);
abort
();
DBUG_ABORT
();
});
return
error
;
}
...
...
storage/maria/ma_blockrec.c
View file @
3e9e629c
...
...
@@ -2864,11 +2864,7 @@ static my_bool write_block_record(MARIA_HA *info,
translog_flush
(
translog_get_horizon
());
});
DBUG_EXECUTE_IF
(
"maria_crash"
,
{
DBUG_PRINT
(
"maria_crash"
,
(
"now"
));
fflush
(
DBUG_FILE
);
abort
();
});
{
DBUG_PRINT
(
"maria_crash"
,
(
"now"
));
DBUG_ABORT
();
});
}
#endif
...
...
storage/maria/ma_check.c
View file @
3e9e629c
...
...
@@ -2813,8 +2813,7 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name)
DBUG_EXECUTE_IF
(
"maria_crash_sort_index"
,
{
DBUG_PRINT
(
"maria_crash_sort_index"
,
(
"now"
));
fflush
(
DBUG_FILE
);
abort
();
DBUG_ABORT
();
});
DBUG_RETURN
(
0
);
...
...
@@ -3453,8 +3452,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
DBUG_EXECUTE_IF
(
"maria_crash_create_index_by_sort"
,
{
DBUG_PRINT
(
"maria_crash_create_index_by_sort"
,
(
"now"
));
fflush
(
DBUG_FILE
);
abort
();
DBUG_ABORT
();
});
if
(
scan_inited
)
{
...
...
@@ -3650,8 +3648,7 @@ err:
DBUG_EXECUTE_IF
(
"maria_crash_repair"
,
{
DBUG_PRINT
(
"maria_crash_repair"
,
(
"now"
));
fflush
(
DBUG_FILE
);
abort
();
DBUG_ABORT
();
});
}
share
->
state
.
changed
|=
STATE_NOT_SORTED_PAGES
;
...
...
storage/maria/ma_checkpoint.c
View file @
3e9e629c
...
...
@@ -419,11 +419,7 @@ void ma_checkpoint_end(void)
flush_all_tables
(
1
);
});
DBUG_EXECUTE_IF
(
"maria_crash"
,
{
DBUG_PRINT
(
"maria_crash"
,
(
"now"
));
fflush
(
DBUG_FILE
);
abort
();
});
{
DBUG_PRINT
(
"maria_crash"
,
(
"now"
));
DBUG_ABORT
();
});
if
(
checkpoint_inited
)
{
...
...
storage/maria/ma_control_file.c
View file @
3e9e629c
...
...
@@ -358,11 +358,20 @@ CONTROL_FILE_ERROR ma_control_file_create_or_open()
lock_file:
retry
=
0
;
/*
On Windows, my_lock() uses locking() which is mandatory locking and so
prevents maria-recovery.test from copying the control file. And in case of
crash, it may take a while for Windows to unlock file, causing downtime.
*/
/**
@todo BUG We should explore my_sopen(_SH_DENYWRD) to open or create the
file under Windows.
*/
#ifndef __WIN__
/*
We can't here use the automatic wait in my_lock() as the alarm thread
may not yet exists.
*/
while
(
my_lock
(
control_file_fd
,
F_WRLCK
,
0L
,
F_TO_EOF
,
MYF
(
MY_SEEK_NOT_DONE
|
MY_FORCE_LOCK
|
MY_NO_WAIT
)))
{
...
...
@@ -378,6 +387,7 @@ lock_file:
}
sleep
(
1
);
}
#endif
DBUG_RETURN
(
0
);
...
...
@@ -495,8 +505,10 @@ int ma_control_file_end()
if
(
control_file_fd
<
0
)
/* already closed */
DBUG_RETURN
(
0
);
#ifndef __WIN__
(
void
)
my_lock
(
control_file_fd
,
F_UNLCK
,
0L
,
F_TO_EOF
,
MYF
(
MY_SEEK_NOT_DONE
|
MY_FORCE_LOCK
));
#endif
close_error
=
my_close
(
control_file_fd
,
MYF
(
MY_WME
));
/*
...
...
storage/maria/ma_loghandler.c
View file @
3e9e629c
...
...
@@ -1316,9 +1316,16 @@ LSN translog_get_file_max_lsn_stored(uint32 file)
{
LOGHANDLER_FILE_INFO
info
;
my_bool
error
;
File
fd
=
open_logfile_by_number_no_cache
(
file
);
if
(
fd
<
0
||
translog_read_file_header
(
&
info
,
fd
))
if
(
fd
>=
0
)
{
error
=
translog_read_file_header
(
&
info
,
fd
);
my_close
(
fd
,
MYF
(
MY_WME
));
}
else
error
=
TRUE
;
if
(
error
)
{
DBUG_PRINT
(
"error"
,
(
"Can't read file header"
));
DBUG_RETURN
(
LSN_ERROR
);
...
...
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