← Back to team overview

maria-developers team mailing list archive

Re: 9243921c84b: Make all #sql temporary table names uniform

 

Hi!

On Fri, 17 Apr 2020, 15:52 Marko Mäkelä, <marko.makela@xxxxxxxxxxx> wrote:

> Monty,
>
> On Thu, Apr 16, 2020 at 3:32 PM Michael Widenius
> <michael.widenius@xxxxxxxxx> wrote:
> > > > ALTER PARTITION shadow files:
> > > > #sql-shadow-'original_table_name'
> > >
> > > Please, add a thread_id here at the end. normally MDL should ensure
> that
> > > no two threads can have a shadow for the same table at the same time,
> > > but we have enough bugs as it is to introduce another vector when two
> > > threads can overwrite each other temp files.
> >
> > That would make the file name even longer and I am not sure what
> > happens if we table names goes much over
> >  NAME_LEN.  I don't have time just now to check for possible name
> > overruns (I think it should be save as most
> > engines are using FN_REFLEN, but better safe than sorry.
>
> FN_REFLEN limits the path name to only 511 or 512 bytes.
> When I started using GNU/Linux in 1993, the maximum path name length
> was 4095 or 4096 bytes. Already back then, extfs or xiafs or something
> supported up to 255 bytes per path name component (name in a
> directory).
>

I understand the problem, but not the suggested solution?
We can't just increase FN_REFLEN as it will increase stack and memory
usage.  And increasing it will not help when the filename part becomes too
long.
In reality this is more a theoretical (or hacker security problem) as long
table names are not common. Don't remember a single real bug report about
this.

Regards,
Monty

>

References