Skip to content

Commit e29683a

Browse files
author
Marko Mäkelä
committed
Merge mysql-5.5 to mysql-trunk.
2 parents c444275 + 4c57188 commit e29683a

13 files changed

Lines changed: 159 additions & 65 deletions

File tree

include/my_base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ enum ha_base_keytype {
449449
#define HA_ERR_NOT_IN_LOCK_PARTITIONS 178
450450
#define HA_ERR_INDEX_COL_TOO_LONG 179 /* Index column length exceeds limit */
451451
#define HA_ERR_INDEX_CORRUPT 180 /* InnoDB index corrupted */
452-
#define HA_ERR_LAST 180 /* Copy of last error nr */
452+
#define HA_ERR_UNDO_REC_TOO_BIG 181 /* Undo log record too big */
453+
#define HA_ERR_LAST 181 /* Copy of last error nr */
453454

454455
/* Number of different errors */
455456
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

mysql-test/suite/innodb/r/innodb-index.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,15 @@ INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
978978
UPDATE t1 SET a=1000;
979979
DELETE FROM t1;
980980
DROP TABLE t1;
981+
CREATE TABLE bug12547647(
982+
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
983+
PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
984+
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
985+
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
986+
COMMIT;
987+
UPDATE bug12547647 SET c = REPEAT('b',16928);
988+
ERROR HY000: Undo log record is too big.
989+
DROP TABLE bug12547647;
981990
set global innodb_file_per_table=0;
982991
set global innodb_file_format=Antelope;
983992
set global innodb_file_format_max=Antelope;

mysql-test/suite/innodb/t/innodb-index.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,19 @@ DELETE FROM t1;
478478
-- sleep 10
479479
DROP TABLE t1;
480480

481+
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
482+
CREATE TABLE bug12547647(
483+
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
484+
PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
485+
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
486+
487+
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
488+
COMMIT;
489+
# The following used to cause infinite undo log allocation.
490+
--error ER_UNDO_RECORD_TOO_BIG
491+
UPDATE bug12547647 SET c = REPEAT('b',16928);
492+
DROP TABLE bug12547647;
493+
481494
eval set global innodb_file_per_table=$per_table;
482495
eval set global innodb_file_format=$format;
483496
eval set global innodb_file_format_max=$format;

mysys/my_handler_errors.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ static const char *handler_error_messages[]=
8383
"Too many active concurrent transactions",
8484
"Record not matching the given partition set",
8585
"Index column length exceeds limit",
86-
"Index corrupted"
86+
"Index corrupted",
87+
"Undo record too big"
8788
};
8889

8990
extern void my_handler_error_register(void);

sql/handler.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,6 +3126,9 @@ void handler::print_error(int error, myf errflag)
31263126
case HA_ERR_INDEX_CORRUPT:
31273127
textno= ER_INDEX_CORRUPT;
31283128
break;
3129+
case HA_ERR_UNDO_REC_TOO_BIG:
3130+
textno= ER_UNDO_RECORD_TOO_BIG;
3131+
break;
31293132
default:
31303133
{
31313134
/* The error was "unknown" to this function.

sql/share/errmsg-utf8.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6514,6 +6514,7 @@ ER_ERROR_IN_UNKNOWN_TRIGGER_BODY
65146514

65156515
ER_INDEX_CORRUPT
65166516
eng "Index %s is corrupted"
6517+
65176518
ER_MTS_FEATURE_IS_NOT_SUPPORTED
65186519
eng "%s is not supported in multi-threaded slave mode. %s"
65196520
ER_MTS_UPDATED_DBS_GREATER_MAX
@@ -6522,3 +6523,6 @@ ER_MTS_CANT_PARALLEL
65226523
eng "Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s."
65236524
ER_MTS_INCONSISTENT_DATA
65246525
eng "%s"
6526+
6527+
ER_UNDO_RECORD_TOO_BIG
6528+
eng "Undo log record is too big."

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,8 @@ convert_error_code_to_mysql(
12431243
return(HA_ERR_UNSUPPORTED);
12441244
case DB_INDEX_CORRUPT:
12451245
return(HA_ERR_INDEX_CORRUPT);
1246+
case DB_UNDO_RECORD_TOO_BIG:
1247+
return(HA_ERR_UNDO_REC_TOO_BIG);
12461248
}
12471249
}
12481250

storage/innobase/include/db0err.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
3+
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -111,6 +111,7 @@ enum db_err {
111111
DB_TOO_BIG_INDEX_COL, /* index column size exceeds maximum
112112
limit */
113113
DB_INDEX_CORRUPT, /* we have corrupted index */
114+
DB_UNDO_RECORD_TOO_BIG, /* the undo log record is too big */
114115

115116
/* The following are partial failure codes */
116117
DB_FAIL = 1000,

storage/innobase/include/trx0undo.h

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
3+
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -204,17 +204,51 @@ trx_undo_add_page(
204204
mtr_t* mtr); /*!< in: mtr which does not have a latch to any
205205
undo log page; the caller must have reserved
206206
the rollback segment mutex */
207+
/********************************************************************//**
208+
Frees the last undo log page.
209+
The caller must hold the rollback segment mutex. */
210+
UNIV_INTERN
211+
void
212+
trx_undo_free_last_page_func(
213+
/*==========================*/
214+
#ifdef UNIV_DEBUG
215+
const trx_t* trx, /*!< in: transaction */
216+
#endif /* UNIV_DEBUG */
217+
trx_undo_t* undo, /*!< in/out: undo log memory copy */
218+
mtr_t* mtr) /*!< in/out: mini-transaction which does not
219+
have a latch to any undo log page or which
220+
has allocated the undo log page */
221+
__attribute__((nonnull));
222+
#ifdef UNIV_DEBUG
223+
# define trx_undo_free_last_page(trx,undo,mtr) \
224+
trx_undo_free_last_page_func(trx,undo,mtr)
225+
#else /* UNIV_DEBUG */
226+
# define trx_undo_free_last_page(trx,undo,mtr) \
227+
trx_undo_free_last_page_func(undo,mtr)
228+
#endif /* UNIV_DEBUG */
229+
207230
/***********************************************************************//**
208231
Truncates an undo log from the end. This function is used during a rollback
209232
to free space from an undo log. */
210233
UNIV_INTERN
211234
void
212-
trx_undo_truncate_end(
213-
/*==================*/
214-
trx_t* trx, /*!< in: transaction whose undo log it is */
215-
trx_undo_t* undo, /*!< in: undo log */
216-
undo_no_t limit); /*!< in: all undo records with undo number
235+
trx_undo_truncate_end_func(
236+
/*=======================*/
237+
#ifdef UNIV_DEBUG
238+
const trx_t* trx, /*!< in: transaction whose undo log it is */
239+
#endif /* UNIV_DEBUG */
240+
trx_undo_t* undo, /*!< in/out: undo log */
241+
undo_no_t limit) /*!< in: all undo records with undo number
217242
>= this value should be truncated */
243+
__attribute__((nonnull));
244+
#ifdef UNIV_DEBUG
245+
# define trx_undo_truncate_end(trx,undo,limit) \
246+
trx_undo_truncate_end_func(trx,undo,limit)
247+
#else /* UNIV_DEBUG */
248+
# define trx_undo_truncate_end(trx,undo,limit) \
249+
trx_undo_truncate_end_func(undo,limit)
250+
#endif /* UNIV_DEBUG */
251+
218252
/***********************************************************************//**
219253
Truncates an undo log from the start. This function is used during a purge
220254
operation. */

storage/innobase/row/row0mysql.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ row_mysql_handle_errors(
586586
case DB_DUPLICATE_KEY:
587587
case DB_FOREIGN_DUPLICATE_KEY:
588588
case DB_TOO_BIG_RECORD:
589+
case DB_UNDO_RECORD_TOO_BIG:
589590
case DB_ROW_IS_REFERENCED:
590591
case DB_NO_REFERENCED_ROW:
591592
case DB_CANNOT_ADD_CONSTRAINT:

0 commit comments

Comments
 (0)