diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c index 428dfd046..08b0c46a5 100644 --- a/src/util.c +++ b/src/util.c @@ -110,11 +110,15 @@ int sqlite3Strlen30(const char *z){ } /* -** The string z[] is followed immediately by another string. Return -** a poiner to that other string. +** Return the declared type of a column. Or return zDflt if the column +** has no declared type. +** +** The column type is an extra string stored after the zero-terminator on +** the column name if and only if the COLFLAG_HASTYPE flag is set. */ -const char *sqlite3StrNext(const char *z){ - return z + strlen(z) + 1; +char *sqlite3ColumnType(Column *pCol, char *zDflt){ + if( (pCol->colFlags & COLFLAG_HASTYPE)==0 ) return zDflt; + return pCol->zName + strlen(pCol->zName) + 1; } /* |