emacs-orgmode
[Top][All Lists]
Advanced

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

[PATCH] Fix truncated output in ob-sqlite.el (Was: Bug: sqlite output tr


From: Nick Savage
Subject: [PATCH] Fix truncated output in ob-sqlite.el (Was: Bug: sqlite output truncated?)
Date: Tue, 4 May 2021 16:42:06 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0

I've attached a patch to address this.

The issue is that ob-sqlite.el uses org-babel-string-read, which purposefully removes double-quotes. I think this is unintended behaviour, and it only seems to be used with ob-sqlite.el. I added a minor function to bypass the part of org-babel-string-read that was stripping out the double-quotes and use the rest of the function.

I tried ob-sql with the mysql engine and didn't experience the same bug, so I'm pretty confident that this is an isolated issue.


On 5/3/21 6:22 PM, learn orchids wrote:
I am using Org mode version 9.4.5 (9.4.5-73-g4c7696-elpaplus and I have the following code snippet. Values in the 'sql' column of the second row is truncated. Am I missing something?

#+begin_src sqlite :db /tmp/rip.db  :colnames yes
  drop table if exists testtable;
  create table testtable(id int, sql varchar);
  insert into testtable values (1, "Select id from foo");
  insert into testtable values (2, 'Select "id" from foo');
  select* from testtable;
#+end_src

#+RESULTS: testsql
| id | sql                |
|----+--------------------|
|  1 | Select id from foo |
|  2 | id                 |

Attachment: 0001-lisp-ob-sqlite.el-Prevent-output-from-being-incorrec.patch
Description: Text Data


reply via email to

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