Hi!
On Oct 28, Andrei Elkin wrote:
> Sergei, good morning.
>
> > The idea was to prepend mysql_real_data_home if a path is not
> > absolute. That is, purely string concatenation.
>
> Please see below.
>
> > fn_format with MY_RETURN_REAL_PATH calls realpath() which in fact
> > walks your path and resolves symlinks. E.g. if the path is
> > /usr/local/mysql-5.0/var/mysql-log.bin, but /usr/local/mysql-5.0 is
> > a symlink to /home/aelkin/devel/mysql-5.0 and /home is a symlink to
> > /usr/home, then the path will be changed to
> > /usr/home/aelkin/devel/mysql-5.0
> >
> > I meant that it's an overkill, we don't need it, it's enough to add
> > mysql_real_data_home if the path it relative. We have a function to do
> > it.
>
> As I get the last paragraph, MY_RETURN_REAL_PATH should be a necessary
> option for `fn_format' and its invocation is unavoidable, right?
>
> I am asking because you are saying "purely string concatenation".
> That's not always true.
> `mysql_real_data_home' is generally not a canonical absolute path in
> that it can constist of `..' tokens - like in this example -
>
> (gdb) p mysql_real_data_home
>
> /home/elkin/MySQL/TEAM/FIXES/5.0/bug28597/sql/../mysql-test/var/master-data/
>
> and then its *string* concatanation with a name of the binlog file
> would produce an absolute non-canonical path still be different as the
> string from an equal absolute canonical path in the binlog index.
>
> So fn_format(..., MY_RETURN_REAL_PATH) canonizes more to converting to
> absolute.
> It's not an overkill.
You can do it with cleanup_dirname()
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Dachauer Str. 37, D-80335 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140