Commit cd51e622 authored by marko's avatar marko

Revert the changes that were reverted in r2144 to get a source tree that

is an exact match of a MySQL BitKeeper tree.

Apply r2116:
------------------------------------------------------------------------
r2116 | vasil | 2007-11-23 19:10:17 +0200 (pe, 23 marras 2007) | 6 lines

Set trx->mysql_query_str to NULL at transaction commit.
It could be a problem if someone looks at it after that because MySQL may
have free()d it then.

Approved by:    Heikki (via IM)
------------------------------------------------------------------------

innodb.test, innodb.result:
Add some tests that were apparently accidentally removed in
ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god
Apply snapshot innodb-5.1-ss1989

ha_innodb.cc: Add a decorative comment.
parent 39d58ce4
...@@ -7246,6 +7246,7 @@ On return if there is no error then the tables AUTOINC lock is locked.*/ ...@@ -7246,6 +7246,7 @@ On return if there is no error then the tables AUTOINC lock is locked.*/
ulong ulong
ha_innobase::innobase_get_auto_increment( ha_innobase::innobase_get_auto_increment(
/*=====================================*/
ulonglong* value) /* out: autoinc value */ ulonglong* value) /* out: autoinc value */
{ {
ulong error; ulong error;
......
...@@ -472,6 +472,44 @@ a b ...@@ -472,6 +472,44 @@ a b
3 3 3 3
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
ggid varchar(32) binary DEFAULT '' NOT NULL,
email varchar(64) DEFAULT '' NOT NULL,
passwd varchar(32) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE ggid (ggid)
) ENGINE=innodb;
set global innodb_autoinc_lock_mode = 0;
insert into t1 (ggid,passwd) values ('test1','xxx');
insert into t1 (ggid,passwd) values ('test2','yyy');
insert into t1 (ggid,passwd) values ('test2','this will fail');
ERROR 23000: Duplicate entry 'test2' for key 'ggid'
insert into t1 (ggid,id) values ('this will fail',1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select * from t1 where ggid='test1';
id ggid email passwd
1 test1 xxx
select * from t1 where passwd='xxx';
id ggid email passwd
1 test1 xxx
select * from t1 where id=2;
id ggid email passwd
2 test2 yyy
replace into t1 (ggid,id) values ('this will work',1);
replace into t1 (ggid,passwd) values ('test2','this will work');
update t1 set id=100,ggid='test2' where id=1;
ERROR 23000: Duplicate entry 'test2' for key 'ggid'
select * from t1;
id ggid email passwd
1 this will work
3 test2 this will work
select * from t1 where id=1;
id ggid email passwd
1 this will work
select * from t1 where id=999;
id ggid email passwd
drop table t1;
CREATE TABLE t1 (
user_name varchar(12), user_name varchar(12),
password text, password text,
subscribed char(1), subscribed char(1),
...@@ -1714,13 +1752,13 @@ Variable_name Value ...@@ -1714,13 +1752,13 @@ Variable_name Value
Innodb_page_size 16384 Innodb_page_size 16384
show status like "Innodb_rows_deleted"; show status like "Innodb_rows_deleted";
Variable_name Value Variable_name Value
Innodb_rows_deleted 69 Innodb_rows_deleted 70
show status like "Innodb_rows_inserted"; show status like "Innodb_rows_inserted";
Variable_name Value Variable_name Value
Innodb_rows_inserted 1080 Innodb_rows_inserted 1083
show status like "Innodb_rows_updated"; show status like "Innodb_rows_updated";
Variable_name Value Variable_name Value
Innodb_rows_updated 885 Innodb_rows_updated 886
show status like "Innodb_row_lock_waits"; show status like "Innodb_row_lock_waits";
Variable_name Value Variable_name Value
Innodb_row_lock_waits 0 Innodb_row_lock_waits 0
......
...@@ -326,6 +326,42 @@ select * from t1; ...@@ -326,6 +326,42 @@ select * from t1;
select * from t2; select * from t2;
drop table t1,t2; drop table t1,t2;
#
# Search on unique key
#
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
ggid varchar(32) binary DEFAULT '' NOT NULL,
email varchar(64) DEFAULT '' NOT NULL,
passwd varchar(32) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE ggid (ggid)
) ENGINE=innodb;
# Set to old style locking
set global innodb_autoinc_lock_mode = 0;
insert into t1 (ggid,passwd) values ('test1','xxx');
insert into t1 (ggid,passwd) values ('test2','yyy');
-- error ER_DUP_ENTRY
insert into t1 (ggid,passwd) values ('test2','this will fail');
-- error ER_DUP_ENTRY
insert into t1 (ggid,id) values ('this will fail',1);
select * from t1 where ggid='test1';
select * from t1 where passwd='xxx';
select * from t1 where id=2;
replace into t1 (ggid,id) values ('this will work',1);
replace into t1 (ggid,passwd) values ('test2','this will work');
-- error ER_DUP_ENTRY
update t1 set id=100,ggid='test2' where id=1;
select * from t1;
select * from t1 where id=1;
select * from t1 where id=999;
drop table t1;
# #
# ORDER BY on not primary key # ORDER BY on not primary key
# #
......
...@@ -933,6 +933,7 @@ trx_commit_off_kernel( ...@@ -933,6 +933,7 @@ trx_commit_off_kernel(
trx->rseg = NULL; trx->rseg = NULL;
trx->undo_no = ut_dulint_zero; trx->undo_no = ut_dulint_zero;
trx->last_sql_stat_start.least_undo_no = ut_dulint_zero; trx->last_sql_stat_start.least_undo_no = ut_dulint_zero;
trx->mysql_query_str = NULL;
ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0); ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0);
ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0); ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment