Hi!
>>>>> "Benjamin" == Benjamin Pflugmann <philemon@stripped> writes:
<cut>
Benjamin> Well, I see. I presumed that ha_myisammrg::write_row() shouldn't know
Benjamin> about the MYISAM handler (i.e. the mi_* functions) directly and also
Benjamin> didn't found any use of one in that place. But who am I to question
Benjamin> you? ;)
myisammrg is a merge handler just for MyISAM, so you can assume
that the underlying tables are MyISAM.
In the future we may do a another merge handler that can use any
table handler under it, but I don't think we have to concern us with
this today.
Benjamin> May I ask you to explain the scopes of the different sections a bit
Benjamin> more (files in .../myisammrg/ vs. ha_myisammrg.cc). What should go
Benjamin> where?
Benjamin> I understand, that ha_myisammrg is a table handler and should provide
Benjamin> the SQL server with an interface to an table type "library". I presume
Benjamin> that the files in /myisammrg should form an independend library for
Benjamin> handling table files of a certain type, as for what I know, the ISAM
Benjamin> type existed before and was integrated this way.
Benjamin> With that in mind I presumed that the inserting method belongs to the
Benjamin> underlying table library, not the handler.
See above. myisammrg stands for MERGE handler for MYISAM tables.
I suggested the above code just to give you an idea of how to do this
'easily'.
My opinion is that general things should be done in the myisammrg level.
I don't yet know if where-to-write should be specified on the
myisammrg or ha_myisammrg.cc level as this is something that is
special for merge tables.
One good solution would be to do this the following way:
add the function:
myrg_write(MYRG_INFO *file, char *record, enum_ha_write_place where_to_write)
to the myisammrg interface and then MySQL specify in
ha_myisammrg::write_row() the value of 'where_to_write' based on
either the SQL command or from information stored in the .frm file.
In other words, I don't think we have to specify a default where_to_write
file in the myisammrg handler but force the application to do this.
(This will make your job a lot easier)
Benjamin> And now... where is the fallacy?
Sorry ?
Regards,
Monty