Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Scott Robison
On Jan 17, 2015 7:29 PM, "Dave Dyer" > Here in the real world, when everything is working, we ask "why upgrade". But it wasn't working correctly so the statement doesn't really answer the question asked. :) ___ sqlite-users mailing list sqlite-users@sql

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Dave Dyer
> >The has been in shell.c since 3.8.6. We are on 3.8.8. Why >not upgrade? >-- Here in the real world, when everything is working, we ask "why upgrade". ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/li

[sqlite] sqlite3 tool bug

2015-01-17 Thread Dave Dyer
> >The has been in shell.c since 3.8.6. We are on 3.8.8. Why >not upgrade? >-- Here in the real world, when everything is working, we ask "why upgrade".

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Richard Hipp
On 1/17/15, Dave Dyer wrote: > >> >> >>OK. Dave, please try this patch at let us know if it works better for >>you: https://www.sqlite.org/src/info/80541e8b94b7 >> > > It needs #include to compile in my sources. > With that, it seems to fix the problem. > The has been in shell.c since 3.8.6.

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Dave Dyer
> > >OK. Dave, please try this patch at let us know if it works better for >you: https://www.sqlite.org/src/info/80541e8b94b7 > It needs #include to compile in my sources. With that, it seems to fix the problem. ___ sqlite-users mailing list sqlite-

[sqlite] sqlite3 tool bug

2015-01-17 Thread Dave Dyer
> > >OK. Dave, please try this patch at let us know if it works better for >you: https://www.sqlite.org/src/info/80541e8b94b7 > It needs #include to compile in my sources. With that, it seems to fix the problem.

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Richard Hipp
On 1/17/15, Roger Binns wrote: >> > The bug in the SQLite shell is that it tries to manage the encoding > itself, which is fine if the file is in binary mode. But with > stdin/out in text mode doing so will lead to extra data mangling. The > shell needs to change stdin/out to binary mode: > OK.

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/17/2015 12:20 PM, Graham Holden wrote: > I would echo this: it's good at mangling the command-line, but > I've not been aware of it ever mangling data sent to a file/stream > (other than the binary/text mode conversions). In text mode (the defau

Re: [sqlite] sqlite3 tool bug summary

2015-01-17 Thread Dave Dyer
> > .once '| sqlite3 new.db' > .dump .Once is not a command in the version of sqlite3 I use. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] sqlite3 tool bug summary

2015-01-17 Thread Dave Dyer
> > .once '| sqlite3 new.db' > .dump .Once is not a command in the version of sqlite3 I use.

Re: [sqlite] sqlite3 tool bug summary

2015-01-17 Thread Richard Hipp
On 1/17/15, Dave Dyer wrote: > >> >>> But that doesn't explain the difference between redirecting to a file >>> and redirecting to a pipe. > using .output file works > using > to direct stdout to a file works and produces the same file as > .output > using .read file works > using < file does not

Re: [sqlite] sqlite3 tool bug summary

2015-01-17 Thread Dave Dyer
> >> But that doesn't explain the difference between redirecting to a file >> and redirecting to a pipe. using .output file works using > to direct stdout to a file works and produces the same file as .output using .read file works using < file does not work. using | to shortcut > and < doesn't wo

[sqlite] sqlite3 tool bug summary

2015-01-17 Thread Dave Dyer
> >> But that doesn't explain the difference between redirecting to a file >> and redirecting to a pipe. using .output file works using > to direct stdout to a file works and produces the same file as .output using .read file works using < file does not work. using | to shortcut > and < doesn't wo

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Graham Holden
> I'm skeptical of the notion that cmd.exe is diddling with your data en > route to the pipe. I can't think of a time Windows munged my data in > that particular way despite more years using that lousy tool than I > care to remember. Quotes and escapes, sure, don't get me started. I would echo t

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Dave Dyer
> >Not, at least, when your database contains string data with unusual >characters that Windows feels like it should translate for you... Who can guarantee what characters are used in all their text strings, much less guarantee what unnamed transformations windows is helpfully doing to pipe data.

Re: [sqlite] sqlite3 tool bug

2015-01-17 Thread Dave Dyer
I have a class of database for which using sqlite3 to create a copy via the "pipe" method fails. Using an explicit intermediate file seems to work ok. I can supply a sample database to anyone interested in investigating. -- F:\2013 YearTech\Yearbook Tools\Resource>sqlite3 -version 3.7.3 F:\2

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Scott Robison
On Fri, Jan 16, 2015 at 3:48 PM, Keith Medcalf wrote: > > >You have a system with a bunch of apps installed. You then upgrade to > >a new version of the operating system and a whole bunch of the apps > >break. Do you think people blame the apps or the operating system? > >Do you think anyone ta

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Simon Slavin
On 16 Jan 2015, at 10:27pm, Keith Medcalf wrote: > [snip] The long and the short of it is that the interprocess pipe in Windows > connects to cooked channels because it never occurred to anyone at Microsoft > that this was undesirable and irrational. Thanks for this long explanation which I f

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/16/2015 02:35 PM, James K. Lowden wrote: > I'm skeptical of the notion that cmd.exe is diddling with your data > en route to the pipe. Almost certainly the reason is that stdout and stdin are in character mode. It requires extra code to put the

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Keith Medcalf
>You have a system with a bunch of apps installed. You then upgrade to >a new version of the operating system and a whole bunch of the apps >break. Do you think people blame the apps or the operating system? >Do you think anyone takes the apps apart and blames them for using the >wrong apis desp

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread James K. Lowden
On Fri, 16 Jan 2015 10:38:54 -0800 Dave Dyer wrote: > [$] sqlite3 po.sqlite .dump | sqlite3 po2.sqlite > Error: incomplete SQL: INSERT INTO "imageblob" VALUES(1,'G:\share Perhaps try -echo, to display the incomplete SQL? I'm skeptical of the notion that cmd.exe is diddling with your data en r

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Keith Medcalf
On Friday, 16 January, 2015 14:05, Simon Slavin said: >On 16 Jan 2015, at 9:01pm, Keith Medcalf wrote: >>> Not, at least, when your database contains string data with unusual >>> characters that Windows feels like it should translate for you... >> I think that pretty much limits one to the 7-bi

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Random Coder
On Fri, Jan 16, 2015 at 2:02 PM, Dave Dyer wrote: > the input side of the pipe. Perhaps there is some windows conditioning > that ought to be done by sqlite, on STDIN, to make it into a binary data > source ? You should be able to do a freopen(NULL, "rb", stdin); to change stdin to be in binary

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/16/2015 01:05 PM, Simon Slavin wrote: > Why on earth would an operating system programmer bother to put any > translation into piping You have a system with a bunch of apps installed. You then upgrade to a new version of the operating system an

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >Not, at least, when your database contains string data with unusual >characters that Windows feels like it should translate for you... Who can guarantee what characters are used in all their text strings, much less guarantee what unnamed transformations windows is helpfully doing to pipe data.

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >Not, at least, when your database contains string data with unusual >characters that Windows feels like it should translate for you... Who can guarantee what characters are used in all their text strings, much less guarantee what unnamed transformations windows is helpfully doing to pipe data.

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >Not, at least, when your database contains string data with unusual >characters that Windows feels like it should translate for you... Who can guarantee what characters are used in all their text strings, much less guarantee what unnamed transformations windows is helpfully doing to pipe data.

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Simon Slavin
On 16 Jan 2015, at 9:01pm, Keith Medcalf wrote: >> Not, at least, when your database contains string data with unusual >> characters that Windows feels like it should translate for you... > > I think that pretty much limits one to the 7-bit ASCII character set ... Why on earth would an operati

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Keith Medcalf
>>>I'm guess this is a case of the windows command-line shell doing some >>>character translations in the pipe, rather than just shipping the >>>bytes through the pipe unaltered. >> Ouch. That basically means the "pipe" method shouldn't ever be >> used on windows. >Not, at least, when your datab

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Richard Hipp
On 1/16/15, Dave Dyer wrote: > >> >>The pipe method works fine for me on Linux. >> >>I'm guess this is a case of the windows command-line shell doing some >>character translations in the pipe, rather than just shipping the >>bytes through the pipe unaltered. > > Ouch. That basically means the "pi

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >The pipe method works fine for me on Linux. > >I'm guess this is a case of the windows command-line shell doing some >character translations in the pipe, rather than just shipping the >bytes through the pipe unaltered. Ouch. That basically means the "pipe" method shouldn't ever be used on wi

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >The pipe method works fine for me on Linux. > >I'm guess this is a case of the windows command-line shell doing some >character translations in the pipe, rather than just shipping the >bytes through the pipe unaltered. Ouch. That basically means the "pipe" method shouldn't ever be used on wi

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >The pipe method works fine for me on Linux. > >I'm guess this is a case of the windows command-line shell doing some >character translations in the pipe, rather than just shipping the >bytes through the pipe unaltered. Ouch. That basically means the "pipe" method shouldn't ever be used on wi

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >The pipe method works fine for me on Linux. > >I'm guess this is a case of the windows command-line shell doing some >character translations in the pipe, rather than just shipping the >bytes through the pipe unaltered. Ouch. That basically means the "pipe" method shouldn't ever be used on wi

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Richard Hipp
On 1/16/15, Dave Dyer wrote: > > I have a class of database for which using sqlite3 to create > a copy via the "pipe" method fails. Using an explicit intermediate > file seems to work ok. > The pipe method works fine for me on Linux. I'm guess this is a case of the windows command-line shell d

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >Rather than the full database, can you show us the full schema of this >database, including triggers? It's a very simple database, no triggers or coalitions. The problem is most likely a buffer overrun because of a very long literal string field. I've sent a minimal sample to drh

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
> >Rather than the full database, can you show us the full schema of this >database, including triggers? It's a very simple database, no triggers or coalitions. The problem is most likely a buffer overrun because of a very long literal string field. I've sent a minimal sample to drh

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Simon Slavin
On 16 Jan 2015, at 6:38pm, Dave Dyer wrote: > I have a class of database for which using sqlite3 to create > a copy via the "pipe" method fails. Using an explicit intermediate > file seems to work ok. Which version of Windows are you using ? You can type 'ver' at the prompt. Can you reduce

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Zsbán Ambrus
On 1/16/15, Dave Dyer wrote: > I have a class of database for which using sqlite3 to create > a copy via the "pipe" method fails. Using an explicit intermediate > file seems to work ok. > > I can supply a sample database to anyone interested in investigating. Rather than the full database, can

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Richard Hipp
On 1/16/15, Dave Dyer wrote: > > I have a class of database for which using sqlite3 to create > a copy via the "pipe" method fails. Using an explicit intermediate > file seems to work ok. > > I can supply a sample database to anyone interested in investigating. Is the database small enough to s

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
I have a class of database for which using sqlite3 to create a copy via the "pipe" method fails. Using an explicit intermediate file seems to work ok. I can supply a sample database to anyone interested in investigating. -- F:\2013 YearTech\Yearbook Tools\Resource>sqlite3 -version 3.7.3 F:\2

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
I have a class of database for which using sqlite3 to create a copy via the "pipe" method fails. Using an explicit intermediate file seems to work ok. I can supply a sample database to anyone interested in investigating. -- F:\2013 YearTech\Yearbook Tools\Resource>sqlite3 -version 3.7.3 F:\2

[sqlite] sqlite3 tool bug

2015-01-16 Thread Dave Dyer
I have a class of database for which using sqlite3 to create a copy via the "pipe" method fails. Using an explicit intermediate file seems to work ok. I can supply a sample database to anyone interested in investigating. -- F:\2013 YearTech\Yearbook Tools\Resource>sqlite3 -version 3.7.3 F:\2