Hello Ingo,
Perhaps I may be misreading the code in the fn_format()
function, but I don't believe always setting MY_REPLACE_EXT
would work. It looks like that function blindly looks for
the last occurrence of a period within in the file name.
If it finds one, and MY_APPEND_EXT is not given but
MY_REPLACE_EXT is, then it replaces whatever was after
the period with the extension. If the filename given were
`tbl.one`, then I think `tbl.one.MYI` would be renamed
`tbl.MYI` if we always specify MY_REPLACE_EXT. Someone
please correct me if I'm wrong as I'm sure someone knows
the code much better than I.
The code that I added was copied (and then slightly
modified) from a few lines above the change.
-Dave
On Fri, 2007-03-02 at 09:06 +0100, Ingo Strüwing wrote:
> Hi,
>
> Am Donnerstag, den 01.03.2007, 23:12 -0500 schrieb David Shrewsbury:
> > {
> > + char *iext= strrchr(name, '.');
> > + int have_iext= iext && !strcmp(iext, MI_NAME_IEXT);
> > fn_format(filename, name, "", MI_NAME_IEXT,
> > (MY_UNPACK_FILENAME |
> > (flags & HA_DONT_TOUCH_DATA) ? MY_RETURN_REAL_PATH : 0) |
> > - MY_APPEND_EXT);
> > + (have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT));
> > linkname_ptr=0;
>
> Wouldn't it be sufficient to always use MY_REPLACE_EXT? Doesn't it
> append the extension anyway if none exists?
>
> And shouldn't it be fixed in 5.0 too?
>
> Regards
> Ingo
> --
> Ingo Strüwing, Senior Software Developer
> MySQL GmbH, Radlkoferstr. 2, D-81373 München
> Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140
>
>