Hi.
On Thu, Aug 30, 2001 at 01:09:57PM +0300, you wrote
>
> >>>>> "Benjamin" == Benjamin Pflugmann <philemon@stripped>
> writes:
>
[...]
>
> Benjamin> I had expected this info to be kept in the same place as the info
> Benjamin> which tables are in the union, i.e. it would be passed to myrg_write()
> Benjamin> as an attribute of the struct MYRG_INFO.
>
> Benjamin> Is there any problem with this idea?
>
> No, but see below:
>
> Benjamin> This would mean that myrg_open() would have to read it somewhere and
> Benjamin> store it in the struct.
>
> One even simpler solution would be to not let myrg_write() handle this
> but instead do a direct call to the MyISAM file handler in the
> function: (in sql/ha_myisammrg.cc)
>
> int ha_myisammrg::write_row(byte * buf)
> {
> return (my_errno=HA_ERR_WRONG_COMMAND);
> }
>
> You could replace the above with something like:
>
> int ha_myisammrg::write_row(byte * buf)
> {
> if (table_to_write_to == HA_MERGE_WRITE_TO_FIRST)
> return mi_write(file->open_tables[0],buf);
> else /* HA_MERGE_WRITE_TO_LAST */
> return mi_write(file->open_tables[file->tables-1],buf);
> }
>
> (Am I helping you too much here ? :)
*grin*
Well, I see. I presumed that ha_myisammrg::write_row() shouldn't know
about the MYISAM handler (i.e. the mi_* functions) directly and also
didn't found any use of one in that place. But who am I to question
you? ;)
May I ask you to explain the scopes of the different sections a bit
more (files in .../myisammrg/ vs. ha_myisammrg.cc). What should go
where?
I understand, that ha_myisammrg is a table handler and should provide
the SQL server with an interface to an table type "library". I presume
that the files in /myisammrg should form an independend library for
handling table files of a certain type, as for what I know, the ISAM
type existed before and was integrated this way.
With that in mind I presumed that the inserting method belongs to the
underlying table library, not the handler.
And now... where is the fallacy?
Bye,
Benjamin.