[mythtv-users] mysqlcheck buffers output?

Mike Thomas mt3 at pfw.demon.co.uk
Thu Oct 22 11:24:32 UTC 2015


On Wed, 21 Oct 2015 20:16:39 -0400
Tom Dexter <digitalaudiorock at gmail.com> wrote:
> I apologize because this a bit off topic...more related to mysql
> itself as apposed to my MythTV system, but I figured there might be
> someone here that's run into this or knows something about it:
> 
> I've noticed for years now that the mysqlcheck program inexplicably
> buffers it's output in a way where you can *never* truly know what
> table it's on without going into mysql separately and doing a show
> processlist.
> 
> For example, I've seen cases were one of the first tables in alpha
> order was a massive table that takes a long time to check, where it
> will output *nothing* at all, until it's several tables past that
> table.  It appears to be buffering the output, possibly in 1K blocks
> or the like.  If you were sending the output to a file for example,
> and the server happened to go down, you might not even have *any* way
> to know how far it got.
> 
> This is an *insane* manner for something that important to behave, and
> searching the web I see no mention of this.  I can't possibly be the
> only one whose ever noticed this.
> 
> Does anyone know if there's any way to prevent that buffering?  I sure
> can't find one.

Dear Mr. Dexter,

As far as I know mysqlcheck uses ordinary printf-style (or C++
equivalent) buffering. When it sees a \n it flushes the buffer. That is
certainly how my mysqlcheck behaves for me. This is normal for UNIX
programmes unless they go out of their way to change things.

I run

mysqlcheck [ options ] --analyze --all-databases

and other things from time to time. mysqlcheck's output pauses
immediately after

mythconverg.recordedrating                   Table is already up to date

before printing

mythconverg.recordedseek                     OK

My recordedseek table is very large indeed so I expect this behaviour.
Were mysqlcheck to crash during a table operation I would know which
table it was working on because the tables are processed in
alphabetical order.

If you are experiencing additional buffering this could be because you
are either sending the output through a pipe or file or have an
inconvenient line discipline.

Yours,

Mike.


More information about the mythtv-users mailing list