Commit 10a6020e authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/my/mysql-4.1


libmysql/libmysql.c:
  Auto merged
parents b76fb15c 4ba94cc3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -44,12 +44,12 @@ do
  case $host_os in
    netware* | modesto*)
      echo "$i/errmsg.sys: $i/errmsg.txt
	\$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ \$^ $i/errmsg.sys" \
	\$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ $i/errmsg.txt $i/errmsg.sys" \
      >> $AVAILABLE_LANGUAGES_ERRORS_RULES
      ;;
    *)
  echo "$i/errmsg.sys: $i/errmsg.txt
	\$(top_builddir)/extra/comp_err -C\$(srcdir)/charsets/ \$^ $i/errmsg.sys" \
	\$(top_builddir)/extra/comp_err -C\$(srcdir)/charsets/ $i/errmsg.txt $i/errmsg.sys" \
    >> $AVAILABLE_LANGUAGES_ERRORS_RULES
      ;;
  esac
+3 −1
Original line number Diff line number Diff line
@@ -97,9 +97,11 @@ sync_arr_wake_threads_if_sema_free(void);
/**************************************************************************
Prints warnings of long semaphore waits to stderr. */

void
ibool
sync_array_print_long_waits(void);
/*=============================*/
			/* out: TRUE if fatal semaphore wait threshold
			was exceeded */
/************************************************************************
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
+16 −4
Original line number Diff line number Diff line
@@ -1820,7 +1820,8 @@ srv_error_monitor_thread(
			/* in: a dummy parameter required by
			os_thread_create */
{
	ulint	cnt	= 0;
	/* number of successive fatal timeouts observed */
	ulint	fatal_cnt	= 0;
	dulint	old_lsn;
	dulint	new_lsn;

@@ -1833,8 +1834,6 @@ srv_error_monitor_thread(
loop:
	srv_error_monitor_active = TRUE;

	cnt++;

	/* Try to track a strange bug reported by Harald Fuchs and others,
	where the lsn seems to decrease at times */

@@ -1861,7 +1860,20 @@ srv_error_monitor_thread(
		srv_refresh_innodb_monitor_stats();
	}

	sync_array_print_long_waits();
	if (sync_array_print_long_waits()) {
		fatal_cnt++;
		if (fatal_cnt > 5) {

			fprintf(stderr,
"InnoDB: Error: semaphore wait has lasted > %lu seconds\n"
"InnoDB: We intentionally crash the server, because it appears to be hung.\n",
				srv_fatal_semaphore_wait_threshold);

			ut_error;
		}
	} else {
		fatal_cnt = 0;
	}

	/* Flush stderr so that a database user gets the output
	to possible MySQL error file */
+7 −8
Original line number Diff line number Diff line
@@ -894,15 +894,18 @@ sync_arr_wake_threads_if_sema_free(void)
/**************************************************************************
Prints warnings of long semaphore waits to stderr. */

void
ibool
sync_array_print_long_waits(void)
/*=============================*/
			/* out: TRUE if fatal semaphore wait threshold
			was exceeded */
{
        sync_cell_t*   	cell;
        ibool		old_val;
	ibool		noticed = FALSE;
	ulint           i;
	ulint		fatal_timeout = srv_fatal_semaphore_wait_threshold;
	ibool		fatal = FALSE;

        for (i = 0; i < sync_primary_wait_array->n_cells; i++) {

@@ -919,13 +922,7 @@ sync_array_print_long_waits(void)
                if (cell->wait_object != NULL
		    && difftime(time(NULL), cell->reservation_time)
		    > fatal_timeout) {

			fprintf(stderr,
"InnoDB: Error: semaphore wait has lasted > %lu seconds\n"
"InnoDB: We intentionally crash the server, because it appears to be hung.\n",
				fatal_timeout);

		    	ut_error;
			fatal = TRUE;
                }
       	}

@@ -953,6 +950,8 @@ sync_array_print_long_waits(void)
		fprintf(stderr,
"InnoDB: ###### Diagnostic info printed to the standard error stream\n");
	}

	return(fatal);
}

/**************************************************************************
+18 −12
Original line number Diff line number Diff line
@@ -1258,7 +1258,7 @@ trx_undo_prev_version_build(
	ibool		dummy_extern;
	byte*		buf;
	ulint		err;
	ulint		i;

#ifdef UNIV_SYNC_DEBUG
	ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
#endif /* UNIV_SYNC_DEBUG */
@@ -1363,7 +1363,18 @@ trx_undo_prev_version_build(
	}

	if (row_upd_changes_field_size_or_external(rec, index, update)) {

		ulint*	ext_vect;
		ulint	n_ext_vect;

		/* We have to set the appropriate extern storage bits in the
		old version of the record: the extern bits in rec for those
		fields that update does NOT update, as well as the the bits for
		those fields that update updates to become externally stored
		fields. Store the info to ext_vect: */

		ext_vect = mem_alloc(sizeof(ulint) * rec_get_n_fields(rec));
		n_ext_vect = btr_push_update_extern_fields(ext_vect, rec,
								update);
		entry = row_rec_to_index_entry(ROW_COPY_DATA, index, rec,
								     heap);
		row_upd_index_replace_new_col_vals(entry, index, update, heap);
@@ -1371,6 +1382,11 @@ trx_undo_prev_version_build(
		buf = mem_heap_alloc(heap, rec_get_converted_size(entry));

		*old_vers = rec_convert_dtuple_to_rec(buf, entry);

		/* Now set the extern bits in the old version of the record */
		rec_set_field_extern_bits(*old_vers, ext_vect, n_ext_vect,
									NULL);
		mem_free(ext_vect);
	} else {
		buf = mem_heap_alloc(heap, rec_get_size(rec));

@@ -1379,15 +1395,5 @@ trx_undo_prev_version_build(
		row_upd_rec_in_place(*old_vers, update);
	}

	for (i = 0; i < upd_get_n_fields(update); i++) {

		if (upd_get_nth_field(update, i)->extern_storage) {

			rec_set_nth_field_extern_bit(*old_vers,
				upd_get_nth_field(update, i)->field_no,
				TRUE, NULL);
		}
	}

	return(DB_SUCCESS);
}
Loading