MySQL Workbench 6.0: Help is on the way…

August 13, 2013 – 10:10 am by Mike Lischke

Do you know this scenario: you are writing down  a stored procedure but you can’t for the life of you remember the exact syntax of that CASE statement? Has it to end with CASE or not? Can I use more than one WHEN part and how should that be written? Usually you end up opening a web page and read through the excellent MySQL online docs. However, this might cost too much time if you quickly need different statements and other detail info. Here’s where MySQL Workbench’s context help jumps in.

The server can help

It’s probably only known to the die-hard terminal operators who write most of their SQL queries in a MySQL console window: the MySQL server already has a stripped down set of help topics produced by the Docs team. That means you can always get at least the syntax but often far more information for a particular syntax element when you work with a server. When you install a MySQL server it usually comes with loaded help tables. For those experimenting with pre-releases of the server you can download scripts to fill your help tables.

MySQL Workbench makes use of this little gem. The query at the current caret position is examined to find a help topic. If one could be found it is shown in the Context Help side bar.

WB Screenshot (Windows) SQL Editor Context Help

But wait, isn’t the output of the help topic in the command line client rather simple? Yes, that’s how it looks:

WB Screenshot (Windows) Help in the command line client

But it still is the same data as shown in the sidebar. With some reformatting MySQL Workbench presents a much better readable version of that text. And not only that. URLs are displayed as clickable links. Selecting a link to another topic simply switches to that in the sidebar. External documentation is shown in a separate browser tab. So what you actually get is both: the quick lookup while typing and direct access to the online help with the extended info for that topic. This will often save you from doing an explicit online search. Pretty cool, hu? But there’s more.

To the point

Writing a complex query can easily cover 2-3 pages and when you’re down in that dreaded JOIN part you certainly don’t want the help for the SELECT statement. And MySQL Workbench can deliver that. It looks at the word at the current caret position (math operators qualify too) and if that doesn’t have a topic to show the next inner part is examined (e.g. a subselect or a JOIN). So you get help as close as possible for your current work position.

 

WB Screenshot (Windows) SQL Editor Context Help with inner part

Determining a topic is complicated, especially if your query is in a half finished state, so it might not always give you the wanted info, however. But we will improve that feature over time.

Mike Lischke

  1. 6 Responses to “MySQL Workbench 6.0: Help is on the way…”

  2. Hello,
    unfortunetley this context help feature does not work in my mysql workbench, version 6.0.7. It permanently is showing “No Context Help” anytime I select a keyword. Does anyone know how to fix this? Thanks a lot!

    By Mark on Oct 13, 2013

  3. Is the query you’re writing valid? Please file a bug report at http://bugs.mysql.com if it looks like it may be a bug.

    By akojima on Nov 7, 2013

  4. Mark, I believe the behavior you’re seeing may be because the help tables are not installed in your server, probably to save space. I have Workbench 6.0.8 connected both to a live production server and a minimal test/development XAMPP installation running on a USB drive that I use for teaching. I get help when in a query window for the live server, but not in XAMPP.

    I downloaded the correct help tables sql scrip (see the link near the top of this post) and opened it in Workbench while connected as root to the server on which I was getting the “No Context Help” message. The mysql database is hidden, so I inserted a “use mysql;” statement at the top of the script. Also had to disable safe mode and reconnect because of the “delete from help_topic;” and similar statements. (Maybe I could have changed “delete from” to “truncate”?)

    Once I got the script to run, the help topics immediately started appearing as I clicked around in the script.

    It’s a clever way to avoid having to repackage all the info in Workbench, especially if/as it changes for each version. But a message directing to the site to download the help data would be nice. Not sure if that’s really a bug; more a feature request.

    By Dave Brown on Jan 22, 2014

  5. Is there a way to turn this feature off? Just hiding context-help-pane does not do it. It can be extremely annoying when working over the internet (or slower network, or busy server). It interrupts me in the middle of typing and freezes workbench for several seconds.

    By Franjo on Feb 24, 2014

  6. We’ve added an option to disable it in 6.0.9 and 6.1

    By akojima on Feb 26, 2014

  1. 1 Trackback(s)

  2. Aug 14, 2013: MySQL Workbench 6.0: Help is on the way… « SSHlab.com

Post a Comment


five − = 1