[sqlite] Banking calender (was: Question about floating point)

2018-12-19 Thread Hick Gunter
> ...Even bankers, ever counting pennies, approximate to compute interest and > averages. Little known fact: sometimes they compute interest on the basis of > a 360-day year. > >--jkl > Bankers calculate interest for 30 days per month, independent of the actual number of days, leaving 5 days

Re: [sqlite] SQLite Application Question

2018-12-19 Thread Chris Locke
What application are you using to build your application? You mentioned Visual Studio, so .NET? If so, are you using the SQLite library from system.data.sqlite.org? Are you using c# or vb? My settings table is a lot simpler. id, setting and value. 3 columns. Possibly 4, adding a 'code'

Re: [sqlite] SQLite Application Question

2018-12-19 Thread Roger Schlueter
On 12/19/2018 10:02, Jens Alfke wrote: On Dec 18, 2018, at 7:46 PM, Roger Schlueter wrote: I am starting work on a prototype application so this might be an excellent opportunity to use SQLite for my application file format. Part of this would be the saving and restoring of GUI elements

Re: [sqlite] Question about floating point

2018-12-19 Thread James K. Lowden
On Tue, 18 Dec 2018 17:34:29 -0500 Dennis Clarke wrote: > some serious reading and experiments are needed to get a good > handle on why numerical computation is as much art as it is science. > If we wander into the problem without sufficient study and VERY > careful consideration then we are

Re: [sqlite] Claimed vulnerability in SQLite: Info or Intox?

2018-12-19 Thread Peter da Silva
sqlite is not immune to wandering through bad pointers, because code coverage tests don't test for malicious data... I found a null pointer crash in sqlite earlier this year. I could see Mallory crafting a database that had carefully corrupted structures in it that smashed the stack.

Re: [sqlite] Question about floating point

2018-12-19 Thread Gerry Snyder
On Wed, Dec 19, 2018 at 4:57 PM Keith Medcalf wrote: > > > >All I meant was that with a decimal exponent, the units could be > >dollars, > >and additions and subtractions of cents would be exact (assuming the > >mantissa has enough bits), with no worries about rounding. Which is > >the > >basis

Re: [sqlite] Question about floating point

2018-12-19 Thread Keith Medcalf
>All I meant was that with a decimal exponent, the units could be >dollars, >and additions and subtractions of cents would be exact (assuming the >mantissa has enough bits), with no worries about rounding. Which is >the >basis for this whole discussion. This is called fixed point. All that is

Re: [sqlite] Question about floating point

2018-12-19 Thread Gerry Snyder
On Mon, Dec 17, 2018 at 10:04 AM Larry Brasfield wrote: > Gerry Snyder wrote: > < I don't think anyone has pointed out that the "evil" is not floating > point, it is the binary exponent. > > Disregarding the “evil” appellation, the fundamental fact is that, with > modern floating point hardware

Re: [sqlite] "make test" fails on Mageia Linux v7 x86-64

2018-12-19 Thread Dan Kennedy
On 12/19/2018 12:55 AM, Shlomi Fish wrote: Hi, With the attached bash script on Mageia Linux v7 x86-64 I consistently get the test failures here: https://www.shlomifish.org/Files/files/text/sqlite-mga7-rpm-build.txt.xz this is with sqlite 3.26.0. This affects our rpm %check phase. Can you

Re: [sqlite] Claimed vulnerability in SQLite: Info or Intox?

2018-12-19 Thread Simon Slavin
On 19 Dec 2018, at 6:19pm, Jens Alfke wrote: > 2. Mallory uses something like the ’sqlite3’ tool to open the database and > execute a CREATE TRIGGER statement whose trigger SQL exploits a vulnerability > to do something nasty like remote code execution. I'm not sure how you would do that

Re: [sqlite] Claimed vulnerability in SQLite: Info or Intox?

2018-12-19 Thread Jens Alfke
> On Dec 18, 2018, at 2:13 PM, Richard Hipp wrote: > > I am not aware of any other applications that deliberately run SQL > from anonymous sources In applications that use SQLite databases as a file format, couldn’t a malicious document be created that uses a trigger to run SQL that triggers

Re: [sqlite] SQLite Application Question

2018-12-19 Thread Simon Slavin
On 19 Dec 2018, at 6:02pm, Jens Alfke wrote: > Of course you can save the JSON in the database file. Just create a ‘prefs’ > table with one blob column for the JSON. > > A related solution is to store each named pref as a row in the ‘prefs’ table, > identified by a ‘key’ column. Or you could

Re: [sqlite] SQLite Application Question

2018-12-19 Thread Jens Alfke
> On Dec 18, 2018, at 7:46 PM, Roger Schlueter wrote: > > I am starting work on a prototype application so this might be an excellent > opportunity to use SQLite for my application file format. Part of this would > be the saving and restoring of GUI elements such as window positions and >

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Chris Locke
> Then add foreign key constraints so the relations between the tables > are explicit... On the GitHub page for the database, it states that, "RowIds, Foreign keys, secondary keys, defaults and cascade have not been ported." Most of the tools to create a 'proper' database... But otherwise, an

Re: [sqlite] [EXTERNAL] Re: Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Hick Gunter
Perhaps it is designed to be "somewhat nonstandard" in order to enable edge cases in testing. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Chris Locke Gesendet: Mittwoch, 19. Dezember 2018 11:55 An: SQLite mailing list

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Shawn Wagner
I'd start by making the employees table a normal rowid one with an INTEGER PRIMARY KEY (*Not* INT) column, and change all those VARCHAR, CHAR and DATE column types to TEXT (or NUMERIC for the dates depending on the values they hold). Then add foreign key constraints so the relations between the

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Arun - Siara Logics (cc)
Hi Chris, I don't own the MySQL side of the db, but its easy for me to change anything on Sqlite side. To me the data looks decent for testing and creating applications for demo or learning. I am giving below the script and I will incorporate any other suggestions you may come up with:

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Chris Locke
The scheme (for me) is like nails on a chalkboard. 'dept_no' but defined as a 'CHAR', then 'emp_no' as an INT. Fields with '_no' are read as 'number' and so should be a number. OK, that doesn't always work for 'telephone_no' (they usually start with a 0 ... well, they do in the UK where I am...)

Re: [sqlite] Claimed vulnerability in SQLite: Info or Intox?

2018-12-19 Thread Dominique Devienne
On Wed, Dec 19, 2018 at 11:14 AM Richard Hipp wrote: > > Could there be a way to make shadow tables off-limit to arbitrary SQL? > > That is one of the things that the new SQLITE_DBCONFIG_DEFENSIVE > option does - it makes shadow tables read-only so that they cannot be > corrupted by SQL. > May

Re: [sqlite] Claimed vulnerability in SQLite: Info or Intox?

2018-12-19 Thread Richard Hipp
> > Could there be a way to make shadow tables off-limit to arbitrary SQL? That is one of the things that the new SQLITE_DBCONFIG_DEFENSIVE option does - it makes shadow tables read-only so that they cannot be corrupted by SQL. However, it is off by default, since some application make use of

Re: [sqlite] Claimed vulnerability in SQLite: Info or Intox?

2018-12-19 Thread Dominique Devienne
On Tue, Dec 18, 2018 at 11:13 PM Richard Hipp wrote: > On 12/18/18, Dominique Devienne wrote: > > https://blade.tencent.com/magellan/index_en.html > > > > Sounds to me it's more related to a "remote callable" program like > Chrome, > > than SQLite proper, but I'd like an official stance on

[sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Arun - Siara Logics (cc)
This project (https://github.com/siara-cc/employee_db) hosts the Sqlite3 db file ported from mysql test_db found at https://github.com/datacharmer/test_db. It can be used to test your applications and database servers. To use this project, download employees.db.bz2, unzip and open using sqlite3