Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Dominique Devienne
On Wed, Feb 15, 2017 at 2:07 AM, Jens Alfke  wrote:

> > Entire programming languages are invited (I'm thinking of
> > Java) to make goto and pointers impossible or to make assert()
> > impossible (Go) and yet at the same time encourage people to use
> > threads.
>
> [...]. And Go has had assertions for a while now. :)
>

Really? Where? --DD

Why does Go not have assertions? https://golang.org/doc/faq#assertions
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Clemens Ladisch
Jens Alfke wrote:
> With clock speed having stalled, the only way to take advantage of
> modern CPUs (and GPUs!) is to go parallel.

But "go parallel" does not necessarily imply threads.  There are many
ways to allow code running on different CPUs(/cores) to communicate
with each other (e.g., files, sockets, message queues, pipes, shared
memory, etc.), and almost all of them are safer than threading because
they do not require that _all_ of the address space and the process
context are shared.  When using threads, all memory accesses are unsafe
by default, and it is then the job of the programmer to manually add
some form of locking to make it safe again.

Threading is the most extreme method of achieving parallelism, and
therefore should be used only as the last resort.  (I'd compare it to
assembly code in this regard.)


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


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Jens Alfke

> On Feb 14, 2017, at 5:15 PM, Richard Hipp  wrote:
> 
> Nor is there anything wrong with goto, pointers, and assert(), in
> principle.  And yet they are despised while threads are adored, in
> spite of the fact that goto/pointer/assert() errors are orders of
> magnitude easier to understand, find, and fix.

Goto and pointers don’t enable huge speed increases the way concurrency does. 
With clock speed having stalled, the only way to take advantage of modern CPUs 
(and GPUs!) is to go parallel. Threading is also important to keep the UI 
responsive in GUI apps.

Goto is pretty much unnecessary except occasionally for error handling in C 
since it doesn’t have any proper cleanup mechanisms. I haven’t used it in years 
(and yeah, my programming history goes back to the late ‘70s, starting with 
Tiny BASIC on IMSAI 8080s, so don’t tell me to get off your lawn ;-)
Pointer arithmetic likewise except in certain really low-level grungy 
libraries. I have one such library, but the rest of my code is in C++ and 
mostly uses smart pointers.
I’ve actually never heard anyone speak negatively about assertions. What’s 
wrong with them?

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


Re: [sqlite] Storing a INTEGER in a TEXT field

2017-02-14 Thread Darko Volaric
The problem is that you're giving your column a type when you don't want it
to have. If the second last line was "message NOT NULL" you'd get exactly
what you're asking for.

On Wed, Feb 15, 2017 at 1:22 AM, Cecil Westerhof 
wrote:

> I have the following table:
> CREATE  TABLE messages(
> messageID   INTEGER PRIMARY KEY AUTOINCREMENT,
> dateTEXT NOT NULL DEFAULT CURRENT_DATE,
> timeTEXT NOT NULL DEFAULT CURRENT_TIME,
> typeTEXT NOT NULL,
> message TEXT NOT NULL
> );
>
> But for some data the field message is filled with an integer. An integer
> takes less room as its text representation and it sorts differently also.
> Is there a way to store an INTEGER in a TEXT field? Not very important,
> more nice to have.
>
> I just created the following view:
> CREATE VIEW downloadCount AS
> SELECT   date AS Date
> ,time AS Time
> ,CAST(message AS INTEGER) AS DownloadCount
> FROM messages
> WHEREtype = 'download-count'
> ;
>
> --
> Cecil Westerhof
> ___
> 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] OS X/Xcode build error: use of unknown builtin

2017-02-14 Thread Richard Hipp
On 2/14/17, Anthony Chan (antchan2)  wrote:
> Hello,
>
> I tried building SQLite 3.17.0 with OSX/Xcode and got the following errors:
>

We do test extensively on OSX and didn't have any problems.  What
version of Xcode do you have?
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] OS X/Xcode build error: use of unknown builtin

2017-02-14 Thread Anthony Chan (antchan2)
Hello,

I tried building SQLite 3.17.0 with OSX/Xcode and got the following errors:

-
sqlite3.c:28836:10: error: use of unknown builtin '__builtin_add_overflow' 
[-Wimplicit-function-declaration]
  return __builtin_add_overflow(*pA, iB, pA);
 ^
sqlite3.c:28856:10: error: use of unknown builtin '__builtin_sub_overflow' 
[-Wimplicit-function-declaration]
  return __builtin_sub_overflow(*pA, iB, pA);
 ^
sqlite3.c:28856:10: note: did you mean '__builtin_add_overflow'?
sqlite3.c:28836:10: note: '__builtin_add_overflow' declared here
  return __builtin_add_overflow(*pA, iB, pA);
 ^
sqlite3.c:28871:10: error: use of unknown builtin '__builtin_mul_overflow' 
[-Wimplicit-function-declaration]
  return __builtin_mul_overflow(*pA, iB, pA);
 ^
sqlite3.c:28871:10: note: did you mean '__builtin_sub_overflow'?
sqlite3.c:28856:10: note: '__builtin_sub_overflow' declared here
  return __builtin_sub_overflow(*pA, iB, pA);
 ^
3 errors generated.
-

I believe this is related to the recent change “Cleanup the usage of the 
SQLITE_DISABLE_INTRINSIC compile-time option…” 
(http://www.sqlite.org/src/info/798fb9d70d2e5f95) and the use of CLANG_VERSION 
to decide whether to use builtin functions:

#if defined(__clang__) && !defined(_WIN32) && !defined(SQLITE_DISABLE_INTRINSIC)
# define CLANG_VERSION \
(__clang_major__*100+__clang_minor__*1000+__clang_patchlevel__)
#else
# define CLANG_VERSION 0
#endif

…

#elif SQLITE_BYTEORDER==1234 && (GCC_VERSION>=4003000 || CLANG_VERSION>=300)
  u32 x;
  memcpy(,p,4);
  return __builtin_bswap32(x);

According to Clang documentation 
(http://clang.llvm.org/docs/LanguageExtensions.html): “marketing version 
numbers should not be used to check for language features, as different vendors 
use different numbering schemes. Instead, use the Feature Checking Macros.”

With this in mind, I suggest creating a new macro that uses feature checking 
macros.  For example:

#if defined(__clang__) && !defined(_WIN32) && !defined(SQLITE_DISABLE_INTRINSIC)
# if __has_builtin(__builtin_add_overflow) && \
 __has_builtin(__builtin_sub_overflow) && \
 __has_builtin(__builtin_mul_overflow) && \
 __has_builtin(__builtin_bswap32) && \
 __has_builtin(__builtin_bswap64)
#  define CLANG_USE_INTRINSIC 1
# else 
#  define CLANG_USE_INTRINSIC 0
# endif
#else
# define CLANG_USE_INTRINSIC 0
#endif

The tests would look like this:

#elif SQLITE_BYTEORDER==1234 && (GCC_VERSION>=4003000 || CLANG_USE_INTRINSIC!=0)
  u32 x;
  memcpy(,p,4);
  return __builtin_bswap32(x);

Your comments are welcome.

Thanks,

Anthony
antch...@cisco.com



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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Kevin Benson
On Tue, Feb 14, 2017 at 7:56 PM, Bart Smissaert 
wrote:

> I had to install WinZip though and at the first unzip I got directly to the
> files whereas now I had a .tar file first and had to unzip that.
>

Following on from David Empson's post... the WinZip docs show an
Advanced->File handling option named  that
likely facilitated your .TAR file attempt:
http://kb.winzip.com/help/HELP_CONFIG_MISC.htm
--
   --
  --
 --Ö¿Ö--
K e V i N
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread David Empson
I expect WinZip defaults to converting text files from Unix to DOS line 
endings, or you opened and saved the file with something which does the same 
conversion.

I don’t have WinZip handy, but using other tools…

My copy of sqlite3.c extracted from sqlite-autoconf-317.tar.gz using Take 
Command’s built-in untar command, or with a Windows port of Unix tar/gunzip 
utilities, produces a file with Unix line endings, and the expected fciv result 
of 1efd683943e0d2bce1495b3413e2e235.

If I then run it through a LF to CRLF translation, that copy has an fciv result 
of b0245450e4f27eeefc0da4a871833eb1, which matches Bart’s result.

There should be no difference between Unix and DOS line endings as far as the 
compiler is concerned, so if your re-downloaded and re-extracted sqlite3.c is 
compiling OK with nmake, it probably means your original extracted copy was 
modified up in some way.

If the errors turn up again when compiling the newly downloaded file with MSVS 
IDE, perhaps the IDE itself is the one messing up the file?

I’d investigate this as follows:

1. Use WinZip to extract a fresh copy from the .tar.gz file.
2. Take a copy of the resulting sqlite-autoconf-317 folder.
3. Do your compilation of the second copy of sqlite3.c using the MSVC IDE. 
Presumably this will get the errors again.
4. Now try compiling the second copy using nmake.
5. If nmake also gets errors, try compiling the first copy (extracted but never 
opened) with nmake.

If (4) gets errors but (5) doesn’t then the MSVS IDE modified the file in the 
process of opening or compiling it. You could then use file comparison tools to 
work out what changed.

If (3) gets errors but (4) doesn’t then MSVS IDE has something different in its 
compilation environment which is affecting how sqlite3.c is compiled, e.g. 
different header files or definitions which are conflicting with something in 
sqlite3.c.

> On 15/02/2017, at 2:14 PM, Bart Smissaert  wrote:
> 
> No idea why that is. Could the WinZip alter the file?
> Another thing is that if I run that sqlite3.c from the MSVS IDE I get the
> same errors.
> 
> RBS
> 
> On Wed, Feb 15, 2017 at 1:11 AM, Cezary H. Noweta 
> wrote:
> 
>> Hello,
>> 
>> On 2017-02-15 01:56, Bart Smissaert wrote:
>> 
>>> Downloaded again and now it looks more healthy:
>>> [...]
>>> b0245450e4f27eeefc0da4a871833eb1 sqlite3.c
>>> 
>> 
>> Still not an original one! MD5 of an original ``sqlite3.c'' is
>> 1efd683943e0d2bce1495b3413e2e235.
>> 
>> 
>> -- best regards
>> 
>> Cezary H. Noweta


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


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Richard Hipp
On 2/14/17, Darren Duncan  wrote:
>
> There is nothing inherently wrong with threads in principle,

Nor is there anything wrong with goto, pointers, and assert(), in
principle.  And yet they are despised while threads are adored, in
spite of the fact that goto/pointer/assert() errors are orders of
magnitude easier to understand, find, and fix.

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
No idea why that is. Could the WinZip alter the file?
Another thing is that if I run that sqlite3.c from the MSVS IDE I get the
same errors.

RBS

On Wed, Feb 15, 2017 at 1:11 AM, Cezary H. Noweta 
wrote:

> Hello,
>
> On 2017-02-15 01:56, Bart Smissaert wrote:
>
>> Downloaded again and now it looks more healthy:
>> [...]
>> b0245450e4f27eeefc0da4a871833eb1 sqlite3.c
>>
>
> Still not an original one! MD5 of an original ``sqlite3.c'' is
> 1efd683943e0d2bce1495b3413e2e235.
>
>
> -- best regards
>
> Cezary H. Noweta
> ___
> 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] Thread safety of serialized mode

2017-02-14 Thread Scott Hess
On Tue, Feb 14, 2017 at 5:05 PM, Darren Duncan 
wrote:

> On 2017-02-14 4:46 PM, Richard Hipp wrote:
>
>>  This is yet another reason why I say "threads are evil".  For
>> whatever reason, programmers today think that "goto" and pointers and
>> assert() are the causes of all errors, but threads are cool and
>> healthful.  Entire programming languages are invited (I'm thinking of
>> Java) to make goto and pointers impossible or to make assert()
>> impossible (Go) and yet at the same time encourage people to use
>> threads.  It boggles the mind 
>>
>
> There is nothing inherently wrong with threads in principle, just in how
> some people implement them.  Multi-core and multi-CPU hardware is normal
> these days and is even more the future.  Being multi-threaded is necessary
> to properly utilize the hardware, or else we're just running on a single
> core and letting the others go idle.  The real problem is about properly
> managing memory.  Also giving sufficient hints to the programming language
> so that it can implicitly parallelize operations.  For example, want to
> filter or map or reduce a relation and have 2 cores, have one core evaluate
> half the tuples and another evaluate the other half, and this can be
> implicit simply by declaring the operation associative and commutative and
> lacking of side-effects or whatever.


I'm with Dr Hipp - threads are evil.  It's not so much how they work when
everything goes well, it's that it's so challenging to align everything so
that it goes well.  My experience is that even very talented programmers
write bugs into their multi-threaded code without realizing it.  I think
what happens is that multi-threaded code often makes things much more
complicated than they look, so if you write to the limits of the complexity
you can understand, you're already over your head.

IMHO, if you're using a message-passing system which does implicit
parallelization, well, _you're_ not using threads, the implementation is
using threads on your behalf.  That I can get behind.  Unfortunately,
decent systems along those lines are like nuclear fusion, they've been just
around the corner for decades, now :-).

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Cezary H. Noweta

Hello,

On 2017-02-15 01:56, Bart Smissaert wrote:

Downloaded again and now it looks more healthy:
[...]
b0245450e4f27eeefc0da4a871833eb1 sqlite3.c


Still not an original one! MD5 of an original ``sqlite3.c'' is 
1efd683943e0d2bce1495b3413e2e235.


-- best regards

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


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Jens Alfke

> On Feb 14, 2017, at 4:46 PM, Richard Hipp  wrote:
> 
>  This is yet another reason why I say "threads are evil”.  

I agree, and it’s a pretty widely held opinion these days, going back at least 
to Edward Lee’s 2006 paper “The Problem With Threads”.[1] Actually the problem 
isn’t threads per se, but sharing mutable data between threads. There is a lot 
of work these days going into alternative concurrency mechanisms that are safer 
to use.

> Entire programming languages are invited (I'm thinking of
> Java) to make goto and pointers impossible or to make assert()
> impossible (Go) and yet at the same time encourage people to use
> threads.

Well, both Java and Go have pointers, including the dreaded null, just not 
pointer arithmetic or uninitialized pointers. And Go has had assertions for a 
while now. :)

One of the bad things about Java is that it made threads so easy to use that 
they became an “attractive nuisance” in the hands of inexperienced or careless 
programmers.
Go, to its credit, reintroduced the “channel” mechanism from CSP, a much safer 
way for threads to communicate. But channels are limited and somewhat slow, and 
Go still lets you mess with shared data and mutexes.

The really interesting work is going on in new languages like Rust and Pony 
that make it impossible to share mutable state between threads. They let you 
express the idea of moving data, so one thread can hand off state to another 
without copying.

—Jens

[1]: https://www2.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Darren Duncan

On 2017-02-14 4:46 PM, Richard Hipp wrote:

 This is yet another reason why I say "threads are evil".  For
whatever reason, programmers today think that "goto" and pointers and
assert() are the causes of all errors, but threads are cool and
healthful.  Entire programming languages are invited (I'm thinking of
Java) to make goto and pointers impossible or to make assert()
impossible (Go) and yet at the same time encourage people to use
threads.  It boggles the mind 


There is nothing inherently wrong with threads in principle, just in how some 
people implement them.  Multi-core and multi-CPU hardware is normal these days 
and is even more the future.  Being multi-threaded is necessary to properly 
utilize the hardware, or else we're just running on a single core and letting 
the others go idle.  The real problem is about properly managing memory.  Also 
giving sufficient hints to the programming language so that it can implicitly 
parallelize operations.  For example, want to filter or map or reduce a relation 
and have 2 cores, have one core evaluate half the tuples and another evaluate 
the other half, and this can be implicit simply by declaring the operation 
associative and commutative and lacking of side-effects or whatever. -- Darren 
Duncan


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


Re: [sqlite] Storing a INTEGER in a TEXT field

2017-02-14 Thread Cecil Westerhof
2017-02-15 1:32 GMT+01:00 Simon Slavin :

>
> On 15 Feb 2017, at 12:22am, Cecil Westerhof 
> wrote:
>
> > Is there a way to store an INTEGER in a TEXT field?
>
> No.  But you can do it the other way around.  You can store text in an
> INTEGER field.  Just bind it using sqlite3_bind_textnn() or pass a value
> delimited by single quotes.  You’ll find that SQLite is happy to store and
> retrieve it.
>

​I thought so, but it never hurts to check. ;-)

The table is already defined and it stores mostly text. The fields date,
time and type are also relatively big, so I keep it like this and use the
view I think.

​Thanks.​

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
Downloaded again and now it looks more healthy:


C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cd
C:\SQLite\sqlite-autoc
onf-317
C:\SQLite\sqlite-autoconf-317>C:\FCIV\fciv sqlite3.c && nmake /f
Makefile.ms
c
//
// File Checksum Integrity Verifier version 2.05.
//
b0245450e4f27eeefc0da4a871833eb1 sqlite3.c
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\SQLite\sqlite-autoconf-317>(echo VERSION = ^#define SQLITE_VERSION
 "3.17.0"  1>>rcver.vc )
cl -nologo -W3   -DSQLITE_OS_WIN=1 -I. -I. -fp:precise -MT -DNDEBUG
-D_C
RT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE -D_
CRT_NONSTDC_NO_WARNINGS -DSQLITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1
-
DSQLITE_TEMP_STORE=1  -DSQLITE_MAX_TRIGGER_DEPTH=100
-DSQLITE_ENABLE_FTS3=1 -DS
QLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1   -O2 -Zi
-Fosqlite3.lo
-c sqlite3.c
sqlite3.c
echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
echo #define SQLITE_RESOURCE_VERSION  3,17,0 >> sqlite3rc.h
echo #endif >> sqlite3rc.h
rc -DSQLITE_OS_WIN=1 -I. -I.   -DNDEBUG -D_CRT_SECURE_NO_DEPRECATE
-D_CR
T_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
-DSQ
LITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_TEMP_STORE=1
-DSQLI
TE_MAX_TRIGGER_DEPTH=100  -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1
-DSQLIT
E_ENABLE_COLUMN_METADATA=1   -r -fo sqlite3res.lo -DRC_VERONLY .\sqlite3.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.16384
Copyright (C) Microsoft Corporation.  All rights reserved.
csc.exe /target:exe .\Replace.cs
Microsoft (R) Visual C# Compiler version 12.0.21005.1
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
echo EXPORTS > sqlite3.def
dumpbin /all sqlite3.lo  | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:
sessi
on|changeset)?_[^@,]*)(?:@\d+|,DATA)?$" $1 true  | sort >> sqlite3.def
link.exe /DEBUG  /NOLOGO  /DLL /DEF:sqlite3.def /OUT:sqlite3.dll
sqlite3
.lo sqlite3res.lo
   Creating library sqlite3.lib and object sqlite3.exp
cl -nologo -W3   -DSQLITE_OS_WIN=1 -I. -I. -fp:precise -MT -DNDEBUG
-D_C
RT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE -D_
CRT_NONSTDC_NO_WARNINGS -DSQLITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1
-
DSQLITE_TEMP_STORE=1  -DSQLITE_MAX_TRIGGER_DEPTH=100
-DSQLITE_ENABLE_FTS3=1 -DS
QLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1   -O2 -Zi
-Fesqlite3.exe
 -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
-DHA
VE_READLINE=0 .\shell.c sqlite3.c  /link /pdb:sqlite3sh.pdb /DEBUG
/NOLOGO   sq
lite3res.lo
shell.c
sqlite3.c
Generating Code...
LINK : sqlite3.exe not found or not built by the last incremental link;
performi
ng full link
C:\SQLite\sqlite-autoconf-317>


Not sure why the difference as the previous source file was fresh
downloaded as well.
I had to install WinZip though and at the first unzip I got directly to the
files whereas now I had a .tar file first and had to unzip that.
Thanks for getting me on the right track!

RBS

On Wed, Feb 15, 2017 at 12:35 AM, Cezary H. Noweta 
wrote:

> Hello,
>
> On 2017-02-15 01:26, Bart Smissaert wrote:
>
>> OK, that gives this:
>> [...]
>>
>
> bd6dfd8b2b566ca64ff9f4c637e533f6
>>
>
> That means, you are not using an original, unmodified sqlite3.c file.
> Download/unpack an original autoconf package and try once again.
>
>
> -- best regards
>
> Cezary H. Noweta
> ___
> 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] Thread safety of serialized mode

2017-02-14 Thread Jens Alfke

> On Feb 14, 2017, at 3:51 PM, Bob Friesenhahn  
> wrote:
> 
> Due to timing constraints, it performs all read queries in one thread and 
> creates a temporary POSIX thread for each update query (this is the 
> developer's reasoning).

To me that seems kind of backwards, since SQLite supports multiple readers but 
only one writer. In other words, reads can be parallelized [if you use multiple 
connections], but it’s not possible to perform more than one write at a time. 
For example, I’m told the .NET SQLite library keeps a pool of connections for 
reads, but uses a single connection for writes.

> Due to memory constraints (at least 1MB is consumed per connection!), only 
> one database connection is used.  Any thread may acquire and use this one 
> database connection at any time.

With only one connection I don’t think you get any real parallelism. The docs 
aren’t explicit, but my understanding is that in serialized mode every SQLite 
API call goes through a mutex belonging to the connection, so only one thread 
can be acting on that connection at a time.

> If we have two threads executing sqlite3_step() on the same connection and 
> using their own prepared statement, is there any magic in sqlite3 which would 
> keep sqlite3_step() and sqlite3_column_foo() from consuming (or disrupting) 
> the results from the other thread?

Not if they’re using the same statement. A statement is a stateful object, so 
using it on multiple threads is probably going to cause problems.

Other ways to get in to trouble include
* Iterating over a statement’s result set in one thread while mutating the 
database on another thread, which results in “undefined results” from the 
iteration (I just got burned by this a few weeks ago)
* Beginning and ending transactions on multiple threads, since the transaction 
is shared state of the connection.

Again, my understanding is that SQLite’s thread-safety just says that it won’t 
crash or corrupt memory or databases, if called on multiple threads. The 
semantics of the API still mean that you’re not going to get the results you 
want if you’re not careful about which thread calls what when.

(FYI, this is why I think making APIs thread-safe is a waste of time. Even if 
you do so, the higher level calling patterns still need to be synchronized 
correctly by the client code, in which case the lower level thread safety is 
largely unnecessary. And the overhead of all those mutex locks can be pretty 
high.)

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


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Richard Hipp
On 2/14/17, Bob Friesenhahn  wrote:
> Due to memory constraints
> (at least 1MB is consumed per connection!), only one database
> connection is used.  Any thread may acquire and use this one database
> connection at any time.

 This is yet another reason why I say "threads are evil".  For
whatever reason, programmers today think that "goto" and pointers and
assert() are the causes of all errors, but threads are cool and
healthful.  Entire programming languages are invited (I'm thinking of
Java) to make goto and pointers impossible or to make assert()
impossible (Go) and yet at the same time encourage people to use
threads.  It boggles the mind 

>
> If we have two threads executing sqlite3_step() on the same connection
> and using their own prepared statement, is there any magic in sqlite3
> which would keep sqlite3_step() and sqlite3_column_foo() from
> consuming (or disrupting) the results from the other thread?

Yes, that is suppose to work.  If you find a (reproducible) case where
it does not, we will look into it.

>
> In this use case is sqlite3 usage "thread safe" or is behavior
> unstable due to sqlite3_step(), sqlite3_reset(), and result column
> accessors accessing/disrupting data from the result set of the other
> thread?
>


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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Cezary H. Noweta

Hello,

On 2017-02-15 01:26, Bart Smissaert wrote:

OK, that gives this:
[...]



bd6dfd8b2b566ca64ff9f4c637e533f6


That means, you are not using an original, unmodified sqlite3.c file.
Download/unpack an original autoconf package and try once again.

-- best regards

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


Re: [sqlite] Storing a INTEGER in a TEXT field

2017-02-14 Thread Simon Slavin

On 15 Feb 2017, at 12:22am, Cecil Westerhof  wrote:

> Is there a way to store an INTEGER in a TEXT field?

No.  But you can do it the other way around.  You can store text in an INTEGER 
field.  Just bind it using sqlite3_bind_textnn() or pass a value delimited by 
single quotes.  You’ll find that SQLite is happy to store and retrieve it.

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


Re: [sqlite] Storing a INTEGER in a TEXT field

2017-02-14 Thread Richard Hipp
On 2/14/17, Cecil Westerhof  wrote:
> Is there a way to store an INTEGER in a TEXT field?

No.  It will be automatically converted into TEXT.  Because that is
what PostgreSQL does.

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
OK, that gives this:


C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cd
C:\SQLite\sqlite-autoc
onf-317
C:\SQLite\sqlite-autoconf-317>fciv sqlite3.c && nmake /f Makefile.msc
'fciv' is not recognized as an internal or external command,
operable program or batch file.
C:\SQLite\sqlite-autoconf-317>fciv.exe sqlite3.c && nmake /f
Makefile.msc
'fciv.exe' is not recognized as an internal or external command,
operable program or batch file.
C:\SQLite\sqlite-autoconf-317>C:\FCIV\fciv sqlite3.c && nmake /f
Makefile.ms
c
//
// File Checksum Integrity Verifier version 2.05.
//
bd6dfd8b2b566ca64ff9f4c637e533f6 sqlite3.c
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\SQLite\sqlite-autoconf-317>(echo VERSION = ^#define SQLITE_VERSION
 "3.17.0"  1>>rcver.vc )
cl -nologo -W3   -DSQLITE_OS_WIN=1 -I. -I. -fp:precise -MT -DNDEBUG
-D_C
RT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE -D_
CRT_NONSTDC_NO_WARNINGS -DSQLITE_THREADSAFE=1
-DSQLITE_THREAD_OVERRIDE_LOCK=-1 -
DSQLITE_TEMP_STORE=1  -DSQLITE_MAX_TRIGGER_DEPTH=100
-DSQLITE_ENABLE_FTS3=1 -DS
QLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1   -O2 -Zi
-Fosqlite3.lo
-c sqlite3.c
sqlite3.c
sqlite3.c(16114) : error C2059: syntax error : 'if'
sqlite3.c(16117) : error C2059: syntax error : '}'
sqlite3.c(27461) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27464) : error C2065: 'db' : undeclared identifier
sqlite3.c(27464) : warning C4047: '=' : 'sqlite3 *' differs in levels of
indirec
tion from 'int'
sqlite3.c(27465) : error C2065: 'enc' : undeclared identifier
sqlite3.c(27467) : error C2065: 'db' : undeclared identifier
sqlite3.c(27467) : error C2223: left of '->mallocFailed' must point to
struct/un
ion
sqlite3.c(27474) : warning C4047: 'return' : 'int' differs in levels of
indirect
ion from 'char *'
sqlite3.c(27482) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27488) : error C2065: 'nChar' : undeclared identifier
sqlite3.c(27493) : error C2065: 'nChar' : undeclared identifier
sqlite3.c(27603) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27605) : error C2065: 'iTest' : undeclared identifier
sqlite3.c(27616) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27645) : error C2065: 'x' : undeclared identifier
sqlite3.c(27664) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27676) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27677) : error C2065: 'pCol' : undeclared identifier
sqlite3.c(27677) : error C2223: left of '->colFlags' must point to
struct/union
sqlite3.c(27677) : error C2065: 'zDflt' : undeclared identifier
sqlite3.c(27678) : error C2065: 'pCol' : undeclared identifier
sqlite3.c(27678) : error C2223: left of '->zName' must point to struct/union
sqlite3.c(27678) : error C2168: 'strlen' : too few actual parameters for
intrins
ic function
sqlite3.c(27678) : warning C4033: 'sqlite3Utf8CharLen' must return a value
sqlite3.c(27686) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27687) : error C2065: 'db' : undeclared identifier
sqlite3.c(27687) : error C2223: left of '->pErr' must point to struct/union
sqlite3.c(27687) : error C2198: 'sqlite3ValueSetNull' : too few arguments
for ca
ll
sqlite3.c(27688) : error C2065: 'db' : undeclared identifier
sqlite3.c(27688) : warning C4047: 'function' : 'sqlite3 *' differs in
levels of
indirection from 'int'
sqlite3.c(27688) : warning C4024: 'sqlite3SystemError' : different types
for for
mal and actual parameter 1
sqlite3.c(27688) : error C2065: 'err_code' : undeclared identifier
sqlite3.c(27696) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27698) : error C2065: 'db' : undeclared identifier
sqlite3.c(27698) : error C2223: left of '->errCode' must point to
struct/union
sqlite3.c(27698) : error C2065: 'err_code' : undeclared identifier
sqlite3.c(27699) : error C2065: 'err_code' : undeclared identifier
sqlite3.c(27699) : error C2065: 'db' : undeclared identifier
sqlite3.c(27699) : error C2223: left of '->pErr' must point to struct/union
sqlite3.c(27699) : warning C4047: 'function' : 'sqlite3 *' differs in
levels of
indirection from 'int'
sqlite3.c(27699) : warning C4024: 'sqlite3ErrorFinish' : different types
for for
mal and actual parameter 1
sqlite3.c(27706) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27707) : error C2065: 'rc' : undeclared identifier
sqlite3.c(27707) : warning C4033: 'sqlite3Utf8CharLen' must return a value
sqlite3.c(27708) : error C2065: 'rc' : undeclared identifier
sqlite3.c(27709) : error C2065: 'rc' : undeclared identifier
sqlite3.c(27710) : error C2065: 'db' : undeclared identifier
sqlite3.c(27710) : error C2223: left of '->iSysErrno' must point to
struct/union
sqlite3.c(27710) : error C2223: left of '->pVfs' must point to struct/union
sqlite3.c(27710) : error C2198: 'sqlite3OsGetLastError' : too few arguments
for
call

[sqlite] Storing a INTEGER in a TEXT field

2017-02-14 Thread Cecil Westerhof
I have the following table:
CREATE  TABLE messages(
messageID   INTEGER PRIMARY KEY AUTOINCREMENT,
dateTEXT NOT NULL DEFAULT CURRENT_DATE,
timeTEXT NOT NULL DEFAULT CURRENT_TIME,
typeTEXT NOT NULL,
message TEXT NOT NULL
);

But for some data the field message is filled with an integer. An integer
takes less room as its text representation and it sorts differently also.
Is there a way to store an INTEGER in a TEXT field? Not very important,
more nice to have.

I just created the following view:
CREATE VIEW downloadCount AS
SELECT   date AS Date
,time AS Time
,CAST(message AS INTEGER) AS DownloadCount
FROM messages
WHEREtype = 'download-count'
;

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


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Bob Friesenhahn

On Wed, 15 Feb 2017, Simon Slavin wrote:



On 14 Feb 2017, at 11:51pm, Bob Friesenhahn  
wrote:


One of our Linux programs (not written by me) is reporting errors of the form 
"SQLITE_CORRUPT: database disk image is malformed database corruption".


Is the database actually corrupt ?  Even if your other threads are 
not reporting this corruption, it may be real until you’ve checked. 
Can you use the shell tool to execute


I don't know if it is corrupt.  I added query code to the program 
which reports the problem, causes a core dump, and then the whole 
device reboots.  Queries written by someone else just prints a message 
and carries on.  We use a design in that the working database is in a 
RAM disk and so after the device reboots, the problem database is 
gone.


Sometimes sqlite3_step() reports the problem and sometimes 
sqlite3_finalize() reports the problem.



PRAGMA integrity_check

on it and find out ?


I may be able to add code which automatically does this.

It is noteworthy that none of the other programs are encountering this 
problem, yet all of those programs perform SQL queries from just one 
thread.  Some developers did try to do queries from multiple threads 
and encountered severe problems and so they changed their design to 
use just one thread.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Cezary H. Noweta

Hello,

On 2017-02-15 00:53, Bart Smissaert wrote:

I tried first with the original source, without altering anything at all. I
then had the errors.


Could you download and unpack 
https://support.microsoft.com/en-us/help/841290/availability-and-description-of-the-file-checksum-integrity-verifier-utility

then run from VS command prompt:

fciv sqlite3.c && nmake /f Makefile.msc

then send the output? You have run a similar command in a response to DRH.

-- best regards

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


Re: [sqlite] Thread safety of serialized mode

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 11:51pm, Bob Friesenhahn  
wrote:

> One of our Linux programs (not written by me) is reporting errors of the form 
> "SQLITE_CORRUPT: database disk image is malformed database corruption".

Is the database actually corrupt ?  Even if your other threads are not 
reporting this corruption, it may be real until you’ve checked.  Can you use 
the shell tool to execute

PRAGMA integrity_check

on it and find out ?

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
Actually first time I saw these errors the source file and the solution
file were on a USB stick and again that worked fine before.

RBS

On Tue, Feb 14, 2017 at 11:54 PM, Bart Smissaert 
wrote:

> > There's no way to do this on a normal installation that doesn't
> involve modifying the Visual Studio installation directory,
>
> Has worked fine before, but will try now with a different directory.
>
> RBS
>
> On Tue, Feb 14, 2017 at 11:46 PM, Random Coder 
> wrote:
>
>> On Tue, Feb 14, 2017 at 1:23 PM, Bart Smissaert
>>  wrote:
>> > C:\Program Files (x86)\Microsoft Visual Studio
>> > 12.0\VC\vcprojects\Win32\SQLite\s
>> > qlite-autoconf-317>nmake /f Makefile.msc
>>
>> What?!
>>
>> You're building from the installation directory?
>>
>> There's no way to do this on a normal installation that doesn't
>> involve modifying the Visual Studio installation directory, or running
>> in an elevated command prompt, both of which can cause no end of
>> problems.
>>
>> Given you're the only one that can reproduce this problem, I'd highly
>> recommend uninstalling Visual Studio and reinstalling it.  There's no
>> telling what state you've gotten things into.
>> ___
>> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
> There's no way to do this on a normal installation that doesn't
involve modifying the Visual Studio installation directory,

Has worked fine before, but will try now with a different directory.

RBS

On Tue, Feb 14, 2017 at 11:46 PM, Random Coder 
wrote:

> On Tue, Feb 14, 2017 at 1:23 PM, Bart Smissaert
>  wrote:
> > C:\Program Files (x86)\Microsoft Visual Studio
> > 12.0\VC\vcprojects\Win32\SQLite\s
> > qlite-autoconf-317>nmake /f Makefile.msc
>
> What?!
>
> You're building from the installation directory?
>
> There's no way to do this on a normal installation that doesn't
> involve modifying the Visual Studio installation directory, or running
> in an elevated command prompt, both of which can cause no end of
> problems.
>
> Given you're the only one that can reproduce this problem, I'd highly
> recommend uninstalling Visual Studio and reinstalling it.  There's no
> telling what state you've gotten things into.
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
I tried first with the original source, without altering anything at all. I
then had the errors.

RBS

On Tue, Feb 14, 2017 at 11:38 PM, Cezary H. Noweta 
wrote:

> Hello,
>
> On 2017-02-14 23:52, Bart Smissaert wrote:
>
>> I tried both with and without that backslash.
>>
>
> ``That backslash''? Did you mean ``Those backslashes''?
>
> In the first post you mentioned that the problem concerned ``while'',
> however in the response to DRH, the first error appeared at ``if''.
>
> 1. ``while'' -- you had backslash at the end of the first line: error was
> caused by a statement ``while'' out of a function, and you should receive
> an additional syntax error at the first closing ``}'' after ``while''.
>
> 2. ``if'' -- you had no backslashes: error was caused by a statement
> ``if'' out of a function, and you received an additional syntax error at
> final closing ``}'' (the first closing ``}'' was paired with opening ``{''
> after ``if'').
>
> All lines but the last one (containing final ``}'') of the macro must be
> ended with ``\'' and a newline. Make sure that newline immediately follows
> a backslash, because \ is not recognized as a line
> continuation. A splicing physical lines to establish logical ones is done
> at the very early stage of translation, even before spaces/comments are
> removed.
>
> -- best regards
>
> Cezary H. Noweta
>
> ___
> 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


[sqlite] Thread safety of serialized mode

2017-02-14 Thread Bob Friesenhahn
One of our Linux programs (not written by me) is reporting errors of 
the form "SQLITE_CORRUPT: database disk image is malformed database 
corruption".  Due to timing constraints, it performs all read queries 
in one thread and creates a temporary POSIX thread for each update 
query (this is the developer's reasoning).  Due to memory constraints 
(at least 1MB is consumed per connection!), only one database 
connection is used.  Any thread may acquire and use this one database 
connection at any time.


The connection open mode is RW,FULLMUTEX (equivalent to 
SQLITE_CONFIG_SERIALIZED).


A few queries may use sqlite3_exec() but most queries done by this 
program use sqlite3_prepare_v2()/sqlite3_step()/sqlite3_column_foo() 
and prepared statements.


The documentation at https://www.sqlite.org/threadsafe.html seems 
unclear in that it claims thread safety without documenting under 
which use cases it is thread safe.


If we have two threads executing sqlite3_step() on the same connection 
and using their own prepared statement, is there any magic in sqlite3 
which would keep sqlite3_step() and sqlite3_column_foo() from 
consuming (or disrupting) the results from the other thread?


In this use case is sqlite3 usage "thread safe" or is behavior 
unstable due to sqlite3_step(), sqlite3_reset(), and result column 
accessors accessing/disrupting data from the result set of the other 
thread?


Thanks,

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Random Coder
On Tue, Feb 14, 2017 at 1:23 PM, Bart Smissaert
 wrote:
> C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\vcprojects\Win32\SQLite\s
> qlite-autoconf-317>nmake /f Makefile.msc

What?!

You're building from the installation directory?

There's no way to do this on a normal installation that doesn't
involve modifying the Visual Studio installation directory, or running
in an elevated command prompt, both of which can cause no end of
problems.

Given you're the only one that can reproduce this problem, I'd highly
recommend uninstalling Visual Studio and reinstalling it.  There's no
telling what state you've gotten things into.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Cezary H. Noweta

Hello,

On 2017-02-14 23:52, Bart Smissaert wrote:

I tried both with and without that backslash.


``That backslash''? Did you mean ``Those backslashes''?

In the first post you mentioned that the problem concerned ``while'', 
however in the response to DRH, the first error appeared at ``if''.


1. ``while'' -- you had backslash at the end of the first line: error 
was caused by a statement ``while'' out of a function, and you should 
receive an additional syntax error at the first closing ``}'' after 
``while''.


2. ``if'' -- you had no backslashes: error was caused by a statement 
``if'' out of a function, and you received an additional syntax error at 
final closing ``}'' (the first closing ``}'' was paired with opening 
``{'' after ``if'').


All lines but the last one (containing final ``}'') of the macro must be 
ended with ``\'' and a newline. Make sure that newline immediately 
follows a backslash, because \ is not recognized as a 
line continuation. A splicing physical lines to establish logical ones 
is done at the very early stage of translation, even before 
spaces/comments are removed.


-- best regards

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
First time I saw this.
Mind you I only use MSVS to compile SQLite.

RBS

On Tue, Feb 14, 2017 at 10:57 PM, Richard Hipp  wrote:

> On 2/14/17, Bart Smissaert  wrote:
> > I just tried with an old 3.11.1 and got different errors:
>
> When did a "potentially uninitialized variable" become an error rather
> than a warning?
>
> This is important because MSVC is notoriously bad about overestimating
> the chances of a variable being used uninitialized.
>
> >
> > Error 1 error C4703: potentially uninitialized local pointer variable
> > 'pDbPage' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 57565 1 SQLite
> > Error 2 error C4703: potentially uninitialized local pointer variable
> > 'pDbPage' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 57498 1 SQLite
> > Error 3 error C4703: potentially uninitialized local pointer variable
> > 'pDbPage' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 56552 1 SQLite
> > Error 4 error C4703: potentially uninitialized local pointer variable
> > 'pPage' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 49637 1 SQLite
> > Error 5 error C4703: potentially uninitialized local pointer variable
> > 'pPgHdr' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 50675 1 SQLite
> > Error 6 error C4703: potentially uninitialized local pointer variable
> > 'pPgHdr' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 49804 1 SQLite
> > Error 7 error C4703: potentially uninitialized local pointer variable
> > 'pDbPage' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 60186 1 SQLite
> > Error 8 error C4703: potentially uninitialized local pointer variable
> > 'pOvflPage' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 64506 1 SQLite
> > Error 9 error C4703: potentially uninitialized local pointer variable
> > 'pSrcPg' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 65695 1 SQLite
> > Error 10 error C4703: potentially uninitialized local pointer variable
> > 'pPg' used c:\program files (x86)\microsoft visual studio
> > 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 65795 1 SQLite
> > Error 11 error LNK1257: code generation failed C:\Program Files
> > (x86)\Microsoft Visual Studio
> > 12.0\VC\vcprojects\Win32\SQLite\3_11_1\SQLite\SQLite\LINK SQLite
> >
> > RBS
> >
> > On Tue, Feb 14, 2017 at 10:30 PM, Simon Slavin 
> wrote:
> >
> >>
> >> On 14 Feb 2017, at 10:27pm, Bob Friesenhahn <
> bfrie...@simple.dallas.tx.us>
> >> wrote:
> >>
> >> > On Tue, 14 Feb 2017, Simon Slavin wrote:
> >> >>
> >> >> There’s always the chance that your copy of VC (or its compiler) got
> >> corrupted somehow.
> >> >
> >> > I think that this compiler uses a rolling release model so not
> everyone
> >> is using the same "MSVS 12" compiler.
> >>
> >> Ahha !
> >>
> >> > Macros defined by the system headers are the most likely cause of the
> >> problem. Windows headers are very unclean and its pre-processor
> >> definitions
> >> often overwrite user code.
> >>
> >> Well, how about this ?  Can Bart get hold of a slightly old version of
> >> SQLite — one which he originally compiled without problems and see
> whether
> >> he can still compile it ?
> >>
> >> If he can’t, the compiler changed.  If he can, then a diff between old
> and
> >> new source code should help to identify the problem.
> >>
> >> Simon.
> >> ___
> >> 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
> >
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Richard Hipp
On 2/14/17, Bart Smissaert  wrote:
> I just tried with an old 3.11.1 and got different errors:

When did a "potentially uninitialized variable" become an error rather
than a warning?

This is important because MSVC is notoriously bad about overestimating
the chances of a variable being used uninitialized.

>
> Error 1 error C4703: potentially uninitialized local pointer variable
> 'pDbPage' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 57565 1 SQLite
> Error 2 error C4703: potentially uninitialized local pointer variable
> 'pDbPage' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 57498 1 SQLite
> Error 3 error C4703: potentially uninitialized local pointer variable
> 'pDbPage' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 56552 1 SQLite
> Error 4 error C4703: potentially uninitialized local pointer variable
> 'pPage' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 49637 1 SQLite
> Error 5 error C4703: potentially uninitialized local pointer variable
> 'pPgHdr' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 50675 1 SQLite
> Error 6 error C4703: potentially uninitialized local pointer variable
> 'pPgHdr' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 49804 1 SQLite
> Error 7 error C4703: potentially uninitialized local pointer variable
> 'pDbPage' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 60186 1 SQLite
> Error 8 error C4703: potentially uninitialized local pointer variable
> 'pOvflPage' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 64506 1 SQLite
> Error 9 error C4703: potentially uninitialized local pointer variable
> 'pSrcPg' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 65695 1 SQLite
> Error 10 error C4703: potentially uninitialized local pointer variable
> 'pPg' used c:\program files (x86)\microsoft visual studio
> 12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 65795 1 SQLite
> Error 11 error LNK1257: code generation failed C:\Program Files
> (x86)\Microsoft Visual Studio
> 12.0\VC\vcprojects\Win32\SQLite\3_11_1\SQLite\SQLite\LINK SQLite
>
> RBS
>
> On Tue, Feb 14, 2017 at 10:30 PM, Simon Slavin  wrote:
>
>>
>> On 14 Feb 2017, at 10:27pm, Bob Friesenhahn 
>> wrote:
>>
>> > On Tue, 14 Feb 2017, Simon Slavin wrote:
>> >>
>> >> There’s always the chance that your copy of VC (or its compiler) got
>> corrupted somehow.
>> >
>> > I think that this compiler uses a rolling release model so not everyone
>> is using the same "MSVS 12" compiler.
>>
>> Ahha !
>>
>> > Macros defined by the system headers are the most likely cause of the
>> problem. Windows headers are very unclean and its pre-processor
>> definitions
>> often overwrite user code.
>>
>> Well, how about this ?  Can Bart get hold of a slightly old version of
>> SQLite — one which he originally compiled without problems and see whether
>> he can still compile it ?
>>
>> If he can’t, the compiler changed.  If he can, then a diff between old and
>> new source code should help to identify the problem.
>>
>> Simon.
>> ___
>> 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
>


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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
Yes it looks it is a change in MSVS that is causing this trouble.
Not sure now reinstalling is that simple with licensing etc.

RBS

On Tue, Feb 14, 2017 at 10:49 PM, Simon Slavin  wrote:

>
> On 14 Feb 2017, at 10:47pm, Bart Smissaert 
> wrote:
>
> > I just tried with an old 3.11.1 and got different errors:
>
> And if I understand what you wrote earlier, when 3.11.1 came out you were
> able to compile it without problems.
>
> So you seem to have isolated your problem to a change in your compiler
> setup, rather than a change in SQLite.
>
> Might have changed some configuration setting for the compiler.  Or
> perhaps the compiler itself has got corrupt and you need to reinstall it.
>
> Simon.
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
I tried both with and without that backslash.
No difference.

RBS

On Tue, Feb 14, 2017 at 10:34 PM, Daniel Anderson  wrote:

> There is no \ at the end of the code which was pasted.
>
> did you removed them from the source ?
>
> the error look related to that problem.
>
> my .02 $
>
> 2017-02-14 17:20 GMT-05:00 Simon Slavin :
>
> >
> > On 14 Feb 2017, at 10:15pm, Bart Smissaert 
> > wrote:
> >
> > > The strange thing is that nil changed other than moving from version
> > 3.16.2
> > > to 3.17.0.
> > > There is no serious problem as I can compile on the other PC, but would
> > > like to figure out what is going on here.
> > > Will see if I can look at the pre-processor output.
> >
> > There’s always the chance that your copy of VC (or its compiler) got
> > corrupted somehow.
> >
> > Simon.
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> Daniel
> *L'action accède à la perfection quand, bien que vivant, vous êtes déjà
> mort*
> *Bunan*
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 10:47pm, Bart Smissaert  wrote:

> I just tried with an old 3.11.1 and got different errors:

And if I understand what you wrote earlier, when 3.11.1 came out you were able 
to compile it without problems.

So you seem to have isolated your problem to a change in your compiler setup, 
rather than a change in SQLite.

Might have changed some configuration setting for the compiler.  Or perhaps the 
compiler itself has got corrupt and you need to reinstall it.

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
I just tried with an old 3.11.1 and got different errors:

Error 1 error C4703: potentially uninitialized local pointer variable
'pDbPage' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 57565 1 SQLite
Error 2 error C4703: potentially uninitialized local pointer variable
'pDbPage' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 57498 1 SQLite
Error 3 error C4703: potentially uninitialized local pointer variable
'pDbPage' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 56552 1 SQLite
Error 4 error C4703: potentially uninitialized local pointer variable
'pPage' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 49637 1 SQLite
Error 5 error C4703: potentially uninitialized local pointer variable
'pPgHdr' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 50675 1 SQLite
Error 6 error C4703: potentially uninitialized local pointer variable
'pPgHdr' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 49804 1 SQLite
Error 7 error C4703: potentially uninitialized local pointer variable
'pDbPage' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 60186 1 SQLite
Error 8 error C4703: potentially uninitialized local pointer variable
'pOvflPage' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 64506 1 SQLite
Error 9 error C4703: potentially uninitialized local pointer variable
'pSrcPg' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 65695 1 SQLite
Error 10 error C4703: potentially uninitialized local pointer variable
'pPg' used c:\program files (x86)\microsoft visual studio
12.0\vc\vcprojects\win32\sqlite\3_11_1\sqlite3.c 65795 1 SQLite
Error 11 error LNK1257: code generation failed C:\Program Files
(x86)\Microsoft Visual Studio
12.0\VC\vcprojects\Win32\SQLite\3_11_1\SQLite\SQLite\LINK SQLite

RBS

On Tue, Feb 14, 2017 at 10:30 PM, Simon Slavin  wrote:

>
> On 14 Feb 2017, at 10:27pm, Bob Friesenhahn 
> wrote:
>
> > On Tue, 14 Feb 2017, Simon Slavin wrote:
> >>
> >> There’s always the chance that your copy of VC (or its compiler) got
> corrupted somehow.
> >
> > I think that this compiler uses a rolling release model so not everyone
> is using the same "MSVS 12" compiler.
>
> Ahha !
>
> > Macros defined by the system headers are the most likely cause of the
> problem. Windows headers are very unclean and its pre-processor definitions
> often overwrite user code.
>
> Well, how about this ?  Can Bart get hold of a slightly old version of
> SQLite — one which he originally compiled without problems and see whether
> he can still compile it ?
>
> If he can’t, the compiler changed.  If he can, then a diff between old and
> new source code should help to identify the problem.
>
> Simon.
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread David Empson
My thinking is that something before line 27461 in sqlite3.c which changed 
between versions 3.16.2 and 3.17.0 has bumped into a conflict with something 
defined for your compiler on that computer (e.g. from a Windows header file).

If so, you should still be able to compile 3.16.2, which you can download from 
whichever of these links you need:

https://www.sqlite.org/2017/sqlite-amalgamation-3160200.zip
https://www.sqlite.org/2017/sqlite-autoconf-3160200.tar.gz

> On 15/02/2017, at 11:15 AM, Bart Smissaert  wrote:
> 
> The strange thing is that nil changed other than moving from version 3.16.2
> to 3.17.0.
> There is no serious problem as I can compile on the other PC, but would
> like to figure out what is going on here.
> Will see if I can look at the pre-processor output.
> 
> RBS
> 
> 
> On Tue, Feb 14, 2017 at 10:07 PM, David Empson 
> wrote:
> 
>>> On 15/02/2017, at 10:23 AM, Bart Smissaert 
>> wrote:
>>> 
>>> -c sqlite3.c
>>> sqlite3.c
>>> sqlite3.c(16114) : error C2059: syntax error : 'if'
>>> sqlite3.c(16117) : error C2059: syntax error : '}'
>>> sqlite3.c(27461) : error C2143: syntax error : missing ';' before '{'
>>> sqlite3.c(27464) : error C2065: 'db' : undeclared identifier
>> 
>> 
>> A clue which might help: the error output shows a constant stream of
>> problems starting at line 27461, which is in the function just after the
>> first use of SQLITE_SKIP_UTF8, in sqlite3Utf8CharLen(), on line 27418. The
>> errors reported for lines 16114 and 16117 (in the definition of that macro)
>> are probably related to the expansion of that macro, not its definition,
>> and the compiler has got lost after line 27418, resulting in cascading
>> errors.
>> 
>> I had a quick look at the raw hex data of my expansion of the autoconf
>> copy of sqlite3.c and I can’t see anything around the macro definition or
>> expansion which looks like it might confuse a C compiler. Line endings are
>> 0x0A (LF, UNIX \n) and everything appears to be ASCII.
>> 
>> As it seems this is only happening on one computer for one person, and
>> assuming the source file is not a bad copy on that computer, I’d suspect
>> the compiler installation or perhaps some configuration for the compiler
>> which is not overridden by the makefile, which is resulting in abnormal
>> behaviour (e.g. it may have a nonstandard include search path, or some
>> extra preprocessor symbols defined).
>> 
>> If reinstalling the compiler doesn’t help, perhaps have a look at the
>> preprocessor output to see what it is actually trying to compile around
>> source line 27418?
>> 
>> ___
>> 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

-- 
David Empson
demp...@emptech.co.nz

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Daniel Anderson
There is no \ at the end of the code which was pasted.

did you removed them from the source ?

the error look related to that problem.

my .02 $

2017-02-14 17:20 GMT-05:00 Simon Slavin :

>
> On 14 Feb 2017, at 10:15pm, Bart Smissaert 
> wrote:
>
> > The strange thing is that nil changed other than moving from version
> 3.16.2
> > to 3.17.0.
> > There is no serious problem as I can compile on the other PC, but would
> > like to figure out what is going on here.
> > Will see if I can look at the pre-processor output.
>
> There’s always the chance that your copy of VC (or its compiler) got
> corrupted somehow.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Daniel
*L'action accède à la perfection quand, bien que vivant, vous êtes déjà
mort*
*Bunan*
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 10:27pm, Bob Friesenhahn  
wrote:

> On Tue, 14 Feb 2017, Simon Slavin wrote:
>> 
>> There’s always the chance that your copy of VC (or its compiler) got 
>> corrupted somehow.
> 
> I think that this compiler uses a rolling release model so not everyone is 
> using the same "MSVS 12" compiler.

Ahha !

> Macros defined by the system headers are the most likely cause of the 
> problem. Windows headers are very unclean and its pre-processor definitions 
> often overwrite user code.

Well, how about this ?  Can Bart get hold of a slightly old version of SQLite — 
one which he originally compiled without problems and see whether he can still 
compile it ?

If he can’t, the compiler changed.  If he can, then a diff between old and new 
source code should help to identify the problem.

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bob Friesenhahn

On Tue, 14 Feb 2017, Simon Slavin wrote:


There’s always the chance that your copy of VC (or its compiler) got corrupted 
somehow.


I think that this compiler uses a rolling release model so not 
everyone is using the same "MSVS 12" compiler.


Macros defined by the system headers are the most likely cause of the 
problem.  Windows headers are very unclean and its pre-processor 
definitions often overwrite user code.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 10:15pm, Bart Smissaert  wrote:

> The strange thing is that nil changed other than moving from version 3.16.2
> to 3.17.0.
> There is no serious problem as I can compile on the other PC, but would
> like to figure out what is going on here.
> Will see if I can look at the pre-processor output.

There’s always the chance that your copy of VC (or its compiler) got corrupted 
somehow.

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
The strange thing is that nil changed other than moving from version 3.16.2
to 3.17.0.
There is no serious problem as I can compile on the other PC, but would
like to figure out what is going on here.
Will see if I can look at the pre-processor output.

RBS


On Tue, Feb 14, 2017 at 10:07 PM, David Empson 
wrote:

> > On 15/02/2017, at 10:23 AM, Bart Smissaert 
> wrote:
> >
> > -c sqlite3.c
> > sqlite3.c
> > sqlite3.c(16114) : error C2059: syntax error : 'if'
> > sqlite3.c(16117) : error C2059: syntax error : '}'
> > sqlite3.c(27461) : error C2143: syntax error : missing ';' before '{'
> > sqlite3.c(27464) : error C2065: 'db' : undeclared identifier
>
>
> A clue which might help: the error output shows a constant stream of
> problems starting at line 27461, which is in the function just after the
> first use of SQLITE_SKIP_UTF8, in sqlite3Utf8CharLen(), on line 27418. The
> errors reported for lines 16114 and 16117 (in the definition of that macro)
> are probably related to the expansion of that macro, not its definition,
> and the compiler has got lost after line 27418, resulting in cascading
> errors.
>
> I had a quick look at the raw hex data of my expansion of the autoconf
> copy of sqlite3.c and I can’t see anything around the macro definition or
> expansion which looks like it might confuse a C compiler. Line endings are
> 0x0A (LF, UNIX \n) and everything appears to be ASCII.
>
> As it seems this is only happening on one computer for one person, and
> assuming the source file is not a bad copy on that computer, I’d suspect
> the compiler installation or perhaps some configuration for the compiler
> which is not overridden by the makefile, which is resulting in abnormal
> behaviour (e.g. it may have a nonstandard include search path, or some
> extra preprocessor symbols defined).
>
> If reinstalling the compiler doesn’t help, perhaps have a look at the
> preprocessor output to see what it is actually trying to compile around
> source line 27418?
>
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread David Empson
> On 15/02/2017, at 10:23 AM, Bart Smissaert  wrote:
> 
> -c sqlite3.c
> sqlite3.c
> sqlite3.c(16114) : error C2059: syntax error : 'if'
> sqlite3.c(16117) : error C2059: syntax error : '}'
> sqlite3.c(27461) : error C2143: syntax error : missing ';' before '{'
> sqlite3.c(27464) : error C2065: 'db' : undeclared identifier


A clue which might help: the error output shows a constant stream of problems 
starting at line 27461, which is in the function just after the first use of 
SQLITE_SKIP_UTF8, in sqlite3Utf8CharLen(), on line 27418. The errors reported 
for lines 16114 and 16117 (in the definition of that macro) are probably 
related to the expansion of that macro, not its definition, and the compiler 
has got lost after line 27418, resulting in cascading errors.

I had a quick look at the raw hex data of my expansion of the autoconf copy of 
sqlite3.c and I can’t see anything around the macro definition or expansion 
which looks like it might confuse a C compiler. Line endings are 0x0A (LF, UNIX 
\n) and everything appears to be ASCII.

As it seems this is only happening on one computer for one person, and assuming 
the source file is not a bad copy on that computer, I’d suspect the compiler 
installation or perhaps some configuration for the compiler which is not 
overridden by the makefile, which is resulting in abnormal behaviour (e.g. it 
may have a nonstandard include search path, or some extra preprocessor symbols 
defined).

If reinstalling the compiler doesn’t help, perhaps have a look at the 
preprocessor output to see what it is actually trying to compile around source 
line 27418?

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Marc L. Allen
This is a total shot in the dark... but something with line endings (\r, \n, 
\r\n, etc.) messing up the

#define blah \

Or other things?

-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Drago, William @ CSG - NARDA-MITEQ
Sent: Tuesday, February 14, 2017 4:49 PM
To: SQLite mailing list 
Subject: Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

> -Original Message-
> From: sqlite-users 
> [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of 
> Bart Smissaert
> Sent: Tuesday, February 14, 2017 4:24 PM
> To: SQLite mailing list 
> Subject: Re: [sqlite] Problem compiling 3.17.0 in MSVS 12
>
> I tried compiling from the MSVS IDE with 3.17 as the source on a 
> different machine (also Windows 7, same MSVS version) and compiled fine there.
>
> No idea what the problem is.

Maybe the source file is corrupt on the machine with the errors.
--
Bill Drago
Staff Engineer
L3 Narda-MITEQ
435 Moreland Road
Hauppauge, NY 11788
631-272-5947 / william.dr...@l3t.com


CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.

Effective immediately my new email address is william.dr...@l3t.com. Please 
update your records.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

�߉ק�&��ܧ�؜y8b�隊X��{^�ם��^�'�����az)݊hܭ�br��ƝvZ�ٚ��'w��f���텫b��覸���港�W�y�(�'~'^�ؚ���驵���جrZ,׫j�e�ƛ��Z��i׫�^�{^�ם��"�'���ځ)�{"nW���^�+ޮ)���z���h���קu�kyȩ���ʋ���^�b~'���j|����)ڶ*'v+-�&��*'��(�(�+�i��'�*'��-�'-�*k���ם!����z��z+�v�b��&���q�b�x�z�讙^jǧ�؟��^���ze�隊Z+r�ey�mzWq�ejw]zW�z��z�k�&���)��(~�b�隊Y��Ơy�����ƥr�bzɚu���zf��g���jw��y�mi�fz{l___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Drago, William @ CSG - NARDA-MITEQ
> -Original Message-
> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
> Behalf Of Bart Smissaert
> Sent: Tuesday, February 14, 2017 4:24 PM
> To: SQLite mailing list 
> Subject: Re: [sqlite] Problem compiling 3.17.0 in MSVS 12
>
> I tried compiling from the MSVS IDE with 3.17 as the source on a different
> machine (also Windows 7, same MSVS version) and compiled fine there.
>
> No idea what the problem is.

Maybe the source file is corrupt on the machine with the errors.
--
Bill Drago
Staff Engineer
L3 Narda-MITEQ
435 Moreland Road
Hauppauge, NY 11788
631-272-5947 / william.dr...@l3t.com


CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.

Effective immediately my new email address is william.dr...@l3t.com. Please 
update your records.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
I tried with nmake / Makefile.msc from the VS command prompt but got the
same errors:


C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cd C:\Program Files
(x86)
\Microsoft Visual Studio
12.0\VC\vcprojects\Win32\SQLite\sqlite-autoconf-317

C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\vcprojects\Win32\SQLite\s
qlite-autoconf-317>nmake /f Makefile.msc
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\vcprojects\Win32\SQLite\s
qlite-autoconf-317>(echo VERSION = ^#define SQLITE_VERSION
"3.17.0"
1>>rcver.vc )
cl -nologo -W3   -DSQLITE_OS_WIN=1 -I. -I. -fp:precise -MT -DNDEBUG
-D_C
RT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE -D_
CRT_NONSTDC_NO_WARNINGS -DSQLITE_THREADSAFE=1
-DSQLITE_THREAD_OVERRIDE_LOCK=-1 -
DSQLITE_TEMP_STORE=1  -DSQLITE_MAX_TRIGGER_DEPTH=100
-DSQLITE_ENABLE_FTS3=1 -DS
QLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1   -O2 -Zi
-Fosqlite3.lo
-c sqlite3.c
sqlite3.c
sqlite3.c(16114) : error C2059: syntax error : 'if'
sqlite3.c(16117) : error C2059: syntax error : '}'
sqlite3.c(27461) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27464) : error C2065: 'db' : undeclared identifier
sqlite3.c(27464) : warning C4047: '=' : 'sqlite3 *' differs in levels of
indirec
tion from 'int'
sqlite3.c(27465) : error C2065: 'enc' : undeclared identifier
sqlite3.c(27467) : error C2065: 'db' : undeclared identifier
sqlite3.c(27467) : error C2223: left of '->mallocFailed' must point to
struct/un
ion
sqlite3.c(27474) : warning C4047: 'return' : 'int' differs in levels of
indirect
ion from 'char *'
sqlite3.c(27482) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27488) : error C2065: 'nChar' : undeclared identifier
sqlite3.c(27493) : error C2065: 'nChar' : undeclared identifier
sqlite3.c(27603) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27605) : error C2065: 'iTest' : undeclared identifier
sqlite3.c(27616) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27645) : error C2065: 'x' : undeclared identifier
sqlite3.c(27664) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27676) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27677) : error C2065: 'pCol' : undeclared identifier
sqlite3.c(27677) : error C2223: left of '->colFlags' must point to
struct/union
sqlite3.c(27677) : error C2065: 'zDflt' : undeclared identifier
sqlite3.c(27678) : error C2065: 'pCol' : undeclared identifier
sqlite3.c(27678) : error C2223: left of '->zName' must point to struct/union
sqlite3.c(27678) : error C2168: 'strlen' : too few actual parameters for
intrins
ic function
sqlite3.c(27678) : warning C4033: 'sqlite3Utf8CharLen' must return a value
sqlite3.c(27686) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27687) : error C2065: 'db' : undeclared identifier
sqlite3.c(27687) : error C2223: left of '->pErr' must point to struct/union
sqlite3.c(27687) : error C2198: 'sqlite3ValueSetNull' : too few arguments
for ca
ll
sqlite3.c(27688) : error C2065: 'db' : undeclared identifier
sqlite3.c(27688) : warning C4047: 'function' : 'sqlite3 *' differs in
levels of
indirection from 'int'
sqlite3.c(27688) : warning C4024: 'sqlite3SystemError' : different types
for for
mal and actual parameter 1
sqlite3.c(27688) : error C2065: 'err_code' : undeclared identifier
sqlite3.c(27696) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27698) : error C2065: 'db' : undeclared identifier
sqlite3.c(27698) : error C2223: left of '->errCode' must point to
struct/union
sqlite3.c(27698) : error C2065: 'err_code' : undeclared identifier
sqlite3.c(27699) : error C2065: 'err_code' : undeclared identifier
sqlite3.c(27699) : error C2065: 'db' : undeclared identifier
sqlite3.c(27699) : error C2223: left of '->pErr' must point to struct/union
sqlite3.c(27699) : warning C4047: 'function' : 'sqlite3 *' differs in
levels of
indirection from 'int'
sqlite3.c(27699) : warning C4024: 'sqlite3ErrorFinish' : different types
for for
mal and actual parameter 1
sqlite3.c(27706) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27707) : error C2065: 'rc' : undeclared identifier
sqlite3.c(27707) : warning C4033: 'sqlite3Utf8CharLen' must return a value
sqlite3.c(27708) : error C2065: 'rc' : undeclared identifier
sqlite3.c(27709) : error C2065: 'rc' : undeclared identifier
sqlite3.c(27710) : error C2065: 'db' : undeclared identifier
sqlite3.c(27710) : error C2223: left of '->iSysErrno' must point to
struct/union
sqlite3.c(27710) : error C2223: left of '->pVfs' must point to struct/union
sqlite3.c(27710) : error C2198: 'sqlite3OsGetLastError' : too few arguments
for
call
sqlite3.c(27735) : error C2143: syntax error : missing ';' before '{'
sqlite3.c(27737) : error C2065: 'db' : undeclared identifier
sqlite3.c(27737) : error C2223: left of '->errCode' must point to

[sqlite] Can't get Dataset Object to Appear in VB.NET 2015

2017-02-14 Thread Craig Bisgeier
Hi Folks
I'm using System.Data.SQLite successfully for a windows application I'm 
developing. However, now I need to create and deploy some reports to go with 
it, and I seem to need a SQLite Dataset / Data Source in the application to 
point the reports to.
I've followed the instructions and tried to install the version that includes 
the design tools for Visual Studio, but I've had no luck getting the data 
source to appear in the Data Sources window of the development environment. 
I've tried several framework versions both on my work PC and home (windows 7 
and 10 respectively) with no luck.
Any suggestions about what I can try? Thank you. Craig Bisgeier
Clifton, NJ
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Richard Hipp
On 2/14/17, Bart Smissaert  wrote:
>
> Should I compile with nmake instead?
> Where should I type that?
>

You can compile however you want, of course. But please know that the
Visual Studio point-and-click IDE interface is neither tested nor
supported.  We developers operate from the command-line, that being
the one true interface for programmers.

To compile, bring up a "VS20xx Native Tools Command Prompt" window,
"cd" into the source directory, and type:

 nmake /f Makefile.msc

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
I am not modifying anything in the source, but I compile with Calling
convention: __stdcall (/Gz)
as I use the .dll for a VB6 ActiveX dll.

I am compiling directly from the VS interface, so via the Build tab and
then Rebuild.
This always worked fine. I just tried with the smaller file:
sqlite-amalgamation-317.zip

and same problem.

Should I compile with nmake instead?
Where should I type that?

Thanks for the assistance.

RBS


On Tue, Feb 14, 2017 at 7:05 PM, Richard Hipp  wrote:

> On 2/14/17, Bart Smissaert  wrote:
> > The problem seems to be with a #define followed by a opening curly brace,
> > also for example:
> > #define WRITE_UTF8(zOut, c) { \
> > at line 27227
> >
> > Could it be that VS needs some setting to recognize this construction?
> >
>
> Why does it work for me when I type:
>
> nmake /f makefile.msc
>
> Are you modifying the source file or the makefile.msc in some way?
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Richard Hipp
On 2/14/17, Bart Smissaert  wrote:
> The problem seems to be with a #define followed by a opening curly brace,
> also for example:
> #define WRITE_UTF8(zOut, c) { \
> at line 27227
>
> Could it be that VS needs some setting to recognize this construction?
>

Why does it work for me when I type:

nmake /f makefile.msc

Are you modifying the source file or the makefile.msc in some way?
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
The problem seems to be with a #define followed by a opening curly brace,
also for example:
#define WRITE_UTF8(zOut, c) { \
at line 27227

Could it be that VS needs some setting to recognize this construction?

 RBS





On Tue, Feb 14, 2017 at 3:32 PM, Simon Slavin  wrote:

>
> On 14 Feb 2017, at 3:06pm, Bart Smissaert 
> wrote:
>
> > Yes, didn't expect this was reproducible.
> > All I can think of is that somehow MSVS doesn't recognize this now as C
> > code.
> > Must be one of the settings in VS that has somehow changed.
>
> Well, I’m not a C whiz, but that code looks like legal C.
>
> Is the VC compiler a C++ compiler ?  I’ve seen problems before from
> compilers which tried to compile SQLite source code files (.c files) as if
> they were C++ files (.cpp files).  The biggest problem here was that the
> errors they indicated were at the 'wrong' place, sometimes even in the
> 'wrong' files, because most C is legal C++.
>
> Simon.
> ___
> 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] Patch for consideration: auto_vacuum slack.

2017-02-14 Thread Chris Brody
On Mon, Feb 13, 2017 at 9:13 PM, Richard Hipp  wrote:
> [...]
> This makes me want to ask:  Is anybody still using auto_vacuum?  And
> if they are, should they be?

I am thinking to change the commonly-used Cordova/PhoneGap sqlite
plugin [1] to enable auto-vacuum by default for the following reasons:
* Potential issues with running a full VACUUM on a mobile app, just
described by Jens Alfke;
* A number of users are beginning programmers who may not read enough
background documentation to understand the importance of periodic
vacuuming.

The sqlite plugin provides an API very similar to the DRAFT Web SQL
API [2]. While this is now deprecated it does provide the flexibility
needed by many users. Considering that [2] does not mention any need
for the web programmer to do periodic vacuuming, I suspect a good Web
SQL implementation should have auto-vacuum enabled by default. Or am I
mistaken somehow?

I would personally vote for this improvement to be included but
perhaps with a compile-time option to leave it out?

[1] https://github.com/litehelpers/Cordova-sqlite-storage
[2] https://www.w3.org/TR/webdatabase/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

2017-02-14 Thread Dâniel Fraga
On Tue, 14 Feb 2017 07:57:17 -0500
Richard Hipp  wrote:

> It does not ignore it, it overwrites it.  The ".mode" command now
> always also sets the ".separator" (to the default separator value) for
> those modes where the separator is used.  This was added to work
> around the unexpected behavior described by
> http://stackoverflow.com/questions/41730574/sqlite-output-mode

Ok, but in the stackoverflow example, the user didn't set
".separator", so I understand it was a bug. 

In my case, I'm explicitly setting the .separator to ",", so it
shouldn't be overwritten. Otherwise, every time I use .mode, I'll have
to set the .separator afterward?

A better solution would be to overwrite the separator *just* if
the user didn't set the separator, otherwise there's no reason anymore
to set the separator in the -init file, since we'll have to set the
separator every single time we use .mode.

-- 



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


Re: [sqlite] Patch for consideration: auto_vacuum slack.

2017-02-14 Thread Jens Alfke

> On Feb 13, 2017, at 12:13 PM, Richard Hipp  wrote:
> 
> Does anybody really care anymore that a
> database file might have a few dozen pages on its freelist?  Or if
> they do care, does anybody lack the temp space sufficient to run a
> real VACUUM?

The issue of vacuuming has confused me for a long time. It’s unclear from the 
docs how necessary it is, or when it should be run, and there’s a lot of 
conflicting advice online.

A small amount of wasted space isn’t a problem, but without vacuuming the 
database file _will never shrink_. ("When auto-vacuum is disabled and data is 
deleted data from a database, the database file remains the same size.”[1]) 
This could lead to large amounts of waste. (We have had developers complain to 
us that our library doesn’t reduce its disk usage after they delete data 
through its API.) It also means that if a user deliberately tries to free up 
storage by deleting app data, they won’t see any improvement, which can be 
frustrating.

Running a full VACUUM is problematic for a mobile app because
* It can take quite a long time if the database is large or if I/O bandwidth is 
low.
* It requires potentially a lot of storage space, at a time when it’s likely 
that free space is low.
* IIRC it blocks access to the database file by all handles while it’s running, 
so it can’t be done while the database is otherwise in use, only when the app 
is quitting or being backgrounded.
* If the process is killed during this activity [as is entirely possible on 
iOS, because the OS will terminate processes that are unresponsive or that keep 
doing stuff too long after they’ve been backgrounded] it will leave large 
amounts of wasted storage behind until it starts again, and all the incremental 
progress of the vacuum is lost.

The strategy I’m using in my current codebase is to enable incremental 
auto_vacuum, and then before closing the database check the free page count. If 
it’s too high, I run an incremental_vacuum. This was suggested by someone’s 
blog post that I neglected to bookmark. So far it seems to work well, but this 
codebase is still in development and hasn’t been through a lot of stress 
testing.

—Jens

[1]: http://www.sqlite.org/pragma.html#pragma_auto_vacuum
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] bug: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 4:42pm, David Raymond  wrote:

> Correct.

Thanks, David.  I'd completely missed what this syntax allowed you to do.

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


Re: [sqlite] bug: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread David Raymond
Correct.



-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Simon Slavin
Sent: Tuesday, February 14, 2017 11:08 AM
To: SQLite mailing list
Subject: Re: [sqlite] bug: fields from external (being updated) table cannot be 
used in "order by" clause of a subselect


On 14 Feb 2017, at 3:55pm, David Raymond  wrote:

> It's not. It sets up an alias to a new view of test. In the where clause the 
> i.whereField is referring to that new view of the whole table, whereas the 
> test.whereField is referring to the field in the current record of test 
> that's being updated.

Is it a self-JOIN then ?  A select where you do something like

SELECT products.id,betterProduct.id FROM products
JOIN products AS betterProduct ON betterProduct.purpose = 
product.purpose
WHERE betterProduct.score > product.score

?

Simon.
___
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: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 3:55pm, David Raymond  wrote:

> It's not. It sets up an alias to a new view of test. In the where clause the 
> i.whereField is referring to that new view of the whole table, whereas the 
> test.whereField is referring to the field in the current record of test 
> that's being updated.

Is it a self-JOIN then ?  A select where you do something like

SELECT products.id,betterProduct.id FROM products
JOIN products AS betterProduct ON betterProduct.purpose = 
product.purpose
WHERE betterProduct.score > product.score

?

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


Re: [sqlite] sqlite3 hangs on query

2017-02-14 Thread Richard Hipp
On 2/14/17, Igor Tandetnik  wrote:
> On 2/14/2017 7:33 AM, Jens-Heiner Rechtien wrote:
>> please consider the attached dump of a sqlite3 database and the
>> following - admittedly nonsensical, don't ask - query over a restored
>> version of the database:
>>
>> *SELECT count(*) FROM spacefavorite, album_asset, albums,
>> assetProfileLinks, avatarCacheReferences, cacheReferences, comment,
>> conflicts, coreInfo, coreMD5, errors, flags, importSource,
>> missingBinariesOnOz, profileRegistration, quota_exceeded,
>> renditionRevisions, space, space_album LIMIT 1;**
>> *
>
> You are asking SQLite to count an enormous number of rows, so don't be
> surprised if that takes an enormous amount of time.
>
> You have a cross-join of 19 tables. Even if each one contains just 2
> rows, that's 2^19 ~ 500K rows to work through. And it grows
> exponentially from there.

I suppose a query planner optimization is possible here.  SQLite could
rewrite queries of the form:

SELECT count(*) FROM t1,t2,t3,t4,...,tN;

Into something like this:

   SELECT (SELECT count(*) FROM t1)*(SELECT count(*) FROM
t2)*...*(SELECT count(*) FROM tN);

I say that it is possible to do this.  But it seems like a low-value
optimization - just something to complicate testing and increase the
library footprint without actually adding value.  So there is nothing
like this on the To-Do list.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] bug: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread David Raymond
It's not. It sets up an alias to a new view of test. In the where clause the 
i.whereField is referring to that new view of the whole table, whereas the 
test.whereField is referring to the field in the current record of test that's 
being updated.

So if the table is things, and whereField is the type of thing, what's 
happening here is for each thing to increment its value by 100 times the least 
valuable thing of the same type.

So what's being commented is that the "least valuable thing" is potentially 
changing after every updated row, rather than being a constant of "the least 
valuable thing as it stood at the start of the update"


-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Simon Slavin
Sent: Tuesday, February 14, 2017 10:41 AM
To: SQLite mailing list
Subject: Re: [sqlite] bug: fields from external (being updated) table cannot be 
used in "order by" clause of a subselect


On 14 Feb 2017, at 3:36pm, James K. Lowden  wrote:

>   UPDATE test
>   SET value = value + 100 * (
>  SELECT min(i.value) -- or max, or something
>  FROM test i
>  WHEREi.whereField = test.whereField
>  );

Someone please explain something to me ?  One of my assumptions is wrong.

The construction "FROM test i" is a short form of "FROM test AS i".  This sets 
up an alias to the table "test" so you can call it "i" if you want to.

Later on in that command I see "WHERE i.whereField = test.whereField".  Under 
the circumstances is that not the same as "WHERE test.whereField = 
test.whereField" ?

Simon.
___
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: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 3:36pm, James K. Lowden  wrote:

>   UPDATE test
>   SET value = value + 100 * (
>  SELECT min(i.value) -- or max, or something
>  FROM test i
>  WHEREi.whereField = test.whereField
>  );

Someone please explain something to me ?  One of my assumptions is wrong.

The construction "FROM test i" is a short form of "FROM test AS i".  This sets 
up an alias to the table "test" so you can call it "i" if you want to.

Later on in that command I see "WHERE i.whereField = test.whereField".  Under 
the circumstances is that not the same as "WHERE test.whereField = 
test.whereField" ?

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
There is a setting in VS and that says compile as C code.
Will start from scratch and make a new VS solution.

RBS



On Tue, Feb 14, 2017 at 3:32 PM, Simon Slavin  wrote:

>
> On 14 Feb 2017, at 3:06pm, Bart Smissaert 
> wrote:
>
> > Yes, didn't expect this was reproducible.
> > All I can think of is that somehow MSVS doesn't recognize this now as C
> > code.
> > Must be one of the settings in VS that has somehow changed.
>
> Well, I’m not a C whiz, but that code looks like legal C.
>
> Is the VC compiler a C++ compiler ?  I’ve seen problems before from
> compilers which tried to compile SQLite source code files (.c files) as if
> they were C++ files (.cpp files).  The biggest problem here was that the
> errors they indicated were at the 'wrong' place, sometimes even in the
> 'wrong' files, because most C is legal C++.
>
> Simon.
> ___
> 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: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread James K. Lowden
On Tue, 14 Feb 2017 15:06:16 +0100
Marek Wieckowski  wrote:

> UPDATE test
> SET value = value + 100 *(
> SELECT i.value
> FROM test i
> WHEREi.whereField = test.whereField
> ORDER BY i.orderField = test.orderField
> LIMIT 1
> );
> 
> Error: no such column: test.orderField

There are other errors, too.  The update is nondeterministic and
nonstandard.  Does this not serve the purpose better?  

UPDATE test
SET value = value + 100 * (
  SELECT min(i.value) -- or max, or something
  FROM test i
  WHEREi.whereField = test.whereField
  );

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


Re: [sqlite] sqlite3 hangs on query

2017-02-14 Thread Igor Tandetnik

On 2/14/2017 7:33 AM, Jens-Heiner Rechtien wrote:

please consider the attached dump of a sqlite3 database and the
following - admittedly nonsensical, don't ask - query over a restored
version of the database:

*SELECT count(*) FROM spacefavorite, album_asset, albums,
assetProfileLinks, avatarCacheReferences, cacheReferences, comment,
conflicts, coreInfo, coreMD5, errors, flags, importSource,
missingBinariesOnOz, profileRegistration, quota_exceeded,
renditionRevisions, space, space_album LIMIT 1;**
*


You are asking SQLite to count an enormous number of rows, so don't be 
surprised if that takes an enormous amount of time.


You have a cross-join of 19 tables. Even if each one contains just 2 
rows, that's 2^19 ~ 500K rows to work through. And it grows 
exponentially from there.

--
Igor Tandetnik

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


Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
Yes, didn't expect this was reproducible.
All I can think of is that somehow MSVS doesn't recognize this now as C
code.
Must be one of the settings in VS that has somehow changed.

RBS

On Tue, Feb 14, 2017 at 2:18 PM, Richard Hipp  wrote:

> On 2/13/17, Bart Smissaert  wrote:
> > Downloaded the latest 3.17.0 (sqlite-autoconf-317.tar.gz
> > ) and
> replaced
> > my old 3.16.2 sqlite3.c file in the VC. Now for some reason I get lots of
> > errors when building a Windows dll.
> > First one is at line 16116 in this code block:
> >
> > #define SQLITE_SKIP_UTF8(zIn) {
> >   if( (*(zIn++))>=0xc0 ){
> > while( (*zIn & 0xc0)==0x80 ){ zIn++; }
> >   }
> > }
> >
> > Error 1 error C2059: syntax error : 'while'
> > Line 16116 is actually the one after the line with while.
>
> I'm not able to reproduce this problem.
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Richard Hipp
On 2/13/17, Bart Smissaert  wrote:
> Downloaded the latest 3.17.0 (sqlite-autoconf-317.tar.gz
> ) and replaced
> my old 3.16.2 sqlite3.c file in the VC. Now for some reason I get lots of
> errors when building a Windows dll.
> First one is at line 16116 in this code block:
>
> #define SQLITE_SKIP_UTF8(zIn) {
>   if( (*(zIn++))>=0xc0 ){
> while( (*zIn & 0xc0)==0x80 ){ zIn++; }
>   }
> }
>
> Error 1 error C2059: syntax error : 'while'
> Line 16116 is actually the one after the line with while.

I'm not able to reproduce this problem.

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


[sqlite] bug: fields from external (being updated) table cannot be used in "order by" clause of a subselect

2017-02-14 Thread Marek Wieckowski
Hi,

Basically: in a subselect in an update statement all  fields from the row
which is being updated CAN be used in SELECT and WHERE clauses (see the
first update below using test.whereField in the WHERE clause), but using
them in ORDER BY leads to an error.


Example:

create table test (
whereField integer,
orderField integer,
value integer);

insert into test (whereField, orderField, value)
values
(0, 0, 10),
(1, 2, 30),
(0, 1, 15),
(1, 0,  7);

UPDATE test
SET value = value + 100 *(
SELECT i.value
FROM test i
WHEREi.whereField = test.whereField
LIMIT 1
);

SELECT * FROM test;
-- whereField  orderField  value
-- --  --  --
-- 0   0   1010
-- 1   2   3030
-- 0   1   101015
-- 1   0   303007

UPDATE test
SET value = value + 100 *(
SELECT i.value
FROM test i
WHEREi.whereField = test.whereField
ORDER BY i.orderField = test.orderField
LIMIT 1
);

Error: no such column: test.orderField


Reproducible with the newest vanilla sqlite:
  sqlite-autoconf-317.tar.gz
  SQLite version 3.17.0 2017-02-13 16:02:40
but the same bug exists in older versions: we noticed it back in September,
see e.g.
http://stackoverflow.com/questions/39350537/sqlite-update-select-query-referencing-table-being-updated-in-order-by-clause/


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


Re: [sqlite] sqlite3 hangs on query

2017-02-14 Thread Clemens Ladisch
Jens-Heiner Rechtien wrote:
> SELECT count(*)
> FROM spacefavorite, album_asset, albums, assetProfileLinks, 
> avatarCacheReferences,
>  cacheReferences, comment, conflicts, coreInfo, coreMD5, errors, flags,
>  importSource, missingBinariesOnOz, profileRegistration, quota_exceeded,
>  renditionRevisions, space, space_album
> LIMIT 1;

The "LIMIT 1" does not have any effect because COUNT() returns only one row.

> this query will busy hang and never return.

It would return if you just waited long enough.

This is how your query would be implemented for five tables:

  sqlite> explain select count(*) from a, b, c, d, e;
  addr  opcode p1p2p3p4 p5  comment
    -        -  --  -
  0 Init   0 27000  Start at 27
  1 Null   0 1 100  r[1..1]=NULL
  2 OpenRead   0 3 0 0  00  root=3 iDb=0; a
  3 OpenRead   1 2 0 0  00  root=2 iDb=0; b
  4 OpenRead   2 4 0 0  00  root=4 iDb=0; c
  5 OpenRead   3 5 0 0  00  root=5 iDb=0; d
  6 OpenRead   4 6 0 0  00  root=6 iDb=0; e
  7 Rewind 0 18000
  8   Rewind 1 17000
  9 Rewind 2 16000
  10  Rewind 3 15000
  11Rewind 4 14000
  12  AggStep0   0 0 1 count(0)   00  
accum=r[1] step(r[0])
  13Next   4 12001
  14  Next   3 11001
  15Next   2 10001
  16  Next   1 9 001
  17Next   0 8 001
  18Close  0 0 000
  ...
  23AggFinal   1 0 0 count(0)   00  accum=r[1] N=0
  24Copy   1 2 000  r[2]=r[1]
  25ResultRow  2 1 000  output=r[2]
  ...

Please note that "," is just the short form of "CROSS JOIN", so this
query is implemented as lots of nested loops.

> admittedly nonsensical

You could speed up this query by deleting the contents of all tables ...


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


Re: [sqlite] sqlite3 hangs on query

2017-02-14 Thread Simon Slavin

On 14 Feb 2017, at 12:33pm, Jens-Heiner Rechtien  wrote:

> please consider the attached dump of a sqlite3 database and the following - 
> admittedly nonsensical, don't ask - query over a restored version of the 
> database

Jens,

You can’t send attachments to this list.  If your dump text is short, you 
should be able to just past it into a message.  If long, please put it on a 
server somewhere.

However, on reading your text I was wondering whether your database is corrupt. 
 Please execute

PRAGMA integrity_check;

on it and tell us whether it returns an error.

You might also try weeding extraneous tables out of your command and see if you 
can find a shorter version of your command which also hangs.  This could mean 
you could demonstrate the problem without creating so many tables.

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


[sqlite] sqlite3 hangs on query

2017-02-14 Thread Jens-Heiner Rechtien

Hi SQLite team,

please consider the attached dump of a sqlite3 database and the 
following - admittedly nonsensical, don't ask - query over a restored 
version of the database:


*SELECT count(*) FROM spacefavorite, album_asset, albums, 
assetProfileLinks, avatarCacheReferences, cacheReferences, comment, 
conflicts, coreInfo, coreMD5, errors, flags, importSource, 
missingBinariesOnOz, profileRegistration, quota_exceeded, 
renditionRevisions, space, space_album LIMIT 1;**

*

On iOS, MacOS and Linux this query will busy hang and never return. 
Happens with the command line tool and if used as a prepared statement 
in our iOS app. Changing certain aspects of the query will resolve the 
problem: leaving the table "spacefavorite" out of the query, or 
replacing count(*) with a just an asterisk.


I tried the following versions:

3.14.0, 3.16.2 (MacOSX Sierra), 3.13.0, 3.17.0 (Linux Fedora 24), 3.14.0 
(iOS 10), always the same behavior.


Many thanks for your consideration and especially for your great tool.

Heiner

--

Jens-Heiner Rechtien >

Computer Scientist

Adobe Systems Engineering GmbH

Große Elbstraße 27

22767 Hamburg


Registergericht: Hamburg HRB 745 37

Geschäftsführer: Michael D. Jamrosy, Christian Keim, Thomas Mührke, 
Keith San Felipe





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


Re: [sqlite] 3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

2017-02-14 Thread Richard Hipp
On 2/13/17, Dâniel Fraga  wrote:
>
>   The problem is that with version 3.17.0 the .mode line
> completely ignore the ".separator ," inside the "-init" file.
>

It does not ignore it, it overwrites it.  The ".mode" command now
always also sets the ".separator" (to the default separator value) for
those modes where the separator is used.  This was added to work
around the unexpected behavior described by
http://stackoverflow.com/questions/41730574/sqlite-output-mode

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


Re: [sqlite] sqlite3_blob_bytes64() ?

2017-02-14 Thread Olivier Mascia
> Le 14 févr. 2017 à 12:46, Clemens Ladisch  a écrit :
> 
> Olivier Mascia wrote:
>> What is the purpose of sqlite3_bind_blob64() and sqlite3_bind_zeroblob64()?
> 
> To allow 64-bit types (but not necessarily 64-bit values).  IIRC some
> language binding needed this.

Seems indeed the only logical reason.
Just a bit strange those same language bindings would have no use for a 64 bit 
sqlite3_blob_bytes64() though.
Anyway not important. Thanks!

-- 
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia, http://integral.software



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


Re: [sqlite] sqlite3_blob_bytes64() ?

2017-02-14 Thread Clemens Ladisch
Olivier Mascia wrote:
> What is the purpose of sqlite3_bind_blob64() and sqlite3_bind_zeroblob64()?

To allow 64-bit types (but not necessarily 64-bit values).  IIRC some
language binding needed this.


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


[sqlite] Documentation change in 3.17.0

2017-02-14 Thread rhuijben
Hi,

The diff from 3.16.2 -> 3.17.0 contains
[[
** table that is being modified.
-** ^The sixth parameter to the preupdate callback is the initial [rowid] of
the
-** row being changes for SQLITE_UPDATE and SQLITE_DELETE changes and is
-** undefined for SQLITE_INSERT changes.
-** ^The seventh parameter to the preupdate callback is the final [rowid] of
-** the row being changed for SQLITE_UPDATE and SQLITE_INSERT changes and is
-** undefined for SQLITE_DELETE changes.
 **
+** For an UPDATE or DELETE operation on a [rowid table], the sixth
+** parameter passed to the preupdate callback is the initial [rowid] of the
+** row being modified or deleted. For an INSERT operation on a rowid table,
+** or any operation on a WITHOUT ROWID table, the value of the sixth
+** parameter is undefined. For an INSERT or UPDATE on a rowid table the
+** seventh parameter is the final rowid value of the row being inserted
+** or updated. The value of the seventh parameter passed to the callback
+** function is not defined for operations on WITHOUT ROWID tables, or for
+** INSERT operations on rowid tables.
+**
 ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
 ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
 ** provide additional information about a preupdate event. These routines
 ** may only be called from within a preupdate callback.  Invoking any of
 ** these routines from outside of a preupdate callback or with a
]]

I think that last
+** INSERT operations on rowid tables.

Should be
+** DELETE operations on rowed tables.

for it to declare the same undefined behavior on normal tables before and
after 3.17.0.
(I assume the intended change was just documenting the new without rowid
table behavior)

Bert

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


[sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Bart Smissaert
Downloaded the latest 3.17.0 (sqlite-autoconf-317.tar.gz) and replaced
my old 3.16.2 sqlite3.c file in the VC. Now for some reason I get lots of
errors when building a Windows dll.

First one is at line 16116 in this code block:

#define SQLITE_SKIP_UTF8(zIn) {
  if( (*(zIn++))>=0xc0 ){
while( (*zIn & 0xc0)==0x80 ){ zIn++; }
  }
}
Error 1 error C2059: syntax error : 'while'
Line 16116 is actually the one after the line with while.

Have updated to newer versions many times before any seen any problem like
this.
I am sure I must be overlooking something simple, but just can't see it.
Any suggestions?

RBS

(I posted this already before, yesterday, but it didn't appear in the list
for some reason)
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users