Three wishes for a new year

September 27, 2011

It's another new year by Jewish calendar. And what do I wish for in the following year?

  1. World peace
  2. Good health to all
  3. Have some way to turn SHOW commands into SELECT statements, server side. I'm fervently trying to hack around this. Stored routines, export/import from file, text manipulation, I don't care! I want to SELECT seconds_behind_master somehow. Without plugins.

PS, none of my last year's wishes came true. I'll settle for two out of three.

tags:
posted in MySQL by shlomi

« | »

Follow comments via the RSS Feed | Leave a comment | Trackback URL

10 Comments to "Three wishes for a new year"

  1. Jim Agnew wrote:

    Dear Shlomi, I finally did a Perl solution that is quite an awful hack, but it works... Interested?

  2. shlomi wrote:

    @Jim,
    Thanks, however I'm looking for a server side solution: from within the mysql server itself. Or have you managed to somehow invoke perl from the server?
    I don't mind the least about ugly solutions. Anything can be wrapped to present well.

  3. Cyril wrote:

    Happy New Year !
    שנה טובה !

    Hope this will be a great new year for all dba :)

  4. Matthew Montgomery wrote:

    You mean you want https://launchpad.net/is-replication-status included in mainline.

  5. shlomi wrote:

    Yes, but automatically, and for ANY "show" command.
    I'm aware of this why-didn't-they-think-of-this plugin, have wondered why this was not imported into the baseline...

  6. Robert Hodges wrote:

    Hi Shlomi! Happy new year. Why don't you just switch to Tungsten? Then you can select the seconds behind as follows:

    select applied_latency as "seconds behind" from trep_commit_seqno

  7. shlomi wrote:

    @Robert,
    Cool!
    But this is beyond seconds_behind_master. I want to bypass I_S by using SHOW DATABASES, or SHOW CREATE TABLE etc.

  8. Robert Hodges wrote:

    @Shlomi. Aw, I was just trying to be helpful! :) However, I see what you mean. This seems to be another case of the "SQL is not quite a real language" problem.

  9. shlomi wrote:

    @Robert,
    Guilty as charged. Although I'm not trying to build a Python interpreter in SQL, I am trying to provide some handy syntax for complex operations.

  10. shlomi wrote:

    YES!
    I have found a magnificent way of reading results of (some) SHOW commands on server side. Unfortunately, the solution is too large to be contained in this comment.

    Alas, it does not include SHOW SLAVE STATUS, SHOW MASTER STATUS and the like.
    I will publish separately.
    (this is not a joke)

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by openark.org