maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #10873
Re: ha_innobase::info_low() n_rows hack
Hi, Aleksey!
On Sep 11, Aleksey Midenkov wrote:
> On Mon, Sep 11, 2017 at 4:37 PM, Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
> > Hi, Aleksey!
> >
> > On Sep 11, Aleksey Midenkov wrote:
> >> In ha_innobase::info_low() there is following dirty hack:
> >>
> >> if (n_rows == 0 && !(flag & HA_STATUS_TIME)) {
> >> n_rows++;
> >> }
> >>
> >> It is very old (from 5.0 or earlier) and bug-prone. Because in
> >> ha_innobase::open():
> >>
> >> info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
> >>
> >> every opened empty table will be non-empty!
> >
> > Is that a problem?
>
> Don't you find it at least misleading? ha_innobase::open() is
> exclusive (process-wide) operation and it lies about non-empty table.
ha_innobase::open() is not the only place where the ::info() method is
called.
I'd say that it'd be correct to return n_rows == 0 if the table is locked.
Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx
References