From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Fwd: bug with org-babel/sqlite? Date: Wed, 14 Sep 2016 19:00:26 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=94eb2c14fe1e45f136053c7c5870 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkFRI-0003BY-MS for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 15:01:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkFRE-0004GM-HU for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 15:01:43 -0400 Received: from mail-yb0-f182.google.com ([209.85.213.182]:36430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkFRE-0004GH-C3 for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 15:01:40 -0400 Received: by mail-yb0-f182.google.com with SMTP id u125so20276020ybg.3 for ; Wed, 14 Sep 2016 12:01:40 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-org list , juneja.dushyant@gmail.com --94eb2c14fe1e45f136053c7c5870 Content-Type: multipart/alternative; boundary=94eb2c14fe1e45f133053c7c586e --94eb2c14fe1e45f133053c7c586e Content-Type: text/plain; charset=UTF-8 Hi Dushyant, The folks following the org mailing list might be able to help you out on this. So I am forwarding this email there. I haven't tried recreating this as I do not use sqlite. But when you say that in the case where you use the default :results sqlite doesn't work, what doesn't work? Do you get an error? ---------- Forwarded message --------- From: Dushyant Juneja Date: Wed, Sep 14, 2016 at 10:08 AM Subject: bug with org-babel/sqlite? To: help-gnu-emacs@gnu.org Hi, Looks like I stumbled upon a bug with org-babel and sqlite. I have the following in my org file. PFA the bug description (bug.org). The essence is that sqlite queries work with :results verbatim, but not otherwise. Any ideas on how to get past this? This is with emacs 24.5.2, RHEL6. Dushyant -- Kaushal Modi --94eb2c14fe1e45f133053c7c586e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dushyant,

The folks following the or= g mailing list might be able to help you out on this. So I am forwarding th= is email there.

I haven't tried recreating thi= s as I do not use sqlite.

But when you say that in= the case where you use the default :results sqlite doesn't work, what = doesn't work? Do you get an error?

---------- Forwarded message ---------
From: Dushyant Jun= eja <juneja.dushyant@gmail.= com>
Date: Wed, Sep 14, 2016 at 10:08 AM
Subject: bug with org= -babel/sqlite?
To: help-gnu-em= acs@gnu.org <help-gnu-emac= s@gnu.org>


Hi,

Looks like I stumbled upon a bug with org-babel and sqlite. I have the
following in my org file. PFA the bug description (bug.org). The essence is
that sqlite queries work with :results verbatim, but not otherwise. Any
ideas on how to get past this?

This is with emacs 24.5.2, RHEL6.

Dushyant
--

Kaushal Modi

--94eb2c14fe1e45f133053c7c586e-- --94eb2c14fe1e45f136053c7c5870 Content-Type: application/octet-stream; name="bug.org" Content-Disposition: attachment; filename="bug.org" Content-Transfer-Encoding: base64 Content-ID: <15727e23894d8bbc6a1> X-Attachment-Id: 15727e23894d8bbc6a1 IytUSVRMRTogQnVnIHJlcG9ydAojK1BST1BFUlRZOiBta2RpcnAgeWVzCgoqIFNldHVwCk5lZWQg dG8gZXhlYyB0aGlzIGZpcnN0IGluIG9yZGVyIGZvciBzcWxpdGUgc3JjIHRvIGJlIGV4ZWMnZWQu CiMrQkVHSU5fU1JDIGVtYWNzLWxpc3AgOnJlc3VsdHMgc2lsZW50CihvcmctYmFiZWwtZG8tbG9h ZC1sYW5ndWFnZXMKICdvcmctYmFiZWwtbG9hZC1sYW5ndWFnZXMKICcoKGVtYWNzLWxpc3AgLiB0 KQogICAoc2ggICAgICAgICAuIHQpCiAgIChzcWxpdGUgICAgIC4gdCkKICAgKEMgICAgICAgICAg LiB0KSkpCiMrRU5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R1 cmUgIiJFeHRlbmRlZCBFZGl0aW9uIiIiLCIiLDQ5MDAuMDAKOiAxOTk5LENoZXZ5LCJWZW50dXJl ICIiRXh0ZW5kZWQgRWRpdGlvbiwgVmVyeSBMYXJnZSIiIiwiIiw1MDAwLjAwCjogMTk5NixKZWVw LCJHcmFuZCBDaGVyb2tlZSIsIk1VU1QgU0VMTCEKOiBhaXIsIG1vb24gcm9vZiwgbG9hZGVkIiw0 Nzk5LjAwCgoKSG93ZXZlciwgdGhlIGZvbGxvd2luZyBmYWlscywganVzdCBiZWNhdXNlID06cmVz dWx0cz0gaXMgc2V0IHRvIGRlZmF1bHQuCiMgQkVHSU5fU1JDIHNxbGl0ZSA6ZGIgc2FtcGxlLmRi IDpleHBvcnRzIHJlc3VsdHMgOnJlc3VsdHMgdmVyYmF0aW0KIytCRUdJTl9TUkMgc3FsaXRlIDpk YiBzYW1wbGUuZGIgOmV4cG9ydHMgcmVzdWx0cwpEUk9QIFRBQkxFIElGIEVYSVNUUyBjYXJzOwpD UkVBVEUgVEFCTEUgY2FycyAoIFllYXIsTWFrZSxNb2RlbCxEZXNjcmlwdGlvbixQcmljZSApOwpz ZWxlY3QgKiBmcm9tIGNhcnM7Ci5tb2RlIGNzdgouaW1wb3J0IHNhbXBsZTEuY3N2IGNhcnMKU0VM RUNUICogRlJPTSBjYXJzOwojK0VORF9TUkMK --94eb2c14fe1e45f136053c7c5870-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Fwd: bug with org-babel/sqlite? Date: Wed, 14 Sep 2016 17:16:47 -0400 Message-ID: <87zinaxjuo.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHYa-0001DN-16 for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 17:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkHYU-0006qv-7e for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 17:17:22 -0400 Received: from [195.159.176.226] (port=50410 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHYU-0006qO-0y for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 17:17:18 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bkHYK-00022p-C9 for emacs-orgmode@gnu.org; Wed, 14 Sep 2016 23:17:08 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Kaushal Modi writes: > Hi Dushyant, > > The folks following the org mailing list might be able to help you out on this. So I am forwarding this > email there. > > I haven't tried recreating this as I do not use sqlite. > > But when you say that in the case where you use the default :results sqlite doesn't work, what doesn't > work? Do you get an error? > > ---------- Forwarded message --------- > From: Dushyant Juneja > Date: Wed, Sep 14, 2016 at 10:08 AM > Subject: bug with org-babel/sqlite? > To: help-gnu-emacs@gnu.org > > Hi, > > Looks like I stumbled upon a bug with org-babel and sqlite. I have the > following in my org file. PFA the bug description (bug.org). The essence is > that sqlite queries work with :results verbatim, but not otherwise. Any > ideas on how to get past this? > > This is with emacs 24.5.2, RHEL6. > > Dushyant > -- > > Kaushal Modi > > Changing the CSV file slightly gets rid of the problem: ,---- | #+BEGIN_SRC csv :tangle sample1.csv | Year,Make,Model,Description,Price | 1997,Ford,E350,"ac, abs, moon",3000.00 | 1999,Chevy,"Venture ""Extended Edition""","",4900.00 | 1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00 | 1996,Jeep,Grand Cherokee,"MUST SELL! air, moon roof, loaded",4799.00 | #+END_SRC `---- ^ The CSV file had a newline ^here. If you eliminate the newline, things work as they should. Whether that's a bug in ob-sqlite or sqlite itself, I have no idea. -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dushyant Juneja Subject: Re: Fwd: bug with org-babel/sqlite? Date: Thu, 15 Sep 2016 06:14:19 +0000 Message-ID: References: <87zinaxjuo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113da9a038c67a053c85c2cb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkPxO-0003kM-An for emacs-orgmode@gnu.org; Thu, 15 Sep 2016 02:15:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkPxK-00012O-SP for emacs-orgmode@gnu.org; Thu, 15 Sep 2016 02:15:34 -0400 Received: from mail-vk0-f51.google.com ([209.85.213.51]:36214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkPxK-00012I-Mp for emacs-orgmode@gnu.org; Thu, 15 Sep 2016 02:15:30 -0400 Received: by mail-vk0-f51.google.com with SMTP id m62so11962997vkd.3 for ; Wed, 14 Sep 2016 23:15:30 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Kaushal Modi , emacs-orgmode@gnu.org, "juneja.dushyant" --001a113da9a038c67a053c85c2cb Content-Type: text/plain; charset=UTF-8 Thanks, Kaushal for forwarding me the reply. Indeed, I was not on the list. I have requested a subscription now, nevertheless. Hi Nick, Yes. That seems to help. However, I suspect the bug is with ob-sqlite rather than sqlite itself. If I do the following directly in sqlite3 terminal, it seems to work just fine: 119 $ sqlite3 SQLite version 3.7.11 2012-03-20 11:35:50 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .mode csv sqlite> create table foo(Year,Make,Model,Description,Price); sqlite> .import sample1.csv foo sqlite> select * from foo; Year,Make,Model,Description,Price 1997,Ford,E350,"ac, abs, moon",3000.00 1999,Chevy,"Venture ""Extended Edition""","",4900.00 1999,Chevy,"Venture ""Extended Edition, Very Large""","",5000.00 1996,Jeep,"Grand Cherokee","MUST SELL! air, moon roof, loaded",4799.00 Given that SQL is hence able to treat it properly, it looks like the bug lies with ob-sqlite wrongly interpreting the newline. Dushyant On Thu, Sep 15, 2016 at 6:32 AM Kaushal Modi wrote: > Not sure if you have subscribed to the org mode mailing list. If not, you > would not have received this reply. So forwarding that to you. > > ---------- Forwarded message --------- > From: Nick Dokos > Date: Wed, Sep 14, 2016, 5:18 PM > Subject: Re: [O] Fwd: bug with org-babel/sqlite? > To: > > > Kaushal Modi writes: > > > Hi Dushyant, > > > > The folks following the org mailing list might be able to help you out > on this. So I am forwarding this > > email there. > > > > I haven't tried recreating this as I do not use sqlite. > > > > But when you say that in the case where you use the default :results > sqlite doesn't work, what doesn't > > work? Do you get an error? > > > > ---------- Forwarded message --------- > > From: Dushyant Juneja > > Date: Wed, Sep 14, 2016 at 10:08 AM > > Subject: bug with org-babel/sqlite? > > To: help-gnu-emacs@gnu.org > > > > Hi, > > > > Looks like I stumbled upon a bug with org-babel and sqlite. I have the > > following in my org file. PFA the bug description (bug.org). The > essence is > > that sqlite queries work with :results verbatim, but not otherwise. Any > > ideas on how to get past this? > > > > This is with emacs 24.5.2, RHEL6. > > > > Dushyant > > -- > > > > Kaushal Modi > > > > > > Changing the CSV file slightly gets rid of the problem: > ,---- > | #+BEGIN_SRC csv :tangle sample1.csv > | Year,Make,Model,Description,Price > | 1997,Ford,E350,"ac, abs, moon",3000.00 > | 1999,Chevy,"Venture ""Extended Edition""","",4900.00 > | 1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00 > | 1996,Jeep,Grand Cherokee,"MUST SELL! air, moon roof, loaded",4799.00 > | #+END_SRC > `---- > ^ > The CSV file had a newline ^here. > > If you eliminate the newline, things work as they should. Whether > that's a bug in ob-sqlite or sqlite itself, I have no idea. > > -- > Nick > > > -- > > Kaushal Modi > --001a113da9a038c67a053c85c2cb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks, Kaushal for forwarding me the reply. Indeed, I was= not on the list. I have requested a subscription now, nevertheless.
Hi Nick,

Yes. That seems to help. How= ever, I suspect the bug is with ob-sqlite rather than sqlite itself. If I d= o the following directly in sqlite3 terminal, it seems to work just fine:

119 $ sqlite3
SQLite version 3.7.11 = 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite= > .mode csv
sqlite> create table foo(Year,Make,Model,Descri= ption,Price);
sqlite> .import sample1.csv foo
sqlite= > select * from foo;
Year,Make,Model,Description,Price
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,&q= uot;Venture ""Extended Edition""","",490= 0.00
1999,Chevy,"Venture ""Extended Edition, Very = Large""","",5000.00
1996,Jeep,"Gran= d Cherokee","MUST SELL!
air, moon roof, loaded",47= 99.00

Given that SQL is hence able to treat = it properly, it looks like the bug lies with ob-sqlite wrongly interpreting= the newline.

Dushyant

On Thu, Sep 15, 2016 at 6:32 AM Kaushal Modi <kaushal.modi@gmail.com> wrot= e:
Not sure if you have subscribed = to the org mode mailing list. If not, you would not have received this repl= y. So forwarding that to you.=C2=A0

---------- Forwarded message ---------
From: Nick Dokos <= ndokos@gmail.com&= gt;
Date: Wed, Sep 14, 2016, 5:18 PM
Subject: Re: [O] Fwd: bug with o= rg-babel/sqlite?
To: <emacs-orgmode@gnu.org>


Kaushal Modi <kaushal.modi@gmail.com> writes:<= br>
> Hi Dushyant,
>
> The folks following the org mailing list might be able to help you out= on this. So I am forwarding this
> email there.
>
> I haven't tried recreating this as I do not use sqlite.
>
> But when you say that in the case where you use the default :results s= qlite doesn't work, what doesn't
> work? Do you get an error?
>
> ---------- Forwarded message ---------
> From: Dushyant Juneja <juneja.dushyant@gmail.com>
> Date: Wed, Sep 14, 2016 at 10:08 AM
> Subject: bug with org-babel/sqlite?
> To: help-g= nu-emacs@gnu.org <help-gnu-emacs@gnu.org>
>
> Hi,
>
> Looks like I stumbled upon a bug with org-babel and sqlite. I have the=
> following in my org file. PFA the bug description (bug.org). The essence is > that sqlite queries work with :results verbatim, but not otherwise. An= y
> ideas on how to get past this?
>
> This is with emacs 24.5.2, RHEL6.
>
> Dushyant
> --
>
> Kaushal Modi
>
>

Changing the CSV file slightly gets rid of the problem:
,----
| #+BEGIN_SRC csv :tangle sample1.csv
| Year,Make,Model,Description,Price
| 1997,Ford,E350,"ac, abs, moon",3000.00
| 1999,Chevy,"Venture ""Extended Edition""",&= quot;",4900.00
| 1999,Chevy,"Venture ""Extended Edition, Very Large"&q= uot;",,5000.00
| 1996,Jeep,Grand Cherokee,"MUST SELL! air, moon roof, loaded",47= 99.00
| #+END_SRC
`----
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
The CSV file had a newline=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^here.<= br>
If you eliminate the newline, things work as they should. Whether
that's a bug in ob-sqlite or sqlite itself, I have no idea.

--
Nick


--

Kaushal Modi

--001a113da9a038c67a053c85c2cb--