summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-21 07:03:03 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-21 07:03:03 +0200
commitb08bb5e8cf1d11afc535ca366a05d57046f991cb (patch)
tree48692f6c1d7557a1193f638b1883e8d11c42c761 /innobase
parent74ed670cb824ea51f32e88c0621c649b74657d7f (diff)
parentdb046dfd78c3e32e8e1a2f2bd42e1df99a303acd (diff)
downloadmariadb-git-b08bb5e8cf1d11afc535ca366a05d57046f991cb.tar.gz
merge with 3.23.47
Docs/manual.texi: Auto merged innobase/row/row0ins.c: Auto merged mysql-test/r/innodb.result: Auto merged sql/mysqld.cc: Use local version.
Diffstat (limited to 'innobase')
-rw-r--r--innobase/log/log0recv.c33
-rw-r--r--innobase/row/row0ins.c19
2 files changed, 47 insertions, 5 deletions
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index 1734cfadfff..f83a49d01a6 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -564,8 +564,15 @@ recv_parse_or_apply_log_rec_body(
} else if (type <= MLOG_WRITE_STRING) {
new_ptr = mlog_parse_string(ptr, end_ptr, page);
} else {
- new_ptr = NULL; /* Eliminate compiler warning */
- ut_error;
+ new_ptr = NULL;
+
+ fprintf(stderr,
+ "InnoDB: WARNING: the log file may have been corrupt and it\n"
+ "InnoDB: is possible that the log scan did not proceed\n"
+ "InnoDB: far enough in recovery. Please run CHECK TABLE\n"
+ "InnoDB: on your InnoDB tables to check that they are ok!\n"
+ "InnoDB: Corrupt log record type %lu\n",
+ (ulint)type);
}
ut_ad(!page || new_ptr);
@@ -1316,9 +1323,29 @@ recv_parse_log_rec(
new_ptr = mlog_parse_initial_log_record(ptr, end_ptr, type, space,
page_no);
+
+ /* If the operating system writes to the log complete 512-byte
+ blocks, we should not get the warnings below in recovery.
+ A warning means that the header and the trailer appeared ok
+ in a 512-byte block, but in the middle there was something wrong.
+ TODO: (1) add similar warnings in the case there is an incompletely
+ written log record which does not extend to the boundary of a
+ 512-byte block. (2) Add a checksum to a log block. */
+
+ if (!new_ptr) {
+ return(0);
+ }
+
/* Check that space id and page_no are sensible */
- if (!new_ptr || *space != 0 || *page_no > 0x8FFFFFFF) {
+ if (*space != 0 || *page_no > 0x8FFFFFFF) {
+ fprintf(stderr,
+ "InnoDB: WARNING: the log file may have been corrupt and it\n"
+ "InnoDB: is possible that the log scan did not proceed\n"
+ "InnoDB: far enough in recovery. Please run CHECK TABLE\n"
+ "InnoDB: on your InnoDB tables to check that they are ok!\n"
+ "InnoDB: Corrupt log record type %lu, space id %lu, page no %lu\n",
+ (ulint)(*type), *space, *page_no);
return(0);
}
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index c5174adee37..c3f912d5f61 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -319,6 +319,7 @@ row_ins_dupl_error_with_rec(
ulint matched_fields;
ulint matched_bytes;
ulint n_unique;
+ ulint i;
n_unique = dict_index_get_n_unique(index);
@@ -329,12 +330,26 @@ row_ins_dupl_error_with_rec(
if (matched_fields < n_unique) {
- return(FALSE);
+ return(FALSE);
+ }
+
+ /* In a unique secondary index we allow equal key values if they
+ contain SQL NULLs */
+
+ if (!(index->type & DICT_CLUSTERED)) {
+
+ for (i = 0; i < n_unique; i++) {
+ if (UNIV_SQL_NULL == dfield_get_len(
+ dtuple_get_nth_field(entry, i))) {
+
+ return(FALSE);
+ }
+ }
}
if (!rec_get_deleted_flag(rec)) {
- return(TRUE);
+ return(TRUE);
}
return(FALSE);