SQLite

Changes On Branch toobig-fix
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch toobig-fix Excluding Merge-Ins

This is equivalent to a diff from 88204085 to 9b5d4088

2019-04-09
21:37
New test case for SQLITE_TOOBIG errors. (check-in: 4c77fbbe user: drh tags: trunk)
21:32
Improved reporting of SQLITE_TOOBIG errors while parsing. (check-in: ea2d4b65 user: drh tags: trunk)
20:50
Fix a problem caused by a small SQLITE_LIMIT_LENGTH value and a CREATE TABLE with a very large name. (Closed-Leaf check-in: 9b5d4088 user: dan tags: toobig-fix)
01:26
Use an unsigned integer to count free pages in btree.c:freePage2(). (check-in: 88204085 user: drh tags: trunk)
2019-04-07
18:21
Make the testcase() macro added in the previous check-in reachable for testing. (check-in: 80704a16 user: drh tags: trunk)

Changes to src/build.c.

3218
3219
3220
3221
3222
3223
3224


3225
3226
3227
3228
3229
3230
3231
    }
  }else{
    int n;
    Index *pLoop;
    for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
    zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n);
    if( zName==0 ){


      goto exit_create_index;
    }

    /* Automatic index names generated from within sqlite3_declare_vtab()
    ** must have names that are distinct from normal automatic index names.
    ** The following statement converts "sqlite3_autoindex..." into
    ** "sqlite3_butoindex..." in order to make the names distinct.







>
>







3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
    }
  }else{
    int n;
    Index *pLoop;
    for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
    zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n);
    if( zName==0 ){
      if( db->mallocFailed==0 ) pParse->rc = SQLITE_TOOBIG;
      pParse->nErr++;
      goto exit_create_index;
    }

    /* Automatic index names generated from within sqlite3_declare_vtab()
    ** must have names that are distinct from normal automatic index names.
    ** The following statement converts "sqlite3_autoindex..." into
    ** "sqlite3_butoindex..." in order to make the names distinct.

Changes to test/sqllimits1.test.

885
886
887
888
889
890
891










892
  ))))
} "1 {too many columns in result set}"


foreach {key value} [array get saved] {
  catch {set $key $value}
}










finish_test







>
>
>
>
>
>
>
>
>
>

885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
  ))))
} "1 {too many columns in result set}"


foreach {key value} [array get saved] {
  catch {set $key $value}
}

#-------------------------------------------------------------------------
# At one point the following caused an assert() to fail.
#
sqlite3_limit db SQLITE_LIMIT_LENGTH 10000
set nm [string repeat x 10000]
do_catchsql_test sqllimits1-17.1 "
  CREATE TABLE $nm (x PRIMARY KEY)
" {1 {string or blob too big}}

finish_test