List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:September 6 2001 4:50am
Subject:Re: adding INSERT support to MERGE tables
View as plain text  
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
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