In the source to 3.12.0, the source in src/main.c has:

#if SQLITE_MAX_ATTACHED<0 || SQLITE_MAX_ATTACHED>125
# error SQLITE_MAX_ATTACHED must be between 0 and 125
#endif

The limits.html on the Web site also says 125. As does the changes for
3.8.6. Why 125 would be a good question. The value relates to an "array" of
bits. If SQLITE_MAX_ATTACHED <= 30 the array is kept in a single int (2
bits are used for the dedicated "databases" (the "main" and "temp"). If >
30 then it is an array of ints, indexed by an integer value. Now, 125 is
127-2, which is the largest signed byte value. But having looked at the C
code, I don't see why this couldn't range up to 8*(2^31-1) == 8*2Gi == 16Ti
tables. But I could (easily) be missing something.

Anyway, it appears that the comment you found was never updated.

On Thu, Mar 3, 2016 at 2:40 PM, Tim Uy <tim at loqu8.com> wrote:

> Hi, I see that there is a default limit of 10 attached databases. And from
> the docs, 125 is limit. However, in the file sqliteLimit.h it says
>
> /*
> ** The maximum number of attached databases.  This must be between 0
> ** and 62.  The upper bound on 62 is because a 64-bit integer bitmap
> ** is used internally to track attached databases.
> */
> #ifndef SQLITE_MAX_ATTACHED
> # define SQLITE_MAX_ATTACHED 10
> #endif
>
>
> So is the limit 62 or is the limit 125?
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
A fail-safe circuit will destroy others. -- Klipstein

Maranatha! <><
John McKown

Reply via email to