Omit some code not used without SQLITE_ENABLE_SORTER_REFERENCES. Improvements

to comments used for documentation.

FossilOrigin-Name: f3596ab9eb1168dc75202e6f79e12c67d518b3a0659a0a629c707f43990fa7cf
This commit is contained in:
drh
2018-04-18 14:48:08 +00:00
parent 7590d09324
commit bbade8d1f6
6 changed files with 23 additions and 14 deletions
+5 -1
View File
@@ -1095,12 +1095,14 @@ void sqlite3AddColumn(Parse *pParse, Token *pName, Token *pType){
if( pType->n==0 ){
/* If there is no type specified, columns have the default affinity
** 'BLOB' and a default size of 4 bytes. */
** 'BLOB' with a default size of 4 bytes. */
pCol->affinity = SQLITE_AFF_BLOB;
pCol->szEst = 1;
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
if( 4>=sqlite3GlobalConfig.szSorterRef ){
pCol->colFlags |= COLFLAG_SORTERREF;
}
#endif
}else{
zType = z + sqlite3Strlen30(z) + 1;
memcpy(zType, pType->z, pType->n);
@@ -1221,9 +1223,11 @@ char sqlite3AffinityType(const char *zIn, Column *pCol){
v = 16; /* BLOB, TEXT, CLOB -> r=5 (approx 20 bytes)*/
}
}
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
if( v>=sqlite3GlobalConfig.szSorterRef ){
pCol->colFlags |= COLFLAG_SORTERREF;
}
#endif
v = v/4 + 1;
if( v>255 ) v = 255;
pCol->szEst = v;
+3
View File
@@ -286,6 +286,9 @@ static const char * const sqlite3azCompileOpt[] = {
#if SQLITE_ENABLE_SNAPSHOT
"ENABLE_SNAPSHOT",
#endif
#if SQLITE_ENABLE_SORTER_REFERENCES
"ENABLE_SORTER_REFERENCES",
#endif
#if SQLITE_ENABLE_SQLLOG
"ENABLE_SQLLOG",
#endif
+2 -2
View File
@@ -642,16 +642,16 @@ int sqlite3_config(int op, ...){
break;
}
case SQLITE_CONFIG_SORTERREF_SIZE: {
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
case SQLITE_CONFIG_SORTERREF_SIZE: {
int iVal = va_arg(ap, int);
if( iVal<0 ){
iVal = SQLITE_DEFAULT_SORTERREF_SIZE;
}
sqlite3GlobalConfig.szSorterRef = (u32)iVal;
#endif /* SQLITE_ENABLE_SORTER_REFERENCES */
break;
}
#endif /* SQLITE_ENABLE_SORTER_REFERENCES */
default: {
rc = SQLITE_ERROR;
+3 -1
View File
@@ -1940,10 +1940,12 @@ struct sqlite3_mem_methods {
** sorted records. However, if SQLite determines based on the declared type
** of a table column that its values are likely to be very large - larger
** than the configured sorter-reference size threshold - then a reference
** is stored in each sorted records and the required column values loaded
** is stored in each sorted record and the required column values loaded
** from the database as records are returned in sorted order. The default
** value for this option is to never use this optimization. Specifying a
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */