Hack MySQL Blog

Dolphins and camels, oh my!

Archive for the ‘Random’ Category

Setting the MySQL Sandbox prompt

without comments

This is far from deeply technical but little things that should be simple but aren’t annoy me. I found that MySQL Sandbox --prompt_prefix and --prompt_body don’t “just work.” I wanted the prompt to be mysql \v> . So I tried:

make_sandbox_from_source /mysql/src/mysql-4.0.30 single --prompt_body=' \v> '
sh: -c: line 0: syntax error near unexpected token `newline'
sh: -c: line 0: `make_sandbox /mysql/src/mysql-4.0.30/4.0.30 --prompt_body= \v> '

Maybe my shell knowledge is more terrible than I realize so I verified that ‘ \v> ‘ does not need special escaping:

echo ' \v> '
\v>

Ok, so clearly it’s the fault of make_sandbox_from_source. I tried and tried to do this on the command line but failed. I decided to try ~/.msandboxrc, specifying:

prompt_prefix=mysql
prompt_body= \v>

That didn’t work either; it created the prompt 'mysql4.0.30>. The leading space for prompt_body is ignored and there’s an errant apostrophe at the start. The final working version is:

prompt_prefix=mysql
prompt_body=\v> '

You can’t see it but there’s a trailing space after “mysql” for the prompt_prefix which is not ignored (unlike leading space for the prompt_body).

Written by Daniel Nichter

November 15th, 2009 at 2:49 pm

Posted in Random

Tagged with

OpenSQL Camp 2009 in Portland, Oregon

without comments

There’s very few spots left for attending OpenSQL Camp 2009. I’m going, along with several other Percona employees. It’s fun stuff; you should go. I’m not really the social type so I’ll probably be sitting off to the side somewhere coding.

Written by Daniel Nichter

October 21st, 2009 at 11:01 am

Posted in Random