Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-02 Thread Simon Slavin

On 3 Jun 2012, at 12:11am, Rolf Marsh  wrote:

> I have this select statement which returns the correct results (count = 2) 
> when run in SQL Database Browser, but not in my Objective-c iPad app (count = 
> 0).
> 
> select count(orderdata.order_id) from orderdata, custdata, orderinfo 
>   where custdata.customer_id = orderinfo.cust_id and
>   orderdata.order_id = orderinfo.cust_id and 
>   custdata.Bus_name = 'Albertsons'

In your iPad app, are you using SQLite C functions to call SQLite, or are you 
using s different API ?

Please execute the following in SQL Database Browser and in your iPad app:

SELECT sqlite_version()

It's okay that the results from the two pieces of software are different, but 
knowing what they are might help us figure out what's going on.

Please also copy the database to your computer, and use the SQLite shell tool 
to execute the same query.  The shell tool is as close to canonical as anything 
is: whatever result that gets is the 'right' result.

Could you possibly reduce your database to just a few records -- just enough 
that it correctly reproduces your problem ?  You can use the SQLite shell tool 
to .dump the database which will let you post a complete copy for our testing.

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


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-02 Thread BareFeetWare
Hi Rolf,

There's nothing inherently different about SQLite execution in Objective-C or 
on iPad.

Please post a full (though brief) sample schema, including data, that 
demonstrates the issue, so we can test.

Thanks,
Tom

Tom Brodhurst-Hill
BareFeetWare

--
iPhone/iPad/iPod and Mac software development, specialising in databases
develo...@barefeetware.com
--
Follow us on Twitter: http://twitter.com/barefeetware/
Like us on Facebook: http://www.facebook.com/BareFeetWare

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


[sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-02 Thread Rolf Marsh
I have this select statement which returns the correct results (count = 2) when 
run in SQL Database Browser, but not in my Objective-c iPad app (count = 0).

select count(orderdata.order_id) from orderdata, custdata, orderinfo 
   where custdata.customer_id = orderinfo.cust_id and
   orderdata.order_id = orderinfo.cust_id and 
   custdata.Bus_name = 'Albertsons'

I have also tried it this way using JOINs, but get the same results…

select count(orderdata.order_id) from orderdata 
   join custdata on custdata.customer_id = orderinfo.cust_id "
   join orderinfo on orderdata.order_id = orderinfo.order_id "
   where custdata.Bus_name = 'Albertsons'

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


Re: [sqlite] [PATCH] add malloc and alloc_size attributes to allocation functions

2012-06-02 Thread Ryan Johnson

The list strips attachments... you might try sqlite-dev?

On 01/06/2012 5:31 PM, Nuno Lopes wrote:

Hi,

Please find in attach a patch that adds support for the malloc and 
alloc_size function attributes.
The malloc attribute specifies that a function behaves like malloc 
(i.e., it returns a fresh pointer to an allocated block). It's mainly 
used for optimization purposes.
The alloc_size attribute specifies that a given function returns a 
buffer of the size given in the specified argument. It's used to 
generate warnings for e.g. buffer overflows. Clang will also take 
advantage of this when instrumenting code for run-time buffer overflow 
detection.


Nuno


___
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


[sqlite] [PATCH] add malloc and alloc_size attributes to allocation functions

2012-06-02 Thread Nuno Lopes

Hi,

Please find in attach a patch that adds support for the malloc and  
alloc_size function attributes.
The malloc attribute specifies that a function behaves like malloc  
(i.e., it returns a fresh pointer to an allocated block). It's mainly  
used for optimization purposes.
The alloc_size attribute specifies that a given function returns a  
buffer of the size given in the specified argument. It's used to  
generate warnings for e.g. buffer overflows. Clang will also take  
advantage of this when instrumenting code for run-time buffer overflow  
detection.


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


[sqlite] tclsqlite.c: MD5Final() typo

2012-06-02 Thread Nuno Lopes

Hi,

I think there's a small typo in the MD5Final() function in tclsqlite.c.

line 3388 says:
memset(ctx, 0, sizeof(ctx));/* In case it is sensitive */

I think you wanted to write sizeof(*ctx) there instead.
(I'm looking at sqlite 3.7.12.1 sources)

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