Commit a12b0b28 authored by unknown's avatar unknown
Browse files

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

into mysql.com:/home/bar/mysql-5.0

parents 52740354 e7eac027
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ hf@deer.(none)
hf@deer.mysql.r18.ru
hf@genie.(none)
igor@hundin.mysql.fi
igor@linux.local
igor@rurik.mysql.com
ingo@mysql.com
jan@hundin.mysql.fi
+14 −3
Original line number Diff line number Diff line
@@ -262,6 +262,20 @@ trx_free(
		putc('\n', stderr);
	}

	if (trx->n_mysql_tables_in_use != 0
	    || trx->mysql_n_tables_locked != 0) {

		ut_print_timestamp(stderr);
		fprintf(stderr,
"  InnoDB: Error: MySQL is freeing a thd\n"
"InnoDB: though trx->n_mysql_tables_in_use is %lu\n"
"InnoDB: and trx->mysql_n_tables_locked is %lu.\n",
			(ulong)trx->n_mysql_tables_in_use,
			(ulong)trx->mysql_n_tables_locked);

		trx_print(stderr, trx);		
	}

	ut_a(trx->magic_n == TRX_MAGIC_N);

	trx->magic_n = 11112222;
@@ -273,9 +287,6 @@ trx_free(
	ut_a(trx->insert_undo == NULL); 
	ut_a(trx->update_undo == NULL); 
	
	ut_a(trx->n_mysql_tables_in_use == 0);
	ut_a(trx->mysql_n_tables_locked == 0);
	
	if (trx->undo_no_arr) {
		trx_undo_arr_free(trx->undo_no_arr);
	}
+27 −7
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ Created 5/11/1994 Heikki Tuuri

#include "mem0mem.h"
#include "os0sync.h"
#include "os0thread.h"

/* This struct is placed first in every allocated memory block */
typedef struct ut_mem_block_struct ut_mem_block_t;
@@ -66,6 +67,7 @@ ut_malloc_low(
	ibool	assert_on_error) /* in: if TRUE, we crash mysqld if the memory
				cannot be allocated */
{
	ulint	retry_count	= 0;
	void*	ret;

	ut_ad((sizeof(ut_mem_block_t) % 8) == 0); /* check alignment ok */
@@ -73,24 +75,26 @@ ut_malloc_low(
	if (!ut_mem_block_list_inited) {
	        ut_mem_block_list_init();
	}

retry:
	os_fast_mutex_lock(&ut_list_mutex);

	ret = malloc(n + sizeof(ut_mem_block_t));

	if (ret == NULL) {
	if (ret == NULL && retry_count < 60) {
		if (retry_count == 0) {
			ut_print_timestamp(stderr);

			fprintf(stderr,
		"  InnoDB: Fatal error: cannot allocate %lu bytes of\n"
		"  InnoDB: Error: cannot allocate %lu bytes of\n"
		"InnoDB: memory with malloc! Total allocated memory\n"
		"InnoDB: by InnoDB %lu bytes. Operating system errno: %lu\n"
		"InnoDB: Cannot continue operation!\n"
		"InnoDB: Check if you should increase the swap file or\n"
		"InnoDB: ulimits of your operating system.\n"
		"InnoDB: On FreeBSD check you have compiled the OS with\n"
		"InnoDB: a big enough maximum process size.\n"
		"InnoDB: Note that in most 32-bit computers the process\n"
		"InnoDB: memory space is limited to 2 GB or 4 GB.\n",
		"InnoDB: We keep retrying the allocation for 60 seconds...\n",
		                  (ulong) n, (ulong) ut_total_allocated_memory,
#ifdef __WIN__
			(ulong) GetLastError()
@@ -98,7 +102,21 @@ ut_malloc_low(
			(ulong) errno
#endif
			);
		}

		os_fast_mutex_unlock(&ut_list_mutex);

		/* Sleep for a second and retry the allocation; maybe this is
		just a temporary shortage of memory */

		os_thread_sleep(1000000);
		
		retry_count++;

		goto retry;
	}

	if (ret == NULL) {
		/* Flush stderr to make more probable that the error
		message gets in the error file before we generate a seg
		fault */
@@ -113,6 +131,8 @@ ut_malloc_low(
		by graceful exit handling in ut_a(). */
#if (!defined __NETWARE__) 
		if (assert_on_error) {
			ut_print_timestamp(stderr);

			fprintf(stderr,
		"  InnoDB: We now intentionally generate a seg fault so that\n"
		"InnoDB: on Linux we get a stack trace.\n");
+2 −2
Original line number Diff line number Diff line
@@ -514,7 +514,7 @@ Variable_name Value
character_set_client	latin1
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
charset('a')	collation('a')	coercibility('a')	'a'='A'
latin1	latin1_swedish_ci	3	1
latin1	latin1_swedish_ci	4	1
explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
@@ -525,7 +525,7 @@ SHOW VARIABLES LIKE 'collation_client';
Variable_name	Value
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
charset('a')	collation('a')	coercibility('a')	'a'='A'
latin1	latin1_swedish_ci	3	1
latin1	latin1_swedish_ci	4	1
SET CHARACTER SET 'DEFAULT';
ERROR 42000: Unknown character set: 'DEFAULT'
DROP TABLE t1;
+25 −0
Original line number Diff line number Diff line
@@ -831,4 +831,29 @@ select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(va
id	stddev_pop(value1)	var_pop(value1)	stddev_samp(value1)	var_samp(value1)
1	0.816497	0.666667	1.000000	1.000000
2	1.118034	1.250000	1.290994	1.666667
CREATE TABLE t1(
id int PRIMARY KEY,
a  int,
b  int,
INDEX i_b_id(a,b,id),
INDEX i_id(a,id)
);
INSERT INTO t1 VALUES 
(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
MAX(id)
NULL
DROP TABLE t1;
CREATE TABLE t1(
id int PRIMARY KEY,
a  int,
b  int,
INDEX i_id(a,id),
INDEX i_b_id(a,b,id)
);
INSERT INTO t1 VALUES 
(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1);
SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
MAX(id)
NULL
DROP TABLE t1;
Loading