1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Early detection and reporting of too few columns in an rtree CREATE VIRTUAL

TABLE statement.

FossilOrigin-Name: ef73107f475e40e6bdd8b722e96992070f81fd2b7a3cb718ec8f251c89ca3e81
This commit is contained in:
drh
2019-12-06 19:07:44 +00:00
parent 0a64ddbe76
commit 5102cf8df5
4 changed files with 13 additions and 10 deletions

View File

@ -3706,8 +3706,8 @@ static int rtreeInit(
};
assert( RTREE_MAX_AUX_COLUMN<256 ); /* Aux columns counted by a u8 */
if( argc>RTREE_MAX_AUX_COLUMN+3 ){
*pzErr = sqlite3_mprintf("%s", aErrMsg[3]);
if( argc<6 || argc>RTREE_MAX_AUX_COLUMN+3 ){
*pzErr = sqlite3_mprintf("%s", aErrMsg[2 + (argc>=6)]);
return SQLITE_ERROR;
}

View File

@ -112,6 +112,9 @@ for {set nCol 1} {$nCol<[llength $cols]} {incr nCol} {
catchsql { DROP TABLE t1 }
}
do_catchsql_test rtree-1.3.1000 {
CREATE VIRTUAL TABLE t1000 USING rtree;
} {1 {Too few columns for an rtree table}}
# Like execsql except display output as integer where that can be
# done without loss of information.