Re: [sqlite] EXT :Re: Compiling SQLite3 with MSVC 2010

2012-11-05 Thread Black, Michael (IS)
For gcc try -Wextra and -Wconversion.
You'll get tons of warnings. -Wall just does the ones most people are concerned 
with.

Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit
Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Igor Korot [ikoro...@gmail.com]
Sent: Sunday, November 04, 2012 2:12 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] EXT :Re: Compiling SQLite3 with MSVC 2010

Michael,

On Sun, Nov 4, 2012 at 5:59 AM, Black, Michael (IS)
michael.bla...@ngc.com wrote:
 Hmmm...interesting...I'm using VS 2010 Express 32-bit and I would've assumed 
 the warnings would match.  I also enabled SQLITE_64BIT_STATS to try and force 
 the first warning but that didn't cause it.
 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 
 80x86

Well, I'm getting it with Professional build of 32-bits.


 That's a bit disconcerting actually but I guess Express is less pedantic than 
 Studio.

 You can always stick this in to shut it up.  There's a yin yang to fixing 
 thesesimple enough to throw a cast in there...but down the road if you 
 make other changes on the right-hand-side datatype that could be of use so 
 you would be suppressing a valid warning.  It's a mixed bag.  So suppressing 
 warnings from picky compilers is the best way to go.

 Do you still see then on lower levels?

Not with /W3.
But it's interesting that -Wall does not produce them with gcc...

Thank you.


 #pragma warning(disable: 4244) // possible loss of data



 Michael D. Black
 Senior Scientist
 Advanced Analytics Directorate
 Advanced GEOINT Solutions Operating Unit
 Northrop Grumman Information Systems

 
 From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
 behalf of Jonas Malaco Filho [jonasmalacofi...@gmail.com]
 Sent: Saturday, November 03, 2012 3:48 PM
 To: General Discussion of SQLite Database
 Subject: EXT :Re: [sqlite] Compiling SQLite3 with MSVC 2010

 Actually, on MSVC 2010 I just got the following errors with /W3:

 -- Rebuild All started: Project: Shell, Configuration: Release x64
 --
   shell.c
   sqlite3.c
 ..\src\sqlite3.c(78502): warning C4244: 'initializing' : conversion from
 'sqlite_int64' to 'tRowcnt', possible loss of data
 ..\src\sqlite3.c(78503): warning C4244: 'initializing' : conversion from
 'sqlite_int64' to 'tRowcnt', possible loss of data
 ..\src\sqlite3.c(78504): warning C4244: 'initializing' : conversion from
 'sqlite_int64' to 'tRowcnt', possible loss of data
 ..\src\sqlite3.c(104145): warning C4244: '=' : conversion from 'i64' to
 'double', possible loss of data
 ..\src\sqlite3.c(104170): warning C4244: '=' : conversion from 'i64' to
 'double', possible loss of data
   Generating code
   Finished generating code
   Shell.vcxproj -
 X:\jonas-malaco-filho\lib\SQLite\Shell\..\bin\x86-64\sqlite3.exe
 -- Rebuild All started: Project: Shell, Configuration: Release Win32
 --
   shell.c
   sqlite3.c
 ..\src\sqlite3.c(78502): warning C4244: 'initializing' : conversion from
 'sqlite_int64' to 'tRowcnt', possible loss of data
 ..\src\sqlite3.c(78503): warning C4244: 'initializing' : conversion from
 'sqlite_int64' to 'tRowcnt', possible loss of data
 ..\src\sqlite3.c(78504): warning C4244: 'initializing' : conversion from
 'sqlite_int64' to 'tRowcnt', possible loss of data
 ..\src\sqlite3.c(104145): warning C4244: '=' : conversion from 'i64' to
 'double', possible loss of data
 ..\src\sqlite3.c(104170): warning C4244: '=' : conversion from 'i64' to
 'double', possible loss of data
   Generating code
   Finished generating code
   Shell.vcxproj -
 X:\jonas-malaco-filho\lib\SQLite\Shell\..\bin\x86\sqlite3.exe
 == Rebuild All: 2 succeeded, 0 failed, 0 skipped ==


 *Jonas Malaco Filho*



 2012/11/3 Black, Michael (IS) michael.bla...@ngc.com

 You probably have the warning level turned up high.

 Up to level 3 it compiles without warnings.  Level 4 starts complaining
 loudly.


 Michael D. Black
 Senior Scientist
 Advanced Analytics Directorate
 Advanced GEOINT Solutions Operating Unit
 Northrop Grumman Information Systems

 
 From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
 on behalf of Igor Korot [ikoro...@gmail.com]
 Sent: Friday, November 02, 2012 6:25 PM
 To: General Discussion of SQLite Database
 Subject: EXT :Re: [sqlite] Compiling SQLite3 with MSVC 2010

 Richard,

 On Fri, Nov 2, 2012 at 4:14 PM, Richard Hipp d...@sqlite.org wrote:
  On Fri, Nov 2, 2012 at 7:05 PM, Igor Korot ikoro...@gmail.com wrote:
 
  Hi, ALL,
  Is anybody trying to compile SQLite with MSVC 2010?
 
 
  Tests 9e and 9f at http://www.sqlite.org/checklists/3071400#c9 were
  performed using MSVC 2010.
 
 
 
  I am getting a lot of warnings.
  Is there any interest in fixing 

[sqlite] Required help on Sqlite+TCL -testsuit

2012-11-05 Thread brijesh_philips
Hi,

I am New to sqlite and TCL. I need information regarding,

1. Where i can download TCL Testsuit to test sqlite ? 
I am using Cygwin environment , testsits are available for cygwin
environment ? Does the same run on Linux too ?

2. How to install / compile and run these testsuits ?

A reply is really appreciated...


Thanks in advance

Brijesh



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Required-help-on-Sqlite-TCL-testsuit-tp65374.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Required help on Sqlite+TCL -testsuit

2012-11-05 Thread brijesh_philips
I have the sqlite-amalgamation-3071401 and binaries for the TCL also
extracted to the root directory respective folders...



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Required-help-on-Sqlite-TCL-testsuit-tp65374p65375.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Required help on Sqlite+TCL -testsuit

2012-11-05 Thread Richard Hipp
On Mon, Nov 5, 2012 at 5:38 AM, brijesh_philips brijeshk_...@yahoo.comwrote:

 Hi,

 I am New to sqlite and TCL. I need information regarding,

 1. Where i can download TCL Testsuit to test sqlite ?
 I am using Cygwin environment , testsits are available for cygwin
 environment ? Does the same run on Linux too ?

 2. How to install / compile and run these testsuits ?

 A reply is really appreciated...


Download and install ActiveTcl.  http://www.activestate.com/activetcl

To compile and test using MSVC, first download and install the SQLite
source tree, then type::  nmake /f makefile.msc test

To compile and test using GCC, install mingw and msys (not cygwin) and then
type: sh configure; make test








 Thanks in advance

 Brijesh



 --
 View this message in context:
 http://sqlite.1065341.n5.nabble.com/Required-help-on-Sqlite-TCL-testsuit-tp65374.html
 Sent from the SQLite mailing list archive at Nabble.com.
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users




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


[sqlite] Anybody using REGEXP in the ICU extension?

2012-11-05 Thread Richard Hipp
Is anybody using the REGEXP operator that is included with the ICU
extension of SQLite?

The reason I ask is that the current ICU REGEXP implementation is broken.
We are wanting to fix it.  But the fix runs a serious risk of breaking any
legacy applications that depend on the old broken behavior.

The brokenness is this:  The ICU REGEXP operator assumes that every pattern
string begins with ^ and ends with $.  In other words, the pattern must
match the entire string.  This is how LIKE and GLOB work.  But we are
thinking that most users expect a REGEXP pattern to match any substring of
the input, unless the ^ prefix and/or $ suffix are used.

ICU experts: The fix we want to make is to use uregex_find() instead of
uregex_matches().

Will any legacy code break if we fix the ICU REGEXP operator to do what
programmers normally expect?

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


Re: [sqlite] SQLite on Windows Phone 8

2012-11-05 Thread Peter Naldal
Has anybody tried to install SQLite for Windows Phone 8?
Any success?
I can install it. It shows up fine under References, but then what? The
Object Browser shows nothing.
What namespace can I reference?  What classes can I use?
\Peter

Original message:
**
Topic: [sqlite] SQLite on Windows Phone 8
Hi
Visual Studio 2012 for Windows Phone offers installation of SQLite for
Windows Phone 8 as an extension. To enable programming against this
extension a wrapper component or library needs to be installed. I am using
sqlite-net installed via NuGet. But when compiling SQLite.cs, the compiler
complains that the namespace Community.CsharpSqlite is not found. The same
procedure works just fine in Visual Studio 2012 for Windows 8. For Windows
Phone a DLL is needed that includes the Community.CsharpSqlite namespace. I
have three questions:
1.  Has anyone allready build this DLL (Community.CsharpSqlite.WP.dll), that
is needed for sqlite-net?
2.  How do I compile the DLL myself?
3.  Are there other ways to utilize the SQLite for Windows Phone 8
extension?
I eagerly awaits your comments and answers.
\Peter Naldal
**

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


Re: [sqlite] SQLite on Windows Phone 8

2012-11-05 Thread Joe Mistachkin

Peter Naldal wrote:

 Original message:
 **
 Topic: [sqlite] SQLite on Windows Phone 8
 Hi
 Visual Studio 2012 for Windows Phone offers installation of SQLite for
 Windows Phone 8 as an extension. To enable programming against this
 extension a wrapper component or library needs to be installed. I am using
 sqlite-net installed via NuGet. But when compiling SQLite.cs, the compiler
 complains that the namespace Community.CsharpSqlite is not found. The same
 procedure works just fine in Visual Studio 2012 for Windows 8. For Windows
 Phone a DLL is needed that includes the Community.CsharpSqlite namespace.
I
 have three questions:
 1.  Has anyone allready build this DLL (Community.CsharpSqlite.WP.dll),
that
 is needed for sqlite-net?
 2.  How do I compile the DLL myself?
 3.  Are there other ways to utilize the SQLite for Windows Phone 8
 extension?
 I eagerly awaits your comments and answers.
 \Peter Naldal
 **
 

Did you see the response I sent previously?

http://www.mail-archive.com/sqlite-users%40sqlite.org/msg73619.html

--
Joe Mistachkin

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


Re: [sqlite] Anybody using REGEXP in the ICU extension?

2012-11-05 Thread Alexey Pechnikov
I use REGEXP operator from ICU extension but the patch will not break my
applications.

2012/11/5 Richard Hipp d...@sqlite.org

 Is anybody using the REGEXP operator that is included with the ICU
 extension of SQLite?

 The reason I ask is that the current ICU REGEXP implementation is broken.
 We are wanting to fix it.  But the fix runs a serious risk of breaking any
 legacy applications that depend on the old broken behavior.

 The brokenness is this:  The ICU REGEXP operator assumes that every pattern
 string begins with ^ and ends with $.  In other words, the pattern must
 match the entire string.  This is how LIKE and GLOB work.  But we are
 thinking that most users expect a REGEXP pattern to match any substring of
 the input, unless the ^ prefix and/or $ suffix are used.

 ICU experts: The fix we want to make is to use uregex_find() instead of
 uregex_matches().

 Will any legacy code break if we fix the ICU REGEXP operator to do what
 programmers normally expect?

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




-- 
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite on Windows Phone 8

2012-11-05 Thread Noah Hart
Hello Peter,

This is a common configuration.

Please visit the C#SQLite project here: 
http://code.google.com/p/csharp-sqlite/

and post questions to the usergroup here: 
https://groups.google.com/forum/?fromgroups#!forum/csharp-sqlite

Please keep in mind the following:

This is not an official version of SQLite
There is completely NO affiliation with SQLite.org
Bugs should not be reported to their ticket tracking system 

Thank you,
Noah Hart





--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/SQLite-on-Windows-Phone-8-tp65316p65382.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with create … from … order by on largish data

2012-11-05 Thread Tod Olson
Is there a predicted next release date? Or more to the point,
does anyone have a guess about when the fix for that 32-bit int
overflow error will be in general release?

-Tod

On Nov 3, 2012, at 3:18 PM, Tod Olson t...@uchicago.edu wrote:

 
 On Nov 3, 2012, at 7:32 AM, Richard Hipp d...@sqlite.org
 wrote:
 
 On Fri, Nov 2, 2012 at 6:44 PM, Tod Olson t...@uchicago.edu wrote:
 
 I'm having a problem with a create … from … order by when my data starts
 approaching 2GB. I'm using SQLite 3.7.14 on FreeBSD 8.3-RELEASE-p3.
 
 The processing starts with an unsorted table, created thus:
 
   CREATE TABLE all_headings (key, heading);
 
 Then it creates a sorted version of the table:
 
   create table headings as select * from all_headings order by key;
 
 This is fine on small data, but when I load 1.8GB of data (8.8 million
 rows) the second CREATE fails, reporting a disk I/O error.
 
 
 You might be running out of /tmp space.  Do you have plenty of /tmp space
 available for use by the sorter.
 
 Plenty, 14GB of free space available to /tmp (it's all one big partition).
 
 You might also be running into the 32-bit integer overflow bug that was
 fixed at http://www.sqlite.org/src/info/e24ba5bee4 though normally that
 requires a great deal more than 1.8GB of data.
 
 Yes! I compiled up that version and it solves the problem.
 
 I eagerly await the release of SQLite version 3.7.15.
 
 Thank you for your help.
 
 -Tod
 
 Please enable error logging using SQLITE_CONFIG_LOG (
 http://www.sqlite.org/c3ref/c_config_getmalloc.html#sqliteconfiglog) and
 rerun your query and see if that provides any additional clues.
 
 
 If I remove the order by clause, the create succeeds. (SQLite was
 compiled with large file support, and I could create a 4GB database using
 .import so it's not a file system limitation, and the /tmp space is plenty
 large.)
 
 [At that point it looks like pre-sorting the data before loading has some
 appeal, but the code maintainer prefers to treat SQLite as the authority on
 sorting rather to mess with the many versions of sort(1) on the various
 UNIXes and Windows. I understand his point.]
 
 So trying to understand the error with the ORDER BY clause, I loaded up
 the unsorted all_headings table and then trussed sqlite3 running the CREATE
 TABLE…ORDER BY. Before the error, there's a lot of lseek()/read() of the
 .db file, and a lot of lseek()/write() to temp file (in /tmp, I assume this
 is the sort space). Then there's a read() of the temp file, which returns
 an error. From truss:
 
   read(5,0x800f64108,-1834983915) ERR#22 'Invalid argument'
 
 man 2 read says read's type signature is:
 
   ssize_t read(int d, void *buf, size_t nbytes);
 
 and it says this about read returning errno 22:
 
   [EINVAL] The pointer associated with d was negative.
   [EINVAL] The value nbytes is greater than INT_MAX.
 
 The pointer doesn't look negative, but that nbytes argument looks possibly
 a problem. size_t is 64-bit on this system, but INT_MAX = 2147483647, or
 the max for a 32-bit signed int. Though truss doesn't know signed from
 unsigned valued, the size_t nbytes value that truss reports is greater than
 MAX_INT. So I think that explains the error.
 
 The main question is: is there anything to be done to get that CREATE
 TABLE … ORDER BY to work? Based on the truss output, I suspect not, but
 maybe someone here has run into the problem before.
 
 Thanks,
 
 -Tod
 
 
 Tod Olson t...@uchicago.edu
 Systems Librarian
 University of Chicago Library
 
 
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
 
 
 -- 
 D. Richard Hipp
 d...@sqlite.org
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 

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


Re: [sqlite] Problem with create … from … order by on largish data

2012-11-05 Thread Richard Hipp
On Mon, Nov 5, 2012 at 3:58 PM, Tod Olson t...@uchicago.edu wrote:

 Is there a predicted next release date? Or more to the point,
 does anyone have a guess about when the fix for that 32-bit int
 overflow error will be in general release?


http://www.sqlite.org/draft/
http://www.sqlite.org/draft/releaselog/3_7_15.html




 -Tod

 On Nov 3, 2012, at 3:18 PM, Tod Olson t...@uchicago.edu wrote:

 
  On Nov 3, 2012, at 7:32 AM, Richard Hipp d...@sqlite.org
  wrote:
 
  On Fri, Nov 2, 2012 at 6:44 PM, Tod Olson t...@uchicago.edu wrote:
 
  I'm having a problem with a create … from … order by when my data
 starts
  approaching 2GB. I'm using SQLite 3.7.14 on FreeBSD 8.3-RELEASE-p3.
 
  The processing starts with an unsorted table, created thus:
 
CREATE TABLE all_headings (key, heading);
 
  Then it creates a sorted version of the table:
 
create table headings as select * from all_headings order by key;
 
  This is fine on small data, but when I load 1.8GB of data (8.8 million
  rows) the second CREATE fails, reporting a disk I/O error.
 
 
  You might be running out of /tmp space.  Do you have plenty of /tmp
 space
  available for use by the sorter.
 
  Plenty, 14GB of free space available to /tmp (it's all one big
 partition).
 
  You might also be running into the 32-bit integer overflow bug that was
  fixed at http://www.sqlite.org/src/info/e24ba5bee4 though normally that
  requires a great deal more than 1.8GB of data.
 
  Yes! I compiled up that version and it solves the problem.
 
  I eagerly await the release of SQLite version 3.7.15.
 
  Thank you for your help.
 
  -Tod
 
  Please enable error logging using SQLITE_CONFIG_LOG (
  http://www.sqlite.org/c3ref/c_config_getmalloc.html#sqliteconfiglog)
 and
  rerun your query and see if that provides any additional clues.
 
 
  If I remove the order by clause, the create succeeds. (SQLite was
  compiled with large file support, and I could create a 4GB database
 using
  .import so it's not a file system limitation, and the /tmp space is
 plenty
  large.)
 
  [At that point it looks like pre-sorting the data before loading has
 some
  appeal, but the code maintainer prefers to treat SQLite as the
 authority on
  sorting rather to mess with the many versions of sort(1) on the various
  UNIXes and Windows. I understand his point.]
 
  So trying to understand the error with the ORDER BY clause, I loaded up
  the unsorted all_headings table and then trussed sqlite3 running the
 CREATE
  TABLE…ORDER BY. Before the error, there's a lot of lseek()/read() of
 the
  .db file, and a lot of lseek()/write() to temp file (in /tmp, I assume
 this
  is the sort space). Then there's a read() of the temp file, which
 returns
  an error. From truss:
 
read(5,0x800f64108,-1834983915) ERR#22 'Invalid argument'
 
  man 2 read says read's type signature is:
 
ssize_t read(int d, void *buf, size_t nbytes);
 
  and it says this about read returning errno 22:
 
[EINVAL] The pointer associated with d was negative.
[EINVAL] The value nbytes is greater than INT_MAX.
 
  The pointer doesn't look negative, but that nbytes argument looks
 possibly
  a problem. size_t is 64-bit on this system, but INT_MAX = 2147483647,
 or
  the max for a 32-bit signed int. Though truss doesn't know signed from
  unsigned valued, the size_t nbytes value that truss reports is greater
 than
  MAX_INT. So I think that explains the error.
 
  The main question is: is there anything to be done to get that CREATE
  TABLE … ORDER BY to work? Based on the truss output, I suspect not, but
  maybe someone here has run into the problem before.
 
  Thanks,
 
  -Tod
 
 
  Tod Olson t...@uchicago.edu
  Systems Librarian
  University of Chicago Library
 
 
 
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
 
 
  --
  D. Richard Hipp
  d...@sqlite.org
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 

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




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


Re: [sqlite] Problem with create … from … order by on largish data

2012-11-05 Thread Tod Olson
Great! Thank you for the pointers.

-Tod

On Nov 5, 2012, at 3:21 PM, Richard Hipp d...@sqlite.org
 wrote:

 On Mon, Nov 5, 2012 at 3:58 PM, Tod Olson t...@uchicago.edu wrote:
 
 Is there a predicted next release date? Or more to the point,
 does anyone have a guess about when the fix for that 32-bit int
 overflow error will be in general release?
 
 
 http://www.sqlite.org/draft/
 http://www.sqlite.org/draft/releaselog/3_7_15.html
 
 
 
 
 -Tod
 
 On Nov 3, 2012, at 3:18 PM, Tod Olson t...@uchicago.edu wrote:
 
 
 On Nov 3, 2012, at 7:32 AM, Richard Hipp d...@sqlite.org
 wrote:
 
 On Fri, Nov 2, 2012 at 6:44 PM, Tod Olson t...@uchicago.edu wrote:
 
 I'm having a problem with a create … from … order by when my data
 starts
 approaching 2GB. I'm using SQLite 3.7.14 on FreeBSD 8.3-RELEASE-p3.
 
 The processing starts with an unsorted table, created thus:
 
  CREATE TABLE all_headings (key, heading);
 
 Then it creates a sorted version of the table:
 
  create table headings as select * from all_headings order by key;
 
 This is fine on small data, but when I load 1.8GB of data (8.8 million
 rows) the second CREATE fails, reporting a disk I/O error.
 
 
 You might be running out of /tmp space.  Do you have plenty of /tmp
 space
 available for use by the sorter.
 
 Plenty, 14GB of free space available to /tmp (it's all one big
 partition).
 
 You might also be running into the 32-bit integer overflow bug that was
 fixed at http://www.sqlite.org/src/info/e24ba5bee4 though normally that
 requires a great deal more than 1.8GB of data.
 
 Yes! I compiled up that version and it solves the problem.
 
 I eagerly await the release of SQLite version 3.7.15.
 
 Thank you for your help.
 
 -Tod
 
 Please enable error logging using SQLITE_CONFIG_LOG (
 http://www.sqlite.org/c3ref/c_config_getmalloc.html#sqliteconfiglog)
 and
 rerun your query and see if that provides any additional clues.
 
 
 If I remove the order by clause, the create succeeds. (SQLite was
 compiled with large file support, and I could create a 4GB database
 using
 .import so it's not a file system limitation, and the /tmp space is
 plenty
 large.)
 
 [At that point it looks like pre-sorting the data before loading has
 some
 appeal, but the code maintainer prefers to treat SQLite as the
 authority on
 sorting rather to mess with the many versions of sort(1) on the various
 UNIXes and Windows. I understand his point.]
 
 So trying to understand the error with the ORDER BY clause, I loaded up
 the unsorted all_headings table and then trussed sqlite3 running the
 CREATE
 TABLE…ORDER BY. Before the error, there's a lot of lseek()/read() of
 the
 .db file, and a lot of lseek()/write() to temp file (in /tmp, I assume
 this
 is the sort space). Then there's a read() of the temp file, which
 returns
 an error. From truss:
 
  read(5,0x800f64108,-1834983915) ERR#22 'Invalid argument'
 
 man 2 read says read's type signature is:
 
  ssize_t read(int d, void *buf, size_t nbytes);
 
 and it says this about read returning errno 22:
 
  [EINVAL] The pointer associated with d was negative.
  [EINVAL] The value nbytes is greater than INT_MAX.
 
 The pointer doesn't look negative, but that nbytes argument looks
 possibly
 a problem. size_t is 64-bit on this system, but INT_MAX = 2147483647,
 or
 the max for a 32-bit signed int. Though truss doesn't know signed from
 unsigned valued, the size_t nbytes value that truss reports is greater
 than
 MAX_INT. So I think that explains the error.
 
 The main question is: is there anything to be done to get that CREATE
 TABLE … ORDER BY to work? Based on the truss output, I suspect not, but
 maybe someone here has run into the problem before.
 
 Thanks,
 
 -Tod
 
 
 Tod Olson t...@uchicago.edu
 Systems Librarian
 University of Chicago Library
 
 
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
 
 
 --
 D. Richard Hipp
 d...@sqlite.org
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
 
 
 -- 
 D. Richard Hipp
 d...@sqlite.org
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] light weight write barriers

2012-11-05 Thread Theodore Ts'o
On Mon, Nov 05, 2012 at 09:03:48PM +0100, Pavel Machek wrote:
  Well, using data journalling with ext3/4 may do what you want.  If you
  don't do any fsync, the changes will get written every 5 seconds when
  the automatic journal sync happens (and sub-4k writes will also get
 
 Hmm. But that would need setting journalling mode per-file, no?
 
 Like, make it journal data for all the databases, but keep normal mode
 for rest of system...

You can do that, using chattr +j file.db.  It's apparently not a
well known feature of ext3/4

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


Re: [sqlite] light weight write barriers

2012-11-05 Thread Richard Hipp
On Mon, Nov 5, 2012 at 5:04 PM, Theodore Ts'o ty...@mit.edu wrote:

 On Mon, Nov 05, 2012 at 09:03:48PM +0100, Pavel Machek wrote:
   Well, using data journalling with ext3/4 may do what you want.  If you
   don't do any fsync, the changes will get written every 5 seconds when
   the automatic journal sync happens (and sub-4k writes will also get
 
  Hmm. But that would need setting journalling mode per-file, no?
 
  Like, make it journal data for all the databases, but keep normal mode
  for rest of system...

 You can do that, using chattr +j file.db.  It's apparently not a
 well known feature of ext3/4


Per the docs:  Only the superuser or a process possessing the
CAP_SYS_RESOURCE capability can set or clear this attribute.  That
prevents most applications that run SQLite from being able to take
advantage of this, since most such applications lack elevated privileges.



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




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


Re: [sqlite] light weight write barriers

2012-11-05 Thread Theodore Ts'o
On Mon, Nov 05, 2012 at 05:37:02PM -0500, Richard Hipp wrote:
 
 Per the docs:  Only the superuser or a process possessing the
 CAP_SYS_RESOURCE capability can set or clear this attribute.  That
 prevents most applications that run SQLite from being able to take
 advantage of this, since most such applications lack elevated privileges.

If this feature would prove useful to sqllite, that's something we
could address.  I could image making this available to processes that
belong to a specific group that would be specified in the superblock
or as a mount option.  (We already have something like that which
allows a specific uid or gid to use the reserved space in the
superblock.)

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