Re: [sqlite] lock base

2017-09-29 Thread Simon Slavin
On 30 Sep 2017, at 3:18am, MONSTRUO Hugo González wrote: > When I record a new record I must put a code equal to the major + 1. Why ? Can’t you have one table use numbers from 100 upwards and the other use numbers from 200 upwards ? Simon.

Re: [sqlite] lock base

2017-09-29 Thread Simon Slavin
On 30 Sep 2017, at 3:43am, Simon Slavin wrote: > See FAQ number 1: I’m sorry. I misunderstood the question. Please ignore that post. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] lock base

2017-09-29 Thread Keith Medcalf
Start a transaction with BEGIN IMMEDIATE Execute the selects necessary to compute "major" Execute the "insert" COMMIT the transaction Write operations are always exclusive. You merely need to start the "I need to write something" transaction before you read the database so that no one else

Re: [sqlite] lock base

2017-09-29 Thread Simon Slavin
On 30 Sep 2017, at 3:18am, MONSTRUO Hugo González wrote: > I have a network of computers that share a SQLite file. > Two tables share sales information: current and historical. > When I record a new record I must put a code equal to the major + 1. > I need to put

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread J Decker
On Fri, Sep 29, 2017 at 5:12 PM, Richard Damon wrote: > On 9/29/17 2:58 PM, J Decker wrote: > >> 20 warnings “cast discards __attribute__((noreturn))” like: >>> >>> SQLite3.c:55734:10: warning: cast discards ‘__attribute__((noreturn))’ >>> qualifier from pointer target

[sqlite] lock base

2017-09-29 Thread MONSTRUO Hugo González
I have a network of computers that share a SQLite file. Two tables share sales information: current and historical. When I record a new record I must put a code equal to the major + 1. I need to put the database in exclusivity to avoid recording records with the same code. How I do this ?

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Richard Damon
On 9/29/17 2:58 PM, J Decker wrote: 20 warnings “cast discards __attribute__((noreturn))” like: SQLite3.c:55734:10: warning: cast discards ‘__attribute__((noreturn))’ qualifier from pointer target type [-Wcast-qual] memcpy((void*)[1], (const void*)>hdr, sizeof(WalIndexHdr)); 768 warnings

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Bob Friesenhahn
On Fri, 29 Sep 2017, Denis V. Razumovsky wrote: In this very thread there is a warning from GCC about #if SQLITE_4_BYTE_ALIGNED_MALLOC What can be wrong for _any_ of the compilers if you will define SQLITE_4_BYTE_ALIGNED_MALLOC as 0 in sqlite3.h? It's so simple. I think it should only get

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Igor Korot
Simon, On Fri, Sep 29, 2017 at 4:38 PM, Simon Slavin wrote: > > > On 29 Sep 2017, at 9:06pm, Denis V. Razumovsky wrote: > >> What can be wrong for _any_ of the compilers if you will define >> SQLITE_4_BYTE_ALIGNED_MALLOC as 0 in sqlite3.h? It's so simple. I

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Simon Slavin
On 29 Sep 2017, at 9:06pm, Denis V. Razumovsky wrote: > What can be wrong for _any_ of the compilers if you will define > SQLITE_4_BYTE_ALIGNED_MALLOC as 0 in sqlite3.h? It's so simple. I think > it should only get better for all platforms and compilers ) If

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
On 29.09.2017 22:33, Scott Robison wrote: > On Fri, Sep 29, 2017 at 1:20 PM, Bob Friesenhahn > wrote: >> > On Fri, 29 Sep 2017, Scott Robison wrote: >>> >> >>> >> >>> >> The problem is that there is no one best practice for resolving all >>> >> such warnings in a

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
Many thanks to Mr. J Decker. I'm glad if I've made anybody think about that warnings. My mission is complete if it's true. On 29.09.2017 21:58, J Decker wrote: > On Fri, Sep 29, 2017 at 1:07 AM, Denis V. Razumovsky wrote: > >> Please remove multiple warnings from compiler about

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
I am absolutely sure that sqlite is one of the best and the most tested software product in the nature and having such a point of view I was rather surprised at number of warnings coming from the compiler. I have no plans to thrust my opinion on the community, just to draw attention to the

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Scott Robison
On Fri, Sep 29, 2017 at 1:20 PM, Bob Friesenhahn wrote: > On Fri, 29 Sep 2017, Scott Robison wrote: >> >> >> The problem is that there is no one best practice for resolving all >> such warnings in a way that makes all compilers happy. It is possible >> to fix all the

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Bob Friesenhahn
On Fri, 29 Sep 2017, Scott Robison wrote: The problem is that there is no one best practice for resolving all such warnings in a way that makes all compilers happy. It is possible to fix all the warnings for one platform, then move on to the next platform and fix all its warnings, and return to

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread J Decker
On Fri, Sep 29, 2017 at 11:58 AM, J Decker wrote: > > > On Fri, Sep 29, 2017 at 1:07 AM, Denis V. Razumovsky wrote: > >> >> SQLite3.c:55734:10: warning: cast discards ‘__attribute__((noreturn))’ >> qualifier from pointer target type [-Wcast-qual] >>

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread J Decker
On Fri, Sep 29, 2017 at 1:07 AM, Denis V. Razumovsky wrote: > Please remove multiple warnings from compiler about optimisation, > variable conversion, signed overflow and many more potential errors. > > 1. Optimisation solutions from GCC: > If you would like to add extra warning

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Simon Slavin
On 29 Sep 2017, at 6:14pm, Denis V. Razumovsky wrote: > Rule 10: All code must be compiled, from the first day of development, > with all compiler warnings enabled at the most > pedantic setting available. All code must compile without warnings. NASA's code is developed to run

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Scott Robison
On Fri, Sep 29, 2017 at 11:14 AM, Denis V. Razumovsky wrote: > I would like to draw attention to the document: "The Power of 10: Rules > for Developing Safety-Critical Code" from NASA/JPL Laboratory. >

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Richard Hipp
On 9/29/17, Jens Alfke wrote: > > it’s not a good idea to walk into a community and > immediately tell everyone that they’re doing things the wrong way It's worse than that. The very first sentence we heard from Mr. Razumovsky was an imperative: "Remove warnings!". And

Re: [sqlite] Joining list?

2017-09-29 Thread bensonbear
aps writes: | I am trying to join the sqlite3-users list to ask a | technical question but I never receive a response from the | Mailman (and no it isn't in my Spam folder either). Oops, I also was trying to join and also kept not getting responses. Also it told me I was not a subscriber when I

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Jens Alfke
> On Sep 29, 2017, at 10:14 AM, Denis V. Razumovsky wrote: > > I would like to draw attention to the document: "The Power of 10: Rules > for Developing Safety-Critical Code" from NASA/JPL Laboratory. >

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
I would like to draw attention to the document: "The Power of 10: Rules for Developing Safety-Critical Code" from NASA/JPL Laboratory. https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Developing_Safety-Critical_Code They tells, for example: Rule 10: All code must be compiled, from

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Jens Alfke
> On Sep 29, 2017, at 1:07 AM, Denis V. Razumovsky wrote: > > Please remove multiple warnings from compiler about optimisation, > variable conversion, signed overflow and many more potential errors. This comes up a lot. SQLite is incredibly thoroughly tested* and

Re: [sqlite] FULLMUTEX and exclusive transactions between threads

2017-09-29 Thread pisymbol .
On Thu, Sep 28, 2017 at 9:18 PM, Keith Medcalf wrote: > > If they are both using the same connection, yes. Transaction state is an > attribute of the connection, not the statement or thread. > > Thanks everybody for the explanations! I have moved to a connection per thread

[sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-09-29 Thread Denis V. Razumovsky
Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors. 1. Optimisation solutions from GCC: If you would like to add extra warning attributes to compile SQLite with gcc (and many others modern compilers) you will see