Below is the list of changes that have just been committed into a local
5.1 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-10 20:01:58+05:00, svoj@april.(none) +3 -0
Merge mysql.com:/home/svoj/devel/mysql/BUG27998/mysql-5.0-engines
into mysql.com:/home/svoj/devel/mysql/BUG27998/mysql-5.1-engines
MERGE: 1.1810.2883.7
mysql-test/extra/binlog_tests/blackhole.test@stripped, 2007-05-10 20:01:55+05:00, svoj@april.(none) +2 -2
Manual merge.
MERGE: 1.4.7.2
mysql-test/extra/binlog_tests/blackhole.test@stripped, 2007-05-10 19:57:08+05:00, svoj@april.(none) +0 -0
Merge rename: mysql-test/t/blackhole.test -> mysql-test/extra/binlog_tests/blackhole.test
mysql-test/r/binlog_stm_blackhole.result@stripped, 2007-05-10 20:01:55+05:00, svoj@april.(none) +0 -1
Manual merge.
MERGE: 1.5.6.2
mysql-test/r/binlog_stm_blackhole.result@stripped, 2007-05-10 19:57:08+05:00, svoj@april.(none) +0 -0
Merge rename: mysql-test/r/blackhole.result -> mysql-test/r/binlog_stm_blackhole.result
storage/blackhole/ha_blackhole.h@stripped, 2007-05-10 20:01:14+05:00, svoj@april.(none) +0 -1
Use local.
MERGE: 1.5.3.2
storage/blackhole/ha_blackhole.h@stripped, 2007-05-10 19:57:08+05:00, svoj@april.(none) +0 -0
Merge rename: sql/ha_blackhole.h -> storage/blackhole/ha_blackhole.h
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: svoj
# Host: april.(none)
# Root: /home/svoj/devel/mysql/BUG27998/mysql-5.1-engines/RESYNC
--- 1.5.6.1/mysql-test/r/blackhole.result 2007-05-10 20:02:06 +05:00
+++ 1.20/mysql-test/r/binlog_stm_blackhole.result 2007-05-10 20:02:06 +05:00
@@ -70,8 +70,8 @@ a b
Only MyISAM tables support collections
Full-text indexes are called collections
explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 fulltext a a 0 1 Using where
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 fulltext a a 0 1 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against (_latin1'collections'))
select * from t1 where MATCH(a,b) AGAINST ("indexes");
@@ -104,28 +104,26 @@ select * from t2;
a
select * from t3;
a
-show binlog events;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; drop table t1,t2
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole
-master-bin.000001 # Query 1 # use `test`; delete from t1 where a=10
-master-bin.000001 # Query 1 # use `test`; update t1 set a=11 where a=15
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(1)
-master-bin.000001 # Query 1 # use `test`; insert ignore into t1 values(1)
-master-bin.000001 # Query 1 # use `test`; replace into t1 values(100)
-master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole
-master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
-master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
-master-bin.000001 # Query 1 # use `test`; alter table t1 add b int
-master-bin.000001 # Query 1 # use `test`; alter table t1 drop b
-master-bin.000001 # Query 1 # use `test`; create table t3 like t1
-master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3
-master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3
+master-bin.000001 # Query # # use `test`; drop table t1,t2
+master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
+master-bin.000001 # Query # # use `test`; delete from t1 where a=10
+master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15
+master-bin.000001 # Query # # use `test`; insert into t1 values(1)
+master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1)
+master-bin.000001 # Query # # use `test`; replace into t1 values(100)
+master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
+master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
+master-bin.000001 # Query # # use `test`; alter table t1 add b int
+master-bin.000001 # Query # # use `test`; alter table t1 drop b
+master-bin.000001 # Query # # use `test`; create table t3 like t1
+master-bin.000001 # Query # # use `test`; insert into t1 select * from t3
+master-bin.000001 # Query # # use `test`; replace into t1 select * from t3
drop table t1,t2,t3;
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
INSERT DELAYED INTO t1 VALUES(1);
-ERROR HY000: Table storage engine for 't1' doesn't have this option
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10;
@@ -138,3 +136,20 @@ ALTER TABLE t1 DROP INDEX a;
ALTER TABLE t1 ADD PRIMARY KEY(a);
DELETE FROM t1 WHERE a=10;
DROP TABLE t1;
+reset master;
+create table t1 (a int) engine=blackhole;
+set autocommit=0;
+start transaction;
+insert into t1 values(1);
+commit;
+start transaction;
+insert into t1 values(2);
+rollback;
+set autocommit=1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert into t1 values(1)
+master-bin.000001 # Query # # use `test`; COMMIT
+drop table if exists t1;
--- 1.4.7.1/mysql-test/t/blackhole.test 2007-05-10 20:02:06 +05:00
+++ 1.16/mysql-test/extra/binlog_tests/blackhole.test 2007-05-10 20:02:06 +05:00
@@ -121,10 +121,7 @@ select * from t2;
select * from t3;
let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-show binlog events;
-
+source include/show_binlog_events.inc;
drop table t1,t2,t3;
#
@@ -132,7 +129,6 @@ drop table t1,t2,t3;
# table
#
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
---error 1031
INSERT DELAYED INTO t1 VALUES(1);
DROP TABLE t1;
@@ -154,3 +150,21 @@ DELETE FROM t1 WHERE a=10;
DROP TABLE t1;
# End of 5.0 tests
+
+# Test that a transaction which is rolled back does not go into binlog
+# and that a transaction which is committed does
+
+reset master;
+create table t1 (a int) engine=blackhole;
+set autocommit=0;
+start transaction;
+insert into t1 values(1);
+commit;
+start transaction;
+insert into t1 values(2);
+rollback;
+set autocommit=1;
+source include/show_binlog_events.inc;
+drop table if exists t1;
+
+# End of 5.1 tests
--- 1.5.3.1/sql/ha_blackhole.h 2007-05-10 20:02:06 +05:00
+++ 1.16/storage/blackhole/ha_blackhole.h 2007-05-10 20:02:06 +05:00
@@ -18,16 +18,27 @@
#endif
/*
+ Shared structure for correct LOCK operation
+*/
+struct st_blackhole_share {
+ THR_LOCK lock;
+ uint use_count;
+ uint table_name_length;
+ char table_name[1];
+};
+
+
+/*
Class definition for the blackhole storage engine
"Dumbest named feature ever"
*/
class ha_blackhole: public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
- THR_LOCK thr_lock;
+ st_blackhole_share *share;
public:
- ha_blackhole(TABLE *table_arg);
+ ha_blackhole(handlerton *hton, TABLE_SHARE *table_arg);
~ha_blackhole()
{
}
@@ -39,15 +50,15 @@ public:
*/
const char *index_type(uint key_number);
const char **bas_ext() const;
- ulong table_flags() const
+ ulonglong table_flags() const
{
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
- HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
- HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME);
+ HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
+ HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED);
}
ulong index_flags(uint inx, uint part, bool all_parts) const
{
- return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
+ return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
HA_READ_ORDER | HA_KEYREAD_ONLY);
}
@@ -64,11 +75,11 @@ public:
int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
- int index_read(byte * buf, const byte * key,
- uint key_len, enum ha_rkey_function find_flag);
+ int index_read(byte * buf, const byte * key, key_part_map keypart_map,
+ enum ha_rkey_function find_flag);
int index_read_idx(byte * buf, uint idx, const byte * key,
- uint key_len, enum ha_rkey_function find_flag);
- int index_read_last(byte * buf, const byte * key, uint key_len);
+ key_part_map keypart_map, enum ha_rkey_function find_flag);
+ int index_read_last(byte * buf, const byte * key, key_part_map keypart_map);
int index_next(byte * buf);
int index_prev(byte * buf);
int index_first(byte * buf);
@@ -76,7 +87,6 @@ public:
void position(const byte *record);
int info(uint flag);
int external_lock(THD *thd, int lock_type);
- uint lock_count(void) const;
int create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd,
| Thread |
|---|
| • bk commit into 5.1 tree (svoj:1.2513) | Sergey Vojtovich | 10 May |