Re: [sqlite] Compiling on Xcode

2016-07-22 Thread Igor Korot
Simon,
Sorry for the long delay. I was trying to catch up on some other stuff.

On Thu, Jul 14, 2016 at 10:01 AM, Igor Korot  wrote:
> On Thu, Jul 14, 2016 at 9:38 AM, Simon Slavin  wrote:
>>
>> On 14 Jul 2016, at 12:44pm, Igor Korot  wrote:
>>
>>> Is there anything else to check?
>>
>> No.  Those look correct.  You looked at the right place and it had the right 
>> options selected.
>>
>> Although the SQLite team goes to some lengths to avoid errors which prevent 
>> compilation, trying to get rid of every warning generated under every 
>> combination of compiler/OS/hardware that SQLite is used for would be a 
>> never-ending task.
>>
>> I looked up the warning messages you're seeing.  They are all harmless to 
>> your particular way of working.  They're caused by the fact that different 
>> types are different between different compilers, even when running on the 
>> same OS and hardware.  For instance, as far as your compiler is concerned, 
>> under the 64-bit OS X "unsigned long" is a 64-bit unsigned integer but "int" 
>> is a 32-bit integer.
>>
>> There may be a set of compiler options which get rid of those messages but 
>> I'm not an expert on that level and I don't think it matters much anyway.  
>> So I think you can proceed with your setup and expect SQLite to perform 
>> without problems.
>
> OK, thx.
> There are also other warnings reported, however I'm currently at work
> and don't have access to my Mac.
>
> I will post them later to make sure that those are harmless as well.
>
> Thank you.

So the other warning I am seeing is:

"Ambiguous expansion of macro MIN/MAX"

Can those be safely ignored?

Thank you.

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


[sqlite] REFERENCES from TEMPORARY table to main database table?

2016-07-22 Thread Smith, Randall
Hi.

I'm creating a specialized index table to a persistent table that I need to 
speed up a one-time operation.  This seems like a great application for a 
TEMPORARY table in SQLite, so the index will always be reliably cleaned up.

However, I can't find a way to have REFERENCES to the main table appear in the 
temp table.  I want, e.g.

CREATE TEMPORARY TABLE MySpecializedIndex
(
-- etc.
Symbol INTEGER REFERENCES Symbols(rowid)
)

For which I get an operational error "no such table: temp.Symbols".

Using "REFERENCES main.Symbols" appears to be a syntax error.

Is it impossible to have references from temp tables to main tables?  If so, 
aren't TEMPORARY tables largely useless?

Is there another idiom in SQLite for managing tables that are intended to have 
a short life or which should be reliably cleaned up when the DB closes?

Thanks for any information and suggestions!

Randall.

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


Re: [sqlite] Typographical error in sqlite.org/howtocorrupt.html

2016-07-22 Thread Richard Hipp
Also fixed now.  Thanks.

On 7/22/16, Dominique Pellé  wrote:
> Hi
>
> I see another typo in the same page:
> https://www.sqlite.org/howtocorrupt.html
>
> === BEGIN QUOTE ===
> 6.2 Failures of mmap() on QNX
>
> There exists some subtle problem with mmap() on QNX such that
> making a second mmap() call against *the a* single file descriptor
> can cause the memory [...]
> === END QUOTE ===
>
> I suppose that it's meant to be: [...] against *a* single file descriptor
> [...]
>
> Regards
> Dominique
>
> On Fri, Jul 22, 2016 at 5:26 PM, Richard Hipp  wrote:
>> Fix checked in by Joe.  Thanks for reporting.
>>
>> On 7/20/16, Eubank, Tom  wrote:
>>> I believe that there is a typographical error on the following page:
>>>
>>> https://www.sqlite.org/howtocorrupt.html
>>>
>>> *7.4 Database pages leak from the free page list*
>>>
>>> When content is deleted from an SQLite database, pages that are no
>>> longer used are added to a free list and are reused to hold content
>>> added *but* subsequent inserts.
>>>
>>> Change 'added *but* subsequent inserts.'
>>> to 'added *by* subsequent inserts.'
>>>
>>> Peace,
>>> Tom Eubank
>>>
>>> ---
>>> Explanation, only if needed:
>>>  * It seems most likely that this paragraph intends to mean:
>>>   "pages in the free list are reused ... by subsequent inserts."
>>>  * The sentence as written seems awkward and incomplete.
>>>  * If some other reading is intended, such reading is not obvious.
>>>  * If 'but' is being used as a conjunction, then something else is
>>>missing from the conjunctive clause.
>>>
>>> This 'Explanation' was added after reading How to Report Bugs
>>> Effectively
>>> ,
>>> in case my suggested change is not obvious.
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@mailinglists.sqlite.org
>>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


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


Re: [sqlite] Typographical error in sqlite.org/howtocorrupt.html

2016-07-22 Thread Dominique Pellé
Hi

I see another typo in the same page: https://www.sqlite.org/howtocorrupt.html

=== BEGIN QUOTE ===
6.2 Failures of mmap() on QNX

There exists some subtle problem with mmap() on QNX such that
making a second mmap() call against *the a* single file descriptor
can cause the memory [...]
=== END QUOTE ===

I suppose that it's meant to be: [...] against *a* single file descriptor [...]

Regards
Dominique

On Fri, Jul 22, 2016 at 5:26 PM, Richard Hipp  wrote:
> Fix checked in by Joe.  Thanks for reporting.
>
> On 7/20/16, Eubank, Tom  wrote:
>> I believe that there is a typographical error on the following page:
>>
>> https://www.sqlite.org/howtocorrupt.html
>>
>> *7.4 Database pages leak from the free page list*
>>
>> When content is deleted from an SQLite database, pages that are no
>> longer used are added to a free list and are reused to hold content
>> added *but* subsequent inserts.
>>
>> Change 'added *but* subsequent inserts.'
>> to 'added *by* subsequent inserts.'
>>
>> Peace,
>> Tom Eubank
>>
>> ---
>> Explanation, only if needed:
>>  * It seems most likely that this paragraph intends to mean:
>>   "pages in the free list are reused ... by subsequent inserts."
>>  * The sentence as written seems awkward and incomplete.
>>  * If some other reading is intended, such reading is not obvious.
>>  * If 'but' is being used as a conjunction, then something else is
>>missing from the conjunctive clause.
>>
>> This 'Explanation' was added after reading How to Report Bugs Effectively
>> ,
>> in case my suggested change is not obvious.
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Typographical error in sqlite.org/howtocorrupt.html

2016-07-22 Thread Richard Hipp
Fix checked in by Joe.  Thanks for reporting.

On 7/20/16, Eubank, Tom  wrote:
> I believe that there is a typographical error on the following page:
>
> https://www.sqlite.org/howtocorrupt.html
>
> *7.4 Database pages leak from the free page list*
>
> When content is deleted from an SQLite database, pages that are no
> longer used are added to a free list and are reused to hold content
> added *but* subsequent inserts.
>
> Change 'added *but* subsequent inserts.'
> to 'added *by* subsequent inserts.'
>
> Peace,
> Tom Eubank
>
> ---
> Explanation, only if needed:
>  * It seems most likely that this paragraph intends to mean:
>   "pages in the free list are reused ... by subsequent inserts."
>  * The sentence as written seems awkward and incomplete.
>  * If some other reading is intended, such reading is not obvious.
>  * If 'but' is being used as a conjunction, then something else is
>missing from the conjunctive clause.
>
> This 'Explanation' was added after reading How to Report Bugs Effectively
> ,
> in case my suggested change is not obvious.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


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


Re: [sqlite] [System.Data.SQLite.DLL] Retrieving table names with column names

2016-07-22 Thread R Smith



On 2016/07/21 11:20 PM, Chris Locke wrote:

I've a table I'm calling recursively.

...

I know I can change my SQL statement to be explicit, and select each
required field and use AS, but is that the only solution?


It's not so much the "Only" way as it is the "Correct" way. Query 
planners between different engines all pop different values into the 
column name bit returned according to what uses the least CPU cycles 
(but perhaps still indicate the nature of the column) - which is the way 
we all want it. Once you actually NEED the names to be specifically 
something (as in your case) then the SQL standard provides for that by 
specifying that the Query engine *must* return an exact column name 
where you specify an "AS" clause for a selected column.


Hence me saying that this is not so much the /only/ way as it is the 
/correct/ way to ensure your column names are ALWAYS returned exactly as 
you asked for it.


As to your question about it being the Only way? - No - another way 
would be to use a different SQL engine that returns something that you 
like better, or an older version of SQLite when it behaved differently, 
or put your query in a CTE with named columns - but these ways are all 
silly for obvious reasons. Do the "AS" thing - it's how the the rest of 
us roll... :)


Cheers,
Ryan

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