mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Do not confuse the constant SQLITE_MAX_ATTACHED with the maximum number of
schemas. Add the new SQLITE_MAX_DB constant for the maximum number of schemas. [forum:/forumpost/a006d86f72|Forum post a006d86f72]. FossilOrigin-Name: 7b65fb9f7bd616f834633afd64b3448bf9ca2b6e4cc6d6c01e75d1d877c88a79
This commit is contained in:
@ -910,4 +910,19 @@ do_execsql_test attach-12.1 {
|
||||
PRAGMA integrity_check;
|
||||
} {ok}
|
||||
|
||||
# 2021-03-10 Forum post https://sqlite.org/forum/forumpost/a006d86f72
|
||||
#
|
||||
reset_db
|
||||
do_test attach-13.1 {
|
||||
sqlite3 db :memory:
|
||||
db eval {CREATE TABLE base(x);}
|
||||
for {set i 0} {$i<$SQLITE_MAX_ATTACHED} {incr i} {
|
||||
db eval "ATTACH ':memory:' AS a$i"
|
||||
}
|
||||
set m "a[expr {$SQLITE_MAX_ATTACHED-1}]"
|
||||
db eval "CREATE TABLE $m.t1(a INTEGER PRIMARY KEY, b);"
|
||||
db eval "CREATE TABLE $m.t2(a INTEGER PRIMARY KEY, b);"
|
||||
db eval {SELECT a FROM t1 WHERE b IN (SELECT a FROM t2);}
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user