emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug: ob-sql fails to work with other source code blocks if result contai


From: Philipp Uhl
Subject: Bug: ob-sql fails to work with other source code blocks if result contains quotes [9.4 (9.4-44-g5272d9-elpa @ /home/philipp/.emacs.d/elpa/org-20201123/)]
Date: Thu, 26 Nov 2020 20:46:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

When SQL output contains " than, JS code blocks don't work.

This works:

#+NAME: test
#+BEGIN_SRC sql
select '1'
#+END_SRC


#+BEGIN_SRC js :var test=test
return test
#+END_SRC

#+RESULTS:
| 1 |


This does not:

#+NAME: test
#+BEGIN_SRC sql
select '"1"'
#+END_SRC


#+BEGIN_SRC js :var test=test
return test
#+END_SRC

#+RESULTS:


It results in this error:


/tmp/babel-vaAbSc/js-script-GZW7OY:2
var test=[[#("\"1\"" 0 3 (face font-lock-string-face))]];
^

SyntaxError: Invalid or unexpected token
at wrapSafe (node:internal/modules/cjs/loader:999:16)
at Module._compile (node:internal/modules/cjs/loader:1047:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
at Module.load (node:internal/modules/cjs/loader:948:32)
at Function.Module._load (node:internal/modules/cjs/loader:789:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)
at node:internal/main/run_main_module:17:47



The expanded code looks like this:

var test=[[#("\"1\"" 0 3 (face font-lock-string-face))]];
return test


I should mention, that, in order to make JS output as a result work at
all, I have this in my config (but I don't think, it is related to this
bug):

Fix issue with javascript output due to depricated use of "sys"
package
#+BEGIN_SRC emacs-lisp
(setq org-babel-js-function-wrapper
"process.stdout.write(require('util').inspect(function(){\n%s\n}(), { maxArrayLength: null, maxStringLength: null, breakLength: Infinity, compact: true }))")
#+END_SRC



The bug does not appear when using e.g. python.

With best regards,
Philipp Uhl


Emacs : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3)
of 2020-08-28
Package: Org mode version 9.4 (9.4-44-g5272d9-elpa @ /home/philipp/.emacs.d/elpa/org-20201123/)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]