emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: "Alain Clément" <alain.clement@unil.ch>
Cc: emacs-orgmode@gnu.org
Subject: Re: Babel sql code block issue and patch proposal
Date: Thu, 03 Mar 2011 06:11:12 -0700	[thread overview]
Message-ID: <87sjv4pcwf.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTi=BP+3vgBgnp0d61DHH3J8eQiv9FdAfgbzPQ1N=@mail.gmail.com> ("Alain Clément"'s message of "Thu, 3 Mar 2011 12:23:47 +0100")

Hi Alain,

Does the following alternative fix work for you?

#+begin_src diff
  Changes in HEAD
          Modified lisp/ob-sql.el
  diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
  index 364070e..604d444 100644
  --- a/lisp/ob-sql.el
  +++ b/lisp/ob-sql.el
  @@ -71,7 +71,7 @@ This function is called by `org-babel-execute-src-block'."
                                        (or cmdline "")
                                        (org-babel-process-file-name in-file)
                                        (org-babel-process-file-name out-file)))
  -                    ('mysql (format "mysql %s -e \"source %s\" > %s"
  +                    ('mysql (format "mysql %s -e 'source %s' > %s"
                                       (or cmdline "")
                                      (org-babel-process-file-name in-file)
                                      (org-babel-process-file-name out-file)))
#+end_src

Also, just out of curiosity would you mind sharing an example result of
`org-babel-temporary-directory' which contains backslashes?

Thanks -- Eric

Alain Clément <alain.clement@unil.ch> writes:

> Hi everyone,
>
> The =org-babel-temp-file= string seems to be escaped with backslashes on
> some platforms (like MacOSX), which is not very appreciated by the =mysql
> -e= command. I suggest the following patch for =ob-sql.el= (Org-mode Version
> 7.4 (release_7.4.590.g85d4d)):
>
> 74c74
> <                     ('mysql (format "mysql %s < %s > %s"
> ---
>>                     ('mysql (format "mysql %s -e \"source %s\" > %s"
>
> Best regards,
> -- Alain
>
> -- 
>
>
>
> Alain Clément
> Dr ès sc. mathématiques
>
> Université de Lausanne
> Quartier UNIL-Centre
> Bâtiment Unicentre
> Bureau 339
> CH-1015 Lausanne
>
> T. +41 21 692 20 36 (direct)
> T. +41 21 692 20 60 (secrétariat)
>
> alain.clement@unil.ch

--
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2011-03-03 13:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 11:23 Babel sql code block issue and patch proposal Alain Clément
2011-03-03 13:11 ` Eric Schulte [this message]
2011-03-03 19:34   ` Alain Clément
2011-03-03 19:51     ` Eric Schulte
2011-03-07  9:15       ` Alain Clément
2011-03-07 15:33         ` Eric Schulte
2011-03-07 16:24           ` Alain Clément

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sjv4pcwf.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=alain.clement@unil.ch \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).