Commit 87f52610 authored by df@pippilotta.erinye.com's avatar df@pippilotta.erinye.com
Browse files

apply snapshot innodb-5.1-ss2387

------------------------------------------------------------------------
r2361 | sunny | 2008-03-12 09:08:09 +0200 (Wed, 12 Mar 2008) | 3 lines
Changed paths:
   M /branches/5.1/include/srv0srv.h
   M /branches/5.1/os/os0file.c
   M /branches/5.1/srv/srv0srv.c
   M /branches/5.1/srv/srv0start.c

branches/5.1: Remove the innodb_flush_method fdatasync option since it was
not being used and there was a potential it could mislead users.

------------------------------------------------------------------------
r2367 | marko | 2008-03-17 10:23:03 +0200 (Mon, 17 Mar 2008) | 5 lines
Changed paths:
   M /branches/5.1/handler/ha_innodb.cc

branches/5.1: ha_innobase::check_if_incompatible_data(): Check
HA_CREATE_USED_ROW_FORMAT before comparing row_type.  Previously,
the comparison was incorrectly guarded by the presence of an
AUTO_INCREMENT attribute.

------------------------------------------------------------------------
r2374 | vasil | 2008-03-18 09:35:30 +0200 (Tue, 18 Mar 2008) | 11 lines
Changed paths:
   M /branches/5.1/dict/dict0dict.c
   A /branches/5.1/mysql-test/innodb_bug35220.result
   A /branches/5.1/mysql-test/innodb_bug35220.test

branches/5.1:

Fix Bug#35220 ALTER TABLE too picky on reserved word "foreign".

In ALTER TABLE, change the internal parser to search for
``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing
ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken
with ALTER TABLE ... DROP foreign_col;

Approved by:    Heikki

------------------------------------------------------------------------
r2379 | vasil | 2008-03-19 18:48:00 +0200 (Wed, 19 Mar 2008) | 10 lines
Changed paths:
   M /branches/5.1/os/os0file.c

branches/5.1:

Fix Bug#34823:
fsync() occasionally returns ENOLCK and causes InnoDB to restart mysqld

Create a wrapper to fsync(2) that retries the operation if the error is
ENOLCK. Use that wrapper instead of fsync(2).

Approved by:    Heikki

------------------------------------------------------------------------
r2380 | sunny | 2008-03-21 05:03:56 +0200 (Fri, 21 Mar 2008) | 9 lines
Changed paths:
   M /branches/5.1/include/trx0undo.h
   M /branches/5.1/trx/trx0trx.c
   M /branches/5.1/trx/trx0undo.c

branches/5.1: Fix for Bug# 35352. We've added a heuristic that checks
the size of the UNDO slots cache lists (insert and upate). If either of
cached lists has more than 500 entries then we add any UNDO slots that are
freed, to the common free list instead of the cache list, this is to avoid
the case where all the free slots end up in only one of the lists on startup
after a crash.

Tested with test case for 26590 and passes all mysql-test(s).

------------------------------------------------------------------------
r2383 | vasil | 2008-03-26 09:35:22 +0200 (Wed, 26 Mar 2008) | 4 lines
Changed paths:
   M /branches/5.1/include/row0mysql.h

branches/5.1:

Fix typo in comment.

------------------------------------------------------------------------
r2384 | vasil | 2008-03-26 18:26:54 +0200 (Wed, 26 Mar 2008) | 20 lines
Changed paths:
   A /branches/5.1/mysql-test/innodb_bug34300.result
   A /branches/5.1/mysql-test/innodb_bug34300.test
   M /branches/5.1/row/row0sel.c

branches/5.1:

Fix Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1

Copy the BLOB fields, that are stored internally, to a safe place
(prebuilt->blob_heap) when converting a row from InnoDB format to
MySQL format in row_sel_store_mysql_rec().

The bug was introduced in:

 ------------------------------------------------------------------------
 r587 | osku | 2006-05-23 15:35:58 +0300 (Tue, 23 May 2006) | 3 lines

 Optimize BLOB selects by using prebuilt->blob_heap directly instead of first
 reading BLOB data to a temporary heap and then copying it to
 prebuilt->blob_heap.
 ------------------------------------------------------------------------

Approved by:    Heikki

------------------------------------------------------------------------
r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines
Changed paths:
   M /branches/5.1/mysql-test/innodb.result

branches/5.1:

Merge change from MySQL (this fixes the failing innodb test):

ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0
  Fixed bug#30059.
  Server handles truncation for assignment of too-long values
  into CHAR/VARCHAR/TEXT columns in a different ways when the
  truncated characters are spaces:
  1. CHAR(N) columns silently ignore end-space truncation;
  2. TEXT columns post a truncation warning/error in the
     non-strict/strict mode.
  3. VARCHAR columns always post a truncation note in
     any mode.

  Space truncation processing has been synchronised over
  CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR
  columns has been propagated as standard.

  Binary-encoded string/BLOB columns are not affected.


------------------------------------------------------------------------
r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines
Changed paths:
   M /branches/5.1/row/row0sel.c

branches/5.1:

Check whether *trx->mysql_query_str is != NULL in addition to
trx->mysql_query_str. This adds more safety.

This may or may not fix Bug#35226 RBR event crashes slave.


------------------------------------------------------------------------
parent fe0bff70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3395,7 +3395,7 @@ dict_foreign_parse_drop_constraints(

	ptr = dict_accept(cs, ptr, "FOREIGN", &success);

	if (!success) {
	if (!success || !my_isspace(cs, *ptr)) {

		goto loop;
	}
+1 −1
Original line number Diff line number Diff line
@@ -7935,7 +7935,7 @@ bool ha_innobase::check_if_incompatible_data(
	}

	/* Check that row format didn't change */
	if ((info->used_fields & HA_CREATE_USED_AUTO) &&
	if ((info->used_fields & HA_CREATE_USED_ROW_FORMAT) &&
		get_row_type() != info->row_type) {

		return COMPATIBLE_DATA_NO;
+1 −5
Original line number Diff line number Diff line
@@ -249,11 +249,7 @@ extern srv_sys_t* srv_sys;

/* Alternatives for the file flush option in Unix; see the InnoDB manual
about what these mean */
#define SRV_UNIX_FDATASYNC	1	/* This is the default; it is
					currently mapped to a call of
					fsync() because fdatasync() seemed
					to corrupt files in Linux and
					Solaris */
#define SRV_UNIX_FSYNC		1	/* This is the default */
#define SRV_UNIX_O_DSYNC	2
#define SRV_UNIX_LITTLESYNC	3
#define SRV_UNIX_NOSYNC		4
+1 −0
Original line number Diff line number Diff line
@@ -240,6 +240,7 @@ trx_undo_set_state_at_finish(
/*=========================*/
				/* out: undo log segment header page,
				x-latched */
	trx_rseg_t*	rseg,	/* in: rollback segment memory object */
	trx_t*		trx,	/* in: transaction */
	trx_undo_t*	undo,	/* in: undo log memory copy */
	mtr_t*		mtr);	/* in: mtr */
+52 −9
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ Created 10/21/1995 Heikki Tuuri
#include <errno.h>
#endif /* UNIV_HOTBACKUP */

#undef HAVE_FDATASYNC

#ifdef POSIX_ASYNC_IO
/* We assume in this case that the OS has standard Posix aio (at least SunOS
2.6, HP-UX 11i and AIX 4.3 have) */
@@ -1812,6 +1810,55 @@ os_file_set_eof(
#endif /* __WIN__ */
}

#ifndef __WIN__
/***************************************************************************
Wrapper to fsync(2) that retries the call on some errors.
Returns the value 0 if successful; otherwise the value -1 is returned and
the global variable errno is set to indicate the error. */

static
int
os_file_fsync(
/*==========*/
				/* out: 0 if success, -1 otherwise */
	os_file_t	file)	/* in: handle to a file */
{
	int	ret;
	int	failures;
	ibool	retry;

	failures = 0;

	do {
		ret = fsync(file);

		os_n_fsyncs++;

		if (ret == -1 && errno == ENOLCK) {

			if (failures % 100 == 0) {

				ut_print_timestamp(stderr);
				fprintf(stderr,
					"  InnoDB: fsync(): "
					"No locks available; retrying\n");
			}

			os_thread_sleep(200000 /* 0.2 sec */);

			failures++;

			retry = TRUE;
		} else {

			retry = FALSE;
		}
	} while (retry);

	return(ret);
}
#endif /* !__WIN__ */

/***************************************************************************
Flushes the write buffers of a given file to the disk. */

@@ -1869,23 +1916,19 @@ os_file_flush(
		/* If we are not on an operating system that supports this,
		then fall back to a plain fsync. */

		ret = fsync(file);
		ret = os_file_fsync(file);
	} else {
		ret = fcntl(file, F_FULLFSYNC, NULL);

		if (ret) {
			/* If we are not on a file system that supports this,
			then fall back to a plain fsync. */
			ret = fsync(file);
			ret = os_file_fsync(file);
		}
	}
#elif HAVE_FDATASYNC
	ret = fdatasync(file);
#else
	/*	fprintf(stderr, "Flushing to file %p\n", file); */
	ret = fsync(file);
	ret = os_file_fsync(file);
#endif
	os_n_fsyncs++;

	if (ret == 0) {
		return(TRUE);
Loading