From: scut_tang Date: July 28 2009 7:44am Subject: Some questions about table->read_set and table->write_set List-Archive: http://lists.mysql.com/soc/427 Message-Id: <3657453.812511248767040059.JavaMail.coremail@bj126app27.126.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_215735_22618064.1248767040058" ------=_Part_215735_22618064.1248767040058 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Hi, Sergei In my mind, table->read_set and table->write_set correspond to read and write a table. For example: CREATE TABLE t1 (id INT, name CHAR(10), sex CHAR(10)); INSERT INTO t1(id, sex) VALUES(1, "Man"); write_set will be 5 (00...00101). SELECT id, name, sex FROM t1; read_set will be 7 (00...00111). In other words, they mark which fields would be read and written. But in "SELECT id, name, sex FROM t1;", storage engine will put some data into table->field[...] (table->record[0]) by table->field[...]->store(). In field->store(), there is a assertion. However, the assertion is to test write_set, instead of read_set. Why? In my mind, write_set works in INSERT, and read_set works in SELECT. Or, they have other useful? Regards, Robin ------=_Part_215735_22618064.1248767040058--