Commit 7136f9b6 authored by monty@bitch.mysql.fi's avatar monty@bitch.mysql.fi
Browse files

Merge hundin:/my/mysql-4.0 into bitch.mysql.fi:/my/mysql-4.0

parents 5e8d60bb 0c0a170f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"

extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-embedded-server"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-embedded-server --with-openssl"

. "$path/FINISH.sh"
+7 −0
Original line number Diff line number Diff line
@@ -18274,6 +18274,7 @@ The status variables listed above have the following meaning:
@item @code{Aborted_connects} @tab Number of tries to connect to the MySQL server that failed. @xref{Communication errors}.
@item @code{Bytes_received} @tab Number of bytes received from all clients.
@item @code{Bytes_sent} @tab Number of bytes sent to all clients.
@item @code{Com_xxxx} @tab Number of times the xxx commands has been executed.
@item @code{Connections} @tab Number of connection attempts to the MySQL server.
@item @code{Created_tmp_disk_tables} @tab Number of implicit temporary tables on disk created while executing statements.
@item @code{Created_tmp_tables} @tab Number of implicit temporary tables in memory created while executing statements.
@@ -22818,6 +22819,7 @@ snapshot.
listing of slaves currently registered with the master (Master)
@item @code{SHOW SLAVE STATUS} @tab Provides status information on essential parameters of the slave thread. (Slave)
@item @code{SHOW MASTER LOGS} @tab Only available starting in Version
3.23.28. Lists the binary logs on the master. You should use this
command prior to @code{PURGE MASTER LOGS TO} to find out how far you
@@ -47199,6 +47201,11 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.47
@itemize @bullet
@item
Added statistics variables for all MySQL commands. (@code{SHOW STATUS} is
now much longer).
@item
Fix default values for InnoDB tables.
@item
Fixed that @code{GROUP BY expr DESC} works.
@item
Fixed bug when using @code{t1 LEFT JOIN t2 ON t2.key=constant}.
+65 −2
Original line number Diff line number Diff line
@@ -85,6 +85,15 @@ btr_rec_free_updated_extern_fields(
				inherited fields */
	mtr_t*		mtr);	/* in: mini-transaction handle which contains
				an X-latch to record page and to the tree */
/***************************************************************
Gets the externally stored size of a record, in units of a database page. */
static
ulint
btr_rec_get_externally_stored_len(
/*==============================*/
			/* out: externally stored part, in units of a
			database page */
	rec_t*	rec);	/* in: record */

/*==================== B-TREE SEARCH =========================*/
	
@@ -2540,6 +2549,7 @@ btr_estimate_number_of_different_key_vals(
	ulint		matched_bytes;
	ulint*		n_diff;
	ulint		not_empty_flag	= 0;
	ulint		total_external_size = 0;
	ulint		i;
	ulint		j;
	mtr_t		mtr;
@@ -2587,9 +2597,14 @@ btr_estimate_number_of_different_key_vals(
				n_diff[j]++;
			}

			total_external_size +=
				btr_rec_get_externally_stored_len(rec);
			
			rec = page_rec_get_next(rec);
		}
		
		total_external_size +=
				btr_rec_get_externally_stored_len(rec);
		mtr_commit(&mtr);
	}

@@ -2597,12 +2612,18 @@ btr_estimate_number_of_different_key_vals(
	BTR_KEY_VAL_ESTIMATE_N_PAGES leaf pages, we can estimate how many
	there will be in index->stat_n_leaf_pages */
	
	/* We must take into account that our sample actually represents
	also the pages used for external storage of fields (those pages are
	included in index->stat_n_leaf_pages) */ 

	for (j = 0; j <= n_cols; j++) {
		index->stat_n_diff_key_vals[j] =
				(n_diff[j] * index->stat_n_leaf_pages
				 + BTR_KEY_VAL_ESTIMATE_N_PAGES - 1
				 + total_external_size
				 + not_empty_flag)
		                	/ BTR_KEY_VAL_ESTIMATE_N_PAGES;
		                	/ (BTR_KEY_VAL_ESTIMATE_N_PAGES
		                	   + total_external_size);
	}
	
	mem_free(n_diff);
@@ -2610,6 +2631,48 @@ btr_estimate_number_of_different_key_vals(

/*================== EXTERNAL STORAGE OF BIG FIELDS ===================*/

/***************************************************************
Gets the externally stored size of a record, in units of a database page. */
static
ulint
btr_rec_get_externally_stored_len(
/*==============================*/
			/* out: externally stored part, in units of a
			database page */
	rec_t*	rec)	/* in: record */
{
	ulint	n_fields;
	byte*	data;
	ulint	local_len;
	ulint	extern_len;
	ulint	total_extern_len = 0;
	ulint	i;

	if (rec_get_data_size(rec) <= REC_1BYTE_OFFS_LIMIT) {

		return(0);
	}
	
	n_fields = rec_get_n_fields(rec);

	for (i = 0; i < n_fields; i++) {
		if (rec_get_nth_field_extern_bit(rec, i)) {

			data = rec_get_nth_field(rec, i, &local_len);

			local_len -= BTR_EXTERN_FIELD_REF_SIZE;
	
			extern_len = mach_read_from_4(data + local_len
						+ BTR_EXTERN_LEN + 4);

			total_extern_len += ut_calc_align(extern_len,
							UNIV_PAGE_SIZE);
		}
	}

	return(total_extern_len / UNIV_PAGE_SIZE);
}

/***********************************************************************
Sets the ownership bit of an externally stored field in a record. */
static
+11 −3
Original line number Diff line number Diff line
@@ -1765,9 +1765,8 @@ dict_scan_col(
		col = dict_table_get_nth_col(table, i);

		if (ut_strlen(col->name) == (ulint)(ptr - old_ptr)
		    && 0 == ut_memcmp(col->name, old_ptr,
		    && 0 == ut_cmp_in_lower_case(col->name, old_ptr,
						(ulint)(ptr - old_ptr))) {

		    	/* Found */

		    	*success = TRUE;
@@ -1831,11 +1830,20 @@ dict_scan_table_name(
				break;
			}
		}

#ifdef __WIN__
		ut_cpy_in_lower_case(second_table_name + i, old_ptr,
				     ptr - old_ptr);
#else
		ut_memcpy(second_table_name + i, old_ptr, ptr - old_ptr);
#endif
		second_table_name[i + (ptr - old_ptr)] = '\0';
	} else {
#ifdef __WIN__
		ut_cpy_in_lower_case(second_table_name, old_ptr,
				     ptr - old_ptr);
#else
		ut_memcpy(second_table_name, old_ptr, ptr - old_ptr);
#endif
		second_table_name[dot_ptr - old_ptr] = '/';
		second_table_name[ptr - old_ptr] = '\0';
	}
+20 −0
Original line number Diff line number Diff line
@@ -220,6 +220,26 @@ ut_bit_set_nth(
	ulint	a,	/* in: ulint */
	ulint	n,	/* in: nth bit requested */
	ibool	val);	/* in: value for the bit to set */
/****************************************************************
Copies a string to a memory location, setting characters to lower case. */

void
ut_cpy_in_lower_case(
/*=================*/
        char*   dest,    /* in: destination */
	char*   source,  /* in: source */
        ulint   len);     /* in: string length */
/****************************************************************
Compares two strings when converted to lower case. */

int
ut_cmp_in_lower_case(
/*=================*/
		        /* out: -1, 0, 1 if str1 < str2, str1 == str2,
			str1 > str2, respectively */
       char*   str1,    /* in: string1 */
       char*   str2,    /* in: string2 */
       ulint   len);     /* in: length of both strings */


#ifndef UNIV_NONINL
Loading