Hi!
>>>>> "Benjamin" == Benjamin Pflugmann <philemon@stripped> writes:
<cut>
Benjamin> Meanwhile, I have a running version where /myisammrg/ handles all the
Benjamin> magic and where_to_write is passed via the MYRG_INFO structure.
Benjamin> Mainly, because I did not know where to place the info in the .frm
Benjamin> file, so I placed it in the .MRG file, like this:
Benjamin> #INSERT_METHOD=FIRST
Benjamin> So it's a comment and wouldn't disturb older versions.
Benjamin> However I would like it to rewrite it to use the .frm file and just
Benjamin> need a pointer where to place the information. I think this is in
Benjamin> sql/table.cc:openfrm() and create_frm() just like e.g. raid_type?
Yes, this is right.
You are free to reserve the byte 39 in the form file for this:
In openfrm()
fileinfo[39]= create_info->insert_method;.
Benjamin> I have another problem. My implementation works fine and passes all
Benjamin> existing tests. But it fails on the following test with ALTER TABLE:
Benjamin> alter table t2 INSERT_METHOD=LAST;
Benjamin> show create table t2;
Benjamin> insert into t1 values (1,2);
Benjamin> insert into t2 values (2,2);
Benjamin> select * from t2;
Benjamin> select * from t1;
Benjamin> flush table t1;
Benjamin> select * from t1;
Benjamin> "select * from t1" shows one row missing and after the flush table, it
Benjamin> magically appears. A blind guess would be some problem with obsolete
Benjamin> caches, but I don't have a clue where to start to look.
Benjamin> I would be glad for any pointer how to resolve this. If you need to
Benjamin> see the patches for this, please tell so. I didn't include them, as I
Benjamin> didn't found time yet to make a clean diff.
Benjamin> And here the complete test with results:
<cut>
Thanks for the clear problem description.
It looks like that when you are accessing the t2 table after the ALTER
TABLE MySQL is using it's own MyISAM file descriptor to t1.
(This is something that should never happen).
It could be that when MySQL marks the handler file as
'old'-cant-be-used anymore it also marks the 't1' file as such, but
doesn't close it properly.
If you can create a patch for what you have done I could investigate
this on the weekend.
If you want to do this yourself; Run mysqld with --debug and check in
the trace log the file numbers that are used within the MyISAM
library...
Regards,
Monty