Commit 3dd07e1a authored by unknown's avatar unknown
Browse files

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

into mysql.com:/home/jonas/src/mysql-5.0

parents 6a2b9141 2ae812a7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -279,7 +279,15 @@ rec_get_next_offs(
		/* Note that for 64 KiB pages, field_value can 'wrap around'
		and the debug assertion is not valid */

		ut_ad((int16_t)field_value
		/* In the following assertion, field_value is interpreted
		as signed 16-bit integer in 2's complement arithmetics.
		If all platforms defined int16_t in the standard headers,
		the expression could be written simpler as
		(int16_t) field_value + ut_align_offset(...) < UNIV_PAGE_SIZE
		*/
		ut_ad((field_value >= 32768
			? field_value - 65536
			: field_value)
		       + ut_align_offset(rec, UNIV_PAGE_SIZE)
		      < UNIV_PAGE_SIZE);
#endif
+15 −0
Original line number Diff line number Diff line
@@ -225,6 +225,21 @@ trx_savepoint_for_mysql(
						position corresponding to this
						connection at the time of the
						savepoint */
						
/***********************************************************************
Releases a named savepoint. Savepoints which
were set after this savepoint are deleted. */

ulint
trx_release_savepoint_for_mysql(
/*================================*/
						/* out: if no savepoint
						of the name found then
						DB_NO_SAVEPOINT,
						otherwise DB_SUCCESS */
	trx_t*		trx,			/* in: transaction handle */
	const char*	savepoint_name);	/* in: savepoint name */

/***********************************************************************
Frees savepoint structs. */

+45 −0
Original line number Diff line number Diff line
@@ -316,6 +316,51 @@ trx_savepoint_for_mysql(
	return(DB_SUCCESS);
}

/***********************************************************************
Releases a named savepoint. Savepoints which
were set after this savepoint are deleted. */

ulint
trx_release_savepoint_for_mysql(
/*================================*/
						/* out: if no savepoint
						of the name found then
						DB_NO_SAVEPOINT,
						otherwise DB_SUCCESS */
	trx_t*		trx,			/* in: transaction handle */
	const char*	savepoint_name)		/* in: savepoint name */
{
	trx_named_savept_t*	savep;

	savep = UT_LIST_GET_FIRST(trx->trx_savepoints);

	while (savep != NULL) {
	        if (0 == ut_strcmp(savep->name, savepoint_name)) {
		        /* Found */
			break;
		}
	        savep = UT_LIST_GET_NEXT(trx_savepoints, savep);
	}

	if (savep == NULL) {	

	        return(DB_NO_SAVEPOINT);
	}

	/* We can now free all savepoints strictly later than this one */

	trx_roll_savepoints_free(trx, savep);
	
	/* Now we can free this savepoint too */

	UT_LIST_REMOVE(trx_savepoints, trx->trx_savepoints, savep);

	mem_free(savep->name);
	mem_free(savep);

	return(DB_SUCCESS);
}

/***********************************************************************
Returns a transaction savepoint taken at this point in time. */

+4 −4
Original line number Diff line number Diff line
@@ -371,11 +371,11 @@ alter table t0 add filler1 char(200), add filler2 char(200), add filler3 char(20
update t0 set key2=1, key3=1, key4=1, key5=1,key6=1,key7=1 where key7 < 500;
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) 
from t0 as A, t0 as B 
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
and (B.key1 = 1 and B.key2 = 1 and B.key3 = 1 and B.key4=1 and B.key5=1 and B.key6=1 and B.key7 = 1 or B.key8=1);
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7or16 = 1 or A.key8=1)
and (B.key1 = 1 and B.key2 = 1 and B.key3 = 1 and B.key4=1 and B.key5=1 and B.key6=1 and B.key7or16 = 1 or B.key8=1);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	A	index_merge	i1,i2,i3,i4,i5,i6,i7,i8	i2,i3,i4,i5,i6,i8	4,4,4,4,4,4	NULL	16	Using union(intersect(i2,i3,i4,i5,i6),i8); Using where
1	SIMPLE	B	index_merge	i1,i2,i3,i4,i5,i6,i7,i8	i2,i3,i4,i5,i6,i8	4,4,4,4,4,4	NULL	16	Using union(intersect(i2,i3,i4,i5,i6),i8); Using where
1	SIMPLE	A	index_merge	i1,i2,i3,i4,i5,i6,i7?,i8	i2,i3,i4,i5,i6,i7?,i8	X	NULL	7or16	Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
1	SIMPLE	B	index_merge	i1,i2,i3,i4,i5,i6,i7?,i8	i2,i3,i4,i5,i6,i7?,i8	X	NULL	7or16	Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5) 
from t0 as A, t0 as B 
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
+29 −5
Original line number Diff line number Diff line
@@ -249,6 +249,30 @@ n
4
5
6
set autocommit=0;
begin;
savepoint `my_savepoint`;
insert into t1 values (7);
savepoint `savept2`;
insert into t1 values (3);
select n from t1;
n
3
4
5
6
7
rollback to savepoint `savept2`;
release savepoint `my_savepoint`;
select n from t1;
n
4
5
6
7
rollback to savepoint `my_savepoint`;
ERROR HY000: Got error 153 during ROLLBACK
set autocommit=1;
rollback;
drop table t1;
create table t1 (n int not null primary key) engine=innodb;
@@ -1609,14 +1633,14 @@ t2 CREATE TABLE `t2` (
drop table t2, t1;
show status like "binlog_cache_use";
Variable_name	Value
Binlog_cache_use	24
Binlog_cache_use	25
show status like "binlog_cache_disk_use";
Variable_name	Value
Binlog_cache_disk_use	0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name	Value
Binlog_cache_use	25
Binlog_cache_use	26
show status like "binlog_cache_disk_use";
Variable_name	Value
Binlog_cache_disk_use	1
@@ -1625,7 +1649,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name	Value
Binlog_cache_use	26
Binlog_cache_use	27
show status like "binlog_cache_disk_use";
Variable_name	Value
Binlog_cache_disk_use	1
@@ -1693,10 +1717,10 @@ Variable_name Value
Innodb_rows_deleted	2070
show status like "Innodb_rows_inserted";
Variable_name	Value
Innodb_rows_inserted	31706
Innodb_rows_inserted	31708
show status like "Innodb_rows_read";
Variable_name	Value
Innodb_rows_read	80153
Innodb_rows_read	80162
show status like "Innodb_rows_updated";
Variable_name	Value
Innodb_rows_updated	29530
Loading