Re: [sqlite] How to select Strict Affinity or No Affinity modes?

2008-02-02 Thread Scott Chapman
D. Richard Hipp wrote:
> On Feb 2, 2008, at 7:57 PM, Scott Chapman wrote:
>
>   
>> I've looked high and low and can't find a way to invoke the other 2
>> affinity modes.  Are they available? I'm on 3.5.4.
>> 
> The concept of "strict" affinity mode was briefly discussed years
> ago, but we never implemented it, having never seen any benefit
> for such a thing.  Can you explain why you think strict affinity mode
> might be beneficial to you?  If somebody can provide a good
> enough rational to justify strict affinity mode, we might just put it
> in.
>   
I'm working on a Python adapter that goes on top of APSW.  It will 
enable you to use the column types NUMERIC, DATE, TIME, TIMESTAMP and 
automatically convert these to and from Python's respective data types.

The case I'm dealing with that is not working like I want is the case of 
NUMERIC column type.  In SQLite, this column type gets an affinity of 
REAL. If I put in a value to the column as a string literal, say 
'123.23', it's stored as a REAL even though I specified it as a string 
in quotes.  I want it to store it as a string.  The only way I've found 
to fix this is to use a column type of NUMERIC_TEXT.  The presense of 
"TEXT" in the column type changes the affinity to string.  This is not 
very elegant and I was looking for any other way to make this work 
correctly.  "No Affinity" would probably work, if I understand it 
correctly.

I want to avoid the use of REAL types in this case because they can lead 
to rounding errors, which is the whole purpose of the NUMERIC type to 
begin with, in my understanding.  I also would like to be able to make 
the column type just NUMERIC as that is compilant with the SQL standard.

Strict Affinity and No Affinity are mentioned in the SQLite3 Datatypes 
page.  If there are no plans to implement these, please consider 
removing them from the docs.

Thanks!
Scott

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


Re: [sqlite] Version 3.5.5 Released

2008-02-02 Thread [EMAIL PROTECTED]




Thanks, that
helped.

[EMAIL PROTECTED] wrote:

  "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
  
  
Got the
sqlite3.exe version 3.5.5 but .explain still doesn't seem to work. 
Maybe it's me, could someone post a simple example of .explain working?


  
  

C:\ sqlite3
SQLite version 3.5.5
Enter ".help" for instructions
sqlite> create table t1(x);
sqlite> .explain
sqlite> EXPLAIN SELECT * FROM t1;

[explain output follows the above].

--
D. Richard Hipp <[EMAIL PROTECTED]>

___
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] How to select Strict Affinity or No Affinity modes?

2008-02-02 Thread D. Richard Hipp

On Feb 2, 2008, at 7:57 PM, Scott Chapman wrote:

> I've looked high and low and can't find a way to invoke the other 2
> affinity modes.  Are they available? I'm on 3.5.4.
>
>

The concept of "strict" affinity mode was briefly discussed years
ago, but we never implemented it, having never seen any benefit
for such a thing.  Can you explain why you think strict affinity mode
might be beneficial to you?  If somebody can provide a good
enough rational to justify strict affinity mode, we might just put it
in.

D. Richard Hipp
[EMAIL PROTECTED]



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


[sqlite] How to select Strict Affinity or No Affinity modes?

2008-02-02 Thread Scott Chapman
I've looked high and low and can't find a way to invoke the other 2 
affinity modes.  Are they available? I'm on 3.5.4.

Any pointers would be greatly appreciated.

Thanks!
Scott

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


Re: [sqlite] DBD::SQLite 1.14 prepare_cached bug?

2008-02-02 Thread Alexander Batyrshin
Opss. Code with numbers looks like this:

$sth->execute;
my ($val) = $sth->fetchrow_array;
#[1] my ($val2) = $sth->fetchrow_array;
#[2] $sth->finish;
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] DBD::SQLite 1.14 prepare_cached bug?

2008-02-02 Thread Alexander Batyrshin
 Hello All,
I don't know is it right place to discuss this or not. Sorry If I am
doing something wrong.
Installed sqlite-3.5.4 and DBD::SQLite-1.14
I get problems with this code:

%<
#!/usr/bin/perl -w

use strict;
use DBI;
use Data::Dumper;
use Storable;
use warnings;

sub get_session {
my ($dbh) = shift;
#$dbh->{TraceLevel} = 2;
my $sid = $ARGV[0];
my $SQL = sprintf("select a_session from sessions where id = %s",
$dbh->quote($sid));
my $sth = $dbh->prepare_cached($SQL, undef, 3);
$sth->execute;
my ($val) = $sth->fetchrow_array;
#my ($val2) = $sth->fetchrow_array;
$sth->finish;
#[3] undef $sth;
my $session = Storable::thaw($val);
}


my $dbh = DBI->connect('dbi:SQLite:dbname=db/sessions.db');
print Dumper(get_session($dbh));
$dbh->disconnect;
%<

If we run program as it looks, result will be:

DBI::db=HASH(0x87a79c)->disconnect invalidates 1 active statement
handle (either destroy statement handles or call finish on them before
disconnecting) at ./decode_sessions.pl line 26.
closing dbh with active statement handles at ./decode_sessions.pl line 26.

Note: that my database does not contain duplicated records.

If I uncomment (1), (2) or (1)+(2) result:

closing dbh with active statement handles at ./decode_sessions.pl line 26.

Inside DBD-SQLite this errors goes from this:
%<
int
sqlite_db_disconnect (SV *dbh, imp_dbh_t *imp_dbh)
{
dTHR;
DBIc_ACTIVE_off(imp_dbh);

if (DBIc_is(imp_dbh, DBIcf_AutoCommit) == FALSE) {
sqlite_db_rollback(dbh, imp_dbh);
}

if (sqlite3_close(imp_dbh->db) == SQLITE_BUSY) {
/* active statements! */
warn("closing dbh with active statement handles");
}
imp_dbh->db = NULL;

av_undef(imp_dbh->functions);
imp_dbh->functions = (AV *)NULL;

av_undef(imp_dbh->aggregates);
imp_dbh->aggregates = (AV *)NULL;

return TRUE;
}
%<


-- 
Alexander Batyrshin aka bash
bash = Biomechanica Artificial Sabotage Humanoid
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Version 3.5.5 Released

2008-02-02 Thread drh
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Got the
> sqlite3.exe version 3.5.5 but .explain still doesn't seem to work. 
> Maybe it's me, could someone post a simple example of .explain working?
> 


C:\ sqlite3
SQLite version 3.5.5
Enter ".help" for instructions
sqlite> create table t1(x);
sqlite> .explain
sqlite> EXPLAIN SELECT * FROM t1;

[explain output follows the above].

--
D. Richard Hipp <[EMAIL PROTECTED]>

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


Re: [sqlite] Version 3.5.5 Released

2008-02-02 Thread [EMAIL PROTECTED]




Got the
sqlite3.exe version 3.5.5 but .explain still doesn't seem to work. 
Maybe it's me, could someone post a simple example of .explain working?

[EMAIL PROTECTED] wrote:
Also,
.schema and .explain don't seem to do anything in then sqlite3.exe
version 3.5.4. I downloaded in sqlite-3_5_5.zip
  
  
  
Mohd Radzi Ibrahim wrote:
  
  Hi,


The Precompiled Binary for Windows : the command-line sqlite-3_5_5.zip
still contain the 3.5.4 version


regards,

Radzi.

- Original Message - From: <[EMAIL PROTECTED]>

To: 

Sent: Friday, February 01, 2008 1:33 AM

Subject: [sqlite] Version 3.5.5 Released



SQLite version 3.5.5 is now available for
download from the
  
SQLite website:
  
  
  http://www.sqlite.org/
  
  
The big change from version 3.5.4 is that the internal virtual
  
machine was reworked to use operands in registers rather than
  
pulling operands from a stack.  The virtual machine stack has
  
now been removed.  The removal of the VM stack will help prevent
  
future stack overflow bugs and will also facilitate new optimizations
  
in future releases.
  
  
There should be no user-visible changes to the operation of SQLite
  
in this release, except that the output of EXPLAIN looks different.
  
  
In order to make this change, about 8.5% of the core SQLite code
  
had to be reworked.  We thought this might introduce instability.
  
But we have done two weeks of intensive testing, during which time
  
we have increased the statement test coverage to 99% and during
  
which we have found and fixed lots of minor bugs (mostly things
  
like leaking memory following a malloc failure).  But for all of
  
that testing, we have not detected a single bug in the new
  
register-based VM.  And for that reason, we believe the new
  
VM, and hence version 3.5.5, is stable and ready for production
  
use.
  
  
As usual, please report any problems to this mailing list, or
  
directly to me.
  
  
-- 
D. Richard Hipp <[EMAIL PROTECTED]>
  
  
  
-
  
To unsubscribe, send email to [EMAIL PROTECTED]
  
-
  
  
  
  




-

To unsubscribe, send email to [EMAIL PROTECTED]

-




  
  
-
  
To unsubscribe, send email to [EMAIL PROTECTED]
  
-
  
  
  
  



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


[sqlite] Mailing List Changes

2008-02-02 Thread Mike Owens
The SQLite mailing list has been moved over to Postfix and GNU Mailman. Please
do not use the ezmlm mail accounts to modify your subscription status from this
point on.

You can now configure your list status and options via the Mailman
interface at:

  http://sqlite.org:8080/cgi-bin/mailman/options/sqlite-users

You will need your password to do so. To get it, fill in your email address and
hit the "Remind" button under the the "Password Reminder" section. You will
receive an email with your auto-generated password. You can change this password
after logging into your admin page.

While it shouldn't be a problem for you, we are using the following blacklists:

   list.dsbl.org
   zen.spamhaus.org
   bl.spamcop.net
   dnsbl.njabl.org

If you have any problems with passwords, settings, or sending/receiving mail, or
anything else related to the mailing list, please email [EMAIL PROTECTED] I
apologize in advance for any problems or inconvenience, and will work
to fix them
as quickly as possible.

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


[sqlite] Testing the new SQLite mailing list

2008-02-02 Thread D. Richard Hipp
This is the initial test message for the new SQLite mailing list, using
GNU mailman now instead of ezmlm.

D. Richard Hipp
[EMAIL PROTECTED]



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


[sqlite] List Test

2008-02-02 Thread Mike Owens
Testing.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Version 3.5.5 Released

2008-02-02 Thread [EMAIL PROTECTED]
Also, .schema and .explain don't seem to do anything in then sqlite3.exe 
version 3.5.4. I downloaded in sqlite-3_5_5.zip



Mohd Radzi Ibrahim wrote:

Hi,

The Precompiled Binary for Windows : the command-line sqlite-3_5_5.zip 
still contain the 3.5.4 version


regards,
Radzi.
- Original Message - From: <[EMAIL PROTECTED]>
To: 
Sent: Friday, February 01, 2008 1:33 AM
Subject: [sqlite] Version 3.5.5 Released



SQLite version 3.5.5 is now available for download from the
SQLite website:

  http://www.sqlite.org/

The big change from version 3.5.4 is that the internal virtual
machine was reworked to use operands in registers rather than
pulling operands from a stack.  The virtual machine stack has
now been removed.  The removal of the VM stack will help prevent
future stack overflow bugs and will also facilitate new optimizations
in future releases.

There should be no user-visible changes to the operation of SQLite
in this release, except that the output of EXPLAIN looks different.

In order to make this change, about 8.5% of the core SQLite code
had to be reworked.  We thought this might introduce instability.
But we have done two weeks of intensive testing, during which time
we have increased the statement test coverage to 99% and during
which we have found and fixed lots of minor bugs (mostly things
like leaking memory following a malloc failure).  But for all of
that testing, we have not detected a single bug in the new
register-based VM.  And for that reason, we believe the new
VM, and hence version 3.5.5, is stable and ready for production
use.

As usual, please report any problems to this mailing list, or
directly to me.

--
D. Richard Hipp <[EMAIL PROTECTED]>


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 









- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 







-
To unsubscribe, send email to [EMAIL PROTECTED]
-