Re: [sqlite] Bug in sqlite3 (CLI, linux/Ubuntu)

2019-03-31 Thread Keith Medcalf

Works fine for me on Centos ... using the default (ancient) version of SQLite3

# sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO test VALUES(1);"
# touch /tmp/test.init
# sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null
1
# sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM test;" 2>/dev/null
1
[root@mail ~]# sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM test;"
-- Loading resources from /tmp/test.init
1
# sqlite3 --version
3.6.20
#

and with the current tip of trunk

# ./sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM test;"
-- Loading resources from /tmp/test.init
1
# ./sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM test;" 2>/dev/null
1
# ./sqlite3 --version
3.28.0 2019-03-31 18:17:00 
d03b611302f68483770d49b113b4ed685ba03526d2007647c306f8ec7ae697d2

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-Original Message-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of
>softw...@quantentunnel.de
>Sent: Saturday, 30 March, 2019 05:28
>To: sqlite-users@mailinglists.sqlite.org
>Subject: [sqlite] Bug in sqlite3 (CLI, linux/Ubuntu)
>
>Dear colleagues
>
>I detected an unexpected behaviour in sqlite3 (CLI) that I consider a
>bug as it seems not documented.
>
>When using an init file (even if an empty file), sqlite3 outputs an
>extra empty line to stdout. This messes up parsing of the sqlite3
>output, as this line is not present in the absence of an init file:
>
>buero:~$ sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO
>test VALUES(1);"
>buero:~$ touch /tmp/test.init
>buero:~$ ls -l /tmp/test.*
>-rw-r- 1 abc abc 2048 Mär 30 12:17 /tmp/test.db
>-rw-r- 1 abc abc0 Mär 30 12:17 /tmp/test.init
>buero:~$ sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null
>1
>buero:~$ sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM
>test;" 2>/dev/null
>
>1
>buero:~$
>
>
>My configuration
>buero:~$ sqlite3 --version
>3.11.0 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f
>buero:~$ uname -a
>Linux buero 4.15.0-46-generic #49~16.04.1-Ubuntu SMP Tue Feb 12
>17:45:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug in sqlite3 (CLI, linux/Ubuntu)

2019-03-31 Thread Software

> Dear colleagues 
> 
> I detected an unexpected behaviour in sqlite3 (CLI) that I consider a bug as 
> it seems not documented. 
> 
> When using an init file (even if an empty file), sqlite3 outputs an extra 
> empty line to stdout. This messes up parsing of the sqlite3 output, as this 
> line is not present in the absence of an init file: 
> 
> buero:~$ sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO test 
> VALUES(1);" 
> buero:~$ touch /tmp/test.init 
> buero:~$ ls -l /tmp/test.* 
> -rw-r- 1 abc abc 2048 Mär 30 12:17 /tmp/test.db 
> -rw-r- 1 abc abc0 Mär 30 12:17 /tmp/test.init 
> buero:~$ sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null 
> 1 
> buero:~$ sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM test;" 
> 2>/dev/null 
> 
> 1 
> buero:~$ 
> 
> 
> My configuration 
> buero:~$ sqlite3 --version 
> 3.11.0 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f 
> buero:~$ uname -a 
> Linux buero 4.15.0-46-generic #49~16.04.1-Ubuntu SMP Tue Feb 12 17:45:24 UTC 
> 2019 x86_64 x86_64 x86_64 GNU/Linux 
> ___
... [show rest of quote]

upgrade ? 

~$ sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO test 
VALUES(1);" 
~$ 
~$ touch /tmp/test.init 
~$ sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null 
1 
~$ 
~$ 
~$ sqlite3 -int /tmp/test.init /tmp/test.db "SELECT * FROM test;" 
2>/dev/null 
~$ ls -l /tmp 
total 16 
-rw-r--r-- 1 luuk luuk 8192 Mar 30 17:18 test.db 
-rw-rw-rw- 1 luuk luuk0 Mar 30 17:18 test.init 
~$ sqlite3 -version 
3.22.0 2018-01-22 18:45:57 
0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1 
~$ 


Hi Luuk

Thanks for looking into it. There is a typo in your example (-int instead of 
-init); the error message ("sqlite3: Error: unknown option: -int") went to 
/dev/null. Thus, there is no output to stdout; also the expected query result 
'1' is lacking.

Before I manually upgrade (I use currently the latest automatically uogradable 
version in Ubuntu xenial): would it be possible that you re-run the example 
(with -init) to check whether the leading empty line is indeed no longer 
present in version 3.22?
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug in sqlite3 (CLI, linux/Ubuntu)

2019-03-30 Thread Luuk


On 30-3-2019 12:28, softw...@quantentunnel.de wrote:

Dear colleagues

I detected an unexpected behaviour in sqlite3 (CLI) that I consider a bug as it 
seems not documented.

When using an init file (even if an empty file), sqlite3 outputs an extra empty 
line to stdout. This messes up parsing of the sqlite3 output, as this line is 
not present in the absence of an init file:

buero:~$ sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO test 
VALUES(1);"
buero:~$ touch /tmp/test.init
buero:~$ ls -l /tmp/test.*
-rw-r- 1 abc abc 2048 Mär 30 12:17 /tmp/test.db
-rw-r- 1 abc abc0 Mär 30 12:17 /tmp/test.init
buero:~$ sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null
1
buero:~$ sqlite3 -init /tmp/test.init /tmp/test.db "SELECT * FROM test;" 
2>/dev/null

1
buero:~$


My configuration
buero:~$ sqlite3 --version
3.11.0 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f
buero:~$ uname -a
Linux buero 4.15.0-46-generic #49~16.04.1-Ubuntu SMP Tue Feb 12 17:45:24 UTC 
2019 x86_64 x86_64 x86_64 GNU/Linux
___


upgrade ?

~$ sqlite3 /tmp/test.db "CREATE TABLE test (col1); INSERT INTO test 
VALUES(1);"

~$
~$ touch /tmp/test.init
~$ sqlite3 /tmp/test.db "SELECT * FROM test;" 2>/dev/null
1
~$
~$
~$ sqlite3 -int /tmp/test.init /tmp/test.db "SELECT * FROM test;" 
2>/dev/null

~$ ls -l /tmp
total 16
-rw-r--r-- 1 luuk luuk 8192 Mar 30 17:18 test.db
-rw-rw-rw- 1 luuk luuk    0 Mar 30 17:18 test.init
~$ sqlite3 -version
3.22.0 2018-01-22 18:45:57 
0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1

~$

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users