List:Internals« Previous MessageNext Message »
From:Benjamin Pflugmann Date:August 30 2001 4:06pm
Subject:Re: adding INSERT support to MERGE tables
View as plain text  
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.

Thread
adding INSERT support to MERGE tablesBenjamin Pflugmann17 Aug
  • Re: adding INSERT support to MERGE tablesSergei Golubchik17 Aug
    • Re: adding INSERT support to MERGE tablesMichael Widenius17 Aug
      • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann30 Aug
        • Re: adding INSERT support to MERGE tablesSergei Golubchik30 Aug
          • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann30 Aug
        • Re: adding INSERT support to MERGE tablesMichael Widenius30 Aug
          • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann30 Aug
            • Re: adding INSERT support to MERGE tablesMichael Widenius1 Sep
              • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann5 Sep
                • Re: adding INSERT support to MERGE tablesMichael Widenius6 Sep
                  • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann10 Sep
                    • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann11 Sep
                      • Re: adding INSERT support to MERGE tablesMichael Widenius12 Sep
                        • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann12 Sep
                          • Re: adding INSERT support to MERGE tablesMichael Widenius13 Sep
                            • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann18 Sep
                      • Re: adding INSERT support to MERGE tablesMichael Widenius22 Sep
                      • Re: adding INSERT support to MERGE tablesMichael Widenius24 Sep
                        • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann27 Sep
    • Re: adding INSERT support to MERGE tablesSergei Golubchik17 Aug
      • Re: adding INSERT support to MERGE tablesBenjamin Pflugmann17 Aug
      • Re: adding INSERT support to MERGE tablesMichael Widenius18 Aug
        • Re: adding INSERT support to MERGE tablesSergei Golubchik18 Aug
          • Re: adding INSERT support to MERGE tablesMichael Widenius20 Aug
RE: adding INSERT support to MERGE tablesThe Tilghman20 Aug