Commit 3df06e71 authored by vasil's avatar vasil

branches/zip:

Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826):

  ------------------------------------------------------------------------
  r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  branches/5.1:
  
  In ha_innobase::info():
  
  Replace sql_print_warning() which prints to mysqld error log with
  push_warning_printf() which sends the error message to the client.
  
  Suggested by:	Marko, Sunny, Michael
  Objected by:	Inaam
  
  ------------------------------------------------------------------------
  r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb-semi-consistent.result
     M /branches/5.1/mysql-test/innodb-semi-consistent.test
     M /branches/5.1/mysql-test/innodb.result
     M /branches/5.1/mysql-test/innodb.test
  
  branches/5.1:
  
  Merge a change from MySQL (this fixes the failing innodb and
  innodb-semi-consistent tests):
  
    revno: 2757
    committer: Georgi Kodinov <kgeorge@mysql.com>
    branch nick: B39812-5.1-5.1.29-rc
    timestamp: Fri 2008-10-03 15:24:19 +0300
    message:
      Bug #39812: Make statement replication default for 5.1 (to match 5.0)
      
      Make STMT replication default for 5.1.
      Add a default of MIXED into the config files
      Fix the tests that needed MIXED replication mode.
    modified:
      mysql-test/include/mix1.inc
      mysql-test/r/innodb-semi-consistent.result
      mysql-test/r/innodb.result
      mysql-test/r/innodb_mysql.result
      mysql-test/r/tx_isolation_func.result
      mysql-test/t/innodb-semi-consistent.test
      mysql-test/t/innodb.test
      mysql-test/t/tx_isolation_func.test
      sql/mysqld.cc
      support-files/my-huge.cnf.sh
      support-files/my-innodb-heavy-4G.cnf.sh
      support-files/my-large.cnf.sh
      support-files/my-medium.cnf.sh
      support-files/my-small.cnf.sh
  
  
  ------------------------------------------------------------------------
parent afef90be
...@@ -6915,12 +6915,21 @@ ha_innobase::info( ...@@ -6915,12 +6915,21 @@ ha_innobase::info(
ib_table->space) * 1024; ib_table->space) * 1024;
} else { } else {
sql_print_warning( THD* thd;
"Trying to get the free space for "
"table %s but its tablespace has " thd = ha_thd();
"been discarded or the .ibd file "
"is missing. Setting the free space " push_warning_printf(
"to zero.", ib_table->name); thd,
MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CANT_GET_STAT,
"InnoDB: Trying to get the free "
"space for table %s but its "
"tablespace has been discarded or "
"the .ibd file is missing. Setting "
"the free space to zero.",
ib_table->name);
stats.delete_length = 0; stats.delete_length = 0;
} }
......
drop table if exists t1; drop table if exists t1;
set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7); insert into t1 values (1),(2),(3),(4),(5),(6),(7);
...@@ -6,6 +7,7 @@ set autocommit=0; ...@@ -6,6 +7,7 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode; select * from t1 where a=3 lock in share mode;
a a
3 3
set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level read committed;
set autocommit=0; set autocommit=0;
update t1 set a=10 where a=5; update t1 set a=10 where a=5;
......
...@@ -10,6 +10,7 @@ drop table if exists t1; ...@@ -10,6 +10,7 @@ drop table if exists t1;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7); insert into t1 values (1),(2),(3),(4),(5),(6),(7);
...@@ -17,6 +18,7 @@ set autocommit=0; ...@@ -17,6 +18,7 @@ set autocommit=0;
# this should lock the entire table # this should lock the entire table
select * from t1 where a=3 lock in share mode; select * from t1 where a=3 lock in share mode;
connection b; connection b;
set binlog_format=mixed;
set session transaction isolation level read committed; set session transaction isolation level read committed;
set autocommit=0; set autocommit=0;
-- error ER_LOCK_WAIT_TIMEOUT -- error ER_LOCK_WAIT_TIMEOUT
......
...@@ -1024,6 +1024,7 @@ id code name ...@@ -1024,6 +1024,7 @@ id code name
4 2 Erik 4 2 Erik
5 3 Sasha 5 3 Sasha
COMMIT; COMMIT;
SET binlog_format='MIXED';
BEGIN; BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt'); insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
...@@ -2963,9 +2964,11 @@ drop table t1,t2; ...@@ -2963,9 +2964,11 @@ drop table t1,t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb; create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit; commit;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1; update t1 set b = 5 where b = 1;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select * from t1 where a = 7 and b = 3 for update; select * from t1 where a = 7 and b = 3 for update;
...@@ -3004,6 +3007,7 @@ d e ...@@ -3004,6 +3007,7 @@ d e
3 1 3 1
8 6 8 6
12 1 12 1
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2; insert into t1 select * from t2;
...@@ -3034,30 +3038,39 @@ a b ...@@ -3034,30 +3038,39 @@ a b
3 1 3 1
8 6 8 6
12 1 12 1
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
insert into t1 select * from t2; insert into t1 select * from t2;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
update t3 set b = (select b from t2 where a = d); update t3 set b = (select b from t2 where a = d);
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t5 (select * from t2 lock in share mode); insert into t5 (select * from t2 lock in share mode);
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t6 set e = (select b from t2 where a = d lock in share mode); update t6 set e = (select b from t2 where a = d lock in share mode);
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t8 (select * from t2 for update); insert into t8 (select * from t2 for update);
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t9 set e = (select b from t2 where a = d for update); update t9 set e = (select b from t2 where a = d for update);
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
...@@ -3205,6 +3218,7 @@ id ...@@ -3205,6 +3218,7 @@ id
-10 -10
1 1
DROP TABLE t1; DROP TABLE t1;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
...@@ -3215,6 +3229,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB; ...@@ -3215,6 +3229,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SELECT * FROM t2; SELECT * FROM t2;
a a
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -3222,10 +3237,12 @@ COMMIT; ...@@ -3222,10 +3237,12 @@ COMMIT;
SELECT * FROM t1 WHERE a=1; SELECT * FROM t1 WHERE a=1;
a a
1 1
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
SELECT * FROM t2; SELECT * FROM t2;
a a
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (2);
......
...@@ -701,6 +701,7 @@ insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha'); ...@@ -701,6 +701,7 @@ insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
select id, code, name from t1 order by id; select id, code, name from t1 order by id;
COMMIT; COMMIT;
SET binlog_format='MIXED';
BEGIN; BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt'); insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
...@@ -2001,10 +2002,12 @@ connection a; ...@@ -2001,10 +2002,12 @@ connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit; commit;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1; update t1 set b = 5 where b = 1;
connection b; connection b;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
# #
...@@ -2072,6 +2075,7 @@ commit; ...@@ -2072,6 +2075,7 @@ commit;
set autocommit = 0; set autocommit = 0;
select * from t2 for update; select * from t2 for update;
connection b; connection b;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t1 select * from t2; insert into t1 select * from t2;
...@@ -2128,46 +2132,55 @@ commit; ...@@ -2128,46 +2132,55 @@ commit;
set autocommit = 0; set autocommit = 0;
select * from t2 for update; select * from t2 for update;
connection b; connection b;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send --send
insert into t1 select * from t2; insert into t1 select * from t2;
connection c; connection c;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send --send
update t3 set b = (select b from t2 where a = d); update t3 set b = (select b from t2 where a = d);
connection d; connection d;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send --send
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
connection e; connection e;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send --send
insert into t5 (select * from t2 lock in share mode); insert into t5 (select * from t2 lock in share mode);
connection f; connection f;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send --send
update t6 set e = (select b from t2 where a = d lock in share mode); update t6 set e = (select b from t2 where a = d lock in share mode);
connection g; connection g;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send --send
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
connection h; connection h;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send --send
insert into t8 (select * from t2 for update); insert into t8 (select * from t2 for update);
connection i; connection i;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send --send
update t9 set e = (select b from t2 where a = d for update); update t9 set e = (select b from t2 where a = d for update);
connection j; connection j;
SET binlog_format='MIXED';
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send --send
...@@ -2382,6 +2395,7 @@ DROP TABLE t1; ...@@ -2382,6 +2395,7 @@ DROP TABLE t1;
CONNECT (c1,localhost,root,,); CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,); CONNECT (c2,localhost,root,,);
CONNECTION c1; CONNECTION c1;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
...@@ -2389,6 +2403,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB; ...@@ -2389,6 +2403,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SELECT * FROM t2; SELECT * FROM t2;
CONNECTION c2; CONNECTION c2;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -2400,10 +2415,12 @@ DISCONNECT c2; ...@@ -2400,10 +2415,12 @@ DISCONNECT c2;
CONNECT (c1,localhost,root,,); CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,); CONNECT (c2,localhost,root,,);
CONNECTION c1; CONNECTION c1;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
SELECT * FROM t2; SELECT * FROM t2;
CONNECTION c2; CONNECTION c2;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed'; SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (2);
......
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