Commit d104671c authored by unknown's avatar unknown
Browse files

Merge marko@bk-internal.mysql.com:/home/bk/mysql-5.0

into hundin.mysql.fi:/home/marko/j/mysql-5.0

parents b0c677c2 264f83f0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -526,7 +526,7 @@ bits of a record. (Only compact records have status bits.) */
UNIV_INLINE
ulint
rec_get_info_and_status_bits(
/*==============*/
/*=========================*/
			/* out: info bits */
	rec_t*	rec,	/* in: physical record */
	ibool	comp)	/* in: TRUE=compact page format */
@@ -550,7 +550,7 @@ bits of a record. (Only compact records have status bits.) */
UNIV_INLINE
void
rec_set_info_and_status_bits(
/*==============*/
/*=========================*/
	rec_t*	rec,	/* in: physical record */
	ibool	comp,	/* in: TRUE=compact page format */
	ulint	bits)	/* in: info bits */
+3 −1
Original line number Diff line number Diff line
@@ -383,7 +383,9 @@ struct trx_struct{
	dulint		commit_lsn;	/* lsn at the time of the commit */
	ibool		dict_operation;	/* TRUE if the trx is used to create
					a table, create an index, or drop a
					table */
					table.  This is a hint that the table
					may need to be dropped in crash
					recovery. */
	dulint		table_id;	/* table id if the preceding field is
					TRUE */
	/*------------------------------*/
+0 −12
Original line number Diff line number Diff line
@@ -2561,17 +2561,6 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */
		goto funct_exit;
	}

	if (table->n_mysql_handles_opened > 1) {
		ut_print_timestamp(stderr);
fputs("	 InnoDB: Warning: MySQL is trying to truncate table ", stderr);
		ut_print_name(stderr, trx, table->name);
		fputs("\n"
"InnoDB: though there are still open handles to it.\n", stderr);
		err = DB_ERROR;

		goto funct_exit;
	}

	/* TODO: could we replace the counter n_foreign_key_checks_running
	with lock checks on the table? Acquire here an exclusive lock on the
	table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that
@@ -2594,7 +2583,6 @@ fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr);

	lock_reset_all_on_table(table);

	trx->dict_operation = TRUE;
	trx->table_id = table->id;

	/* scan SYS_INDEXES for all indexes of the table */
+3 −2
Original line number Diff line number Diff line
@@ -5787,11 +5787,12 @@ ha_innobase::store_lock(
	if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {

    		/* If we are not doing a LOCK TABLE or DISCARD/IMPORT
		TABLESPACE, then allow multiple writers */
		TABLESPACE or TRUNCATE TABLE, then allow multiple writers */

    		if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
	 	    lock_type <= TL_WRITE) && !thd->in_lock_tables
		    && !thd->tablespace_op) {
		    && !thd->tablespace_op
		    && thd->lex->sql_command != SQLCOM_TRUNCATE) {

      			lock_type = TL_WRITE_ALLOW_WRITE;
      		}