Commit 7bafd119 authored by unknown's avatar unknown
Browse files

Changes from the innodb-5.0-ss115 snapshot.

 Fixed bugs:
 BUG#15991: "innodb-file-per-table + symlink database + rename = crash"
 BUG#15650: "DELETE with LEFT JOIN crashes server"
 BUG#15308: "Problem of Order with Enum Column in Primary Key"
 BUG#14189: "VARBINARY and BINARY variables: trailing space ignored"


innobase/include/data0type.h:
  Changes from the innodb-5.0-ss115 snapshot.
innobase/include/data0type.ic:
  Changes from the innodb-5.0-ss115 snapshot.
   Fixed bug #14189. dtype_get_pad_char(): Do not pad VARBINARY
   or BINARY cloumns.
innobase/include/lock0lock.h:
  Changes from the innodb-5.0-ss115 snapshot.
innobase/include/os0file.h:
  Changes from the innodb-5.0-ss115 snapshot.
   os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and
   EISDIR to the new code OS_FILE_PATH_ERROR. Treat this code as
   OS_FILE_PATH_ERROR. This fixes the crash on RENAME TABLE when
   the .ibd file is a symbolic link to a different file system
   (bug#15991).
innobase/include/row0mysql.h:
  Changes from the innodb-5.0-ss115 snapshot.
innobase/lock/lock0lock.c:
  Changes from the innodb-5.0-ss115 snapshot.
   lock_rec_unlock(): Initialize local variable release_lock,
   in order to avoid dereferencing an uninitialized pointer
   when no lock exists on rec.
innobase/os/os0file.c:
  Changes from the innodb-5.0-ss115 snapshot.
   os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and
     EISDIR to the new code OS_FILE_PATH_ERROR. Treat this code as
     OS_FILE_PATH_ERROR. This fixes the crash on RENAME TABLE when
     the .ibd file is a symbolic link to a different file system
     (bug#15991).
   Protect the increment and decrement operations on the statistic
     variables os_n_pending_writes/reads with os_file_count_mutes.
innobase/row/row0ins.c:
  Changes from the innodb-5.0-ss115 snapshot.
   Fixed bug #14189. row_ins_cascade_calc_update_vec(): Refuse
   ON UPDATE_CASCADE when trying to change the length of of a
   VARBINARY column that refers to or is referenced by a BINARY
   column. BINARY columns are no longer padded on comparison,
   and thus they cannot be padded on storage either.
innobase/row/row0mysql.c:
  Changes from the innodb-5.0-ss115 snapshot.
   Fixed bug on unlock_row. In a unlock_row we may unlock
   only the latest lock granted to this transaction to the row.
innobase/row/row0sel.c:
  Changes from the innodb-5.0-ss115 snapshot.
   Fixed bug #15308.
   Fixed bug #14189: innobase_init(): Assert that
     DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
   After review fixes for unlock bug where unlock released all
     locks transaction requested for a row. Only a latest requested
     lock to a row should be released. Update function comments to
     reflect current state. Persistent cursor should be stored
     whenever select lock type != LOCK_NONE.
innobase/trx/trx0trx.c:
  Changes from the innodb-5.0-ss115 snapshot.
   trx_commit_off_kernel(): Do not write empty trx->mysql_log_file_name.
mysql-test/r/innodb.result:
  Changes from the innodb-5.0-ss115 snapshot.
mysql-test/t/innodb.test:
  Changes from the innodb-5.0-ss115 snapshot.
sql/ha_innodb.cc:
  Changes from the innodb-5.0-ss115 snapshot.
   Fixed bug #15308.
   Fixed bug #14189: innobase_init(): Assert that
     DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
   After review fixes for unlock bug where unlock released all
     locks transaction requested for a row. Only a latest requested
     lock to a row should be released. Update function comments to
     reflect current state. Persistent cursor should be stored
     whenever select lock type != LOCK_NONE.
mysql-test/r/innodb_unsafe_binlog.result:
  Changes from the innodb-5.0-ss115 snapshot.
mysql-test/t/innodb_unsafe_binlog-master.opt:
  Changes from the innodb-5.0-ss115 snapshot.
mysql-test/t/innodb_unsafe_binlog.test:
  Changes from the innodb-5.0-ss115 snapshot.
   Added testcases for bug #15650.
parent fe1970d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ Created 1/16/1996 Heikki Tuuri

extern ulint	data_mysql_default_charset_coll;
#define DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL 8
#define DATA_MYSQL_BINARY_CHARSET_COLL 63

/* SQL data type struct */
typedef struct dtype_struct		dtype_t;
@@ -311,7 +312,7 @@ dtype_get_pad_char(
/*===============*/
				/* out: padding character code, or
				ULINT_UNDEFINED if no padding specified */
	dtype_t*	type);	/* in: type */
	const dtype_t*	type);	/* in: type */
/***************************************************************************
Returns the size of a fixed size data type, 0 if not a fixed size type. */
UNIV_INLINE
+24 −15
Original line number Diff line number Diff line
@@ -188,27 +188,36 @@ dtype_get_pad_char(
/*===============*/
				/* out: padding character code, or
				ULINT_UNDEFINED if no padding specified */
	dtype_t*	type)	/* in: type */
	const dtype_t*	type)	/* in: type */
{
	if (type->mtype == DATA_CHAR
	    || type->mtype == DATA_VARCHAR
	    || type->mtype == DATA_BINARY
	    || type->mtype == DATA_FIXBINARY
	    || type->mtype == DATA_MYSQL
	    || type->mtype == DATA_VARMYSQL
	    || (type->mtype == DATA_BLOB
		&& (type->prtype & DATA_BINARY_TYPE) == 0)) {

	switch (type->mtype) {
	case DATA_FIXBINARY:
	case DATA_BINARY:
		if (UNIV_UNLIKELY(dtype_get_charset_coll(type->prtype)
		    == DATA_MYSQL_BINARY_CHARSET_COLL)) {
			/* Starting from 5.0.18, do not pad
			VARBINARY or BINARY columns. */
			return(ULINT_UNDEFINED);
		}
		/* Fall through */
	case DATA_CHAR:
	case DATA_VARCHAR:
	case DATA_MYSQL:
	case DATA_VARMYSQL:
		/* Space is the padding character for all char and binary
	        strings, and starting from 5.0.3, also for TEXT strings. */

		return((ulint)' ');
		return(0x20);
	case DATA_BLOB:
		if ((type->prtype & DATA_BINARY_TYPE) == 0) {
			return(0x20);
		}

		/* Fall through */
	default:
		/* No padding specified */

		return(ULINT_UNDEFINED);
	}
}

/**************************************************************************
Stores for a type the information which determines its alphabetical ordering
+12 −8
Original line number Diff line number Diff line
@@ -64,14 +64,6 @@ lock_clust_rec_some_has_impl(
	dict_index_t*	index,	/* in: clustered index */
	const ulint*	offsets);/* in: rec_get_offsets(rec, index) */
/*****************************************************************
Resets the lock bits for a single record. Releases transactions
waiting for lock requests here. */

void
lock_rec_reset_and_release_wait(
/*============================*/
	rec_t*	rec);	/* in: record whose locks bits should be reset */
/*****************************************************************
Makes a record to inherit the locks of another record as gap type
locks, but does not reset the lock bits of the other record. Also
waiting lock requests on rec are inherited as GRANTED gap locks. */
@@ -427,6 +419,18 @@ lock_is_on_table(
/*=============*/
				/* out: TRUE if there are lock(s) */
	dict_table_t*	table);	/* in: database table in dictionary cache */
/*****************************************************************
Removes a granted record lock of a transaction from the queue and grants
locks to other transactions waiting in the queue if they now are entitled
to a lock. */

void
lock_rec_unlock(
/*============*/
	trx_t*	trx,  		/* in: transaction that has set a record
				lock */
	rec_t*	rec,		/* in: record */
	ulint	lock_mode);	/* in: LOCK_S or LOCK_X */
/*************************************************************************
Releases a table lock.
Releases possible other transactions waiting for this lock. */
+3 −2
Original line number Diff line number Diff line
@@ -91,9 +91,10 @@ log. */
#define	OS_FILE_NOT_FOUND		71
#define	OS_FILE_DISK_FULL		72
#define	OS_FILE_ALREADY_EXISTS		73
#define OS_FILE_AIO_RESOURCES_RESERVED	74	/* wait for OS aio resources
#define	OS_FILE_PATH_ERROR		74
#define	OS_FILE_AIO_RESOURCES_RESERVED	75	/* wait for OS aio resources
						to become available again */
#define	OS_FILE_ERROR_NOT_SPECIFIED	75
#define	OS_FILE_ERROR_NOT_SPECIFIED	76

/* Types for aio operations */
#define OS_FILE_READ	10
+3 −2
Original line number Diff line number Diff line
@@ -250,7 +250,8 @@ trx_register_new_rec_lock() to store the information which new record locks
really were set. This function removes a newly set lock under prebuilt->pcur,
and also under prebuilt->clust_pcur. Currently, this is only used and tested
in the case of an UPDATE or a DELETE statement, where the row lock is of the
LOCK_X type.
LOCK_X or LOCK_S type. 

Thus, this implements a 'mini-rollback' that releases the latest record 
locks we set. */

Loading