aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-03-22 20:05:09 +0000
committerdrh <drh@noemail.net>2016-03-22 20:05:09 +0000
commitd7564865adc966c21fcdc10ea5ee5bb5910c46da (patch)
tree579f23798f115290d3fe3297beba51eb9e92598b /src/util.c
parent527b0435fabe2795865d52e4db827173a1cb2d65 (diff)
downloadsqlite-d7564865adc966c21fcdc10ea5ee5bb5910c46da.tar.gz
sqlite-d7564865adc966c21fcdc10ea5ee5bb5910c46da.zip
The sqlite3_column_decltype() routine should return NULL, not an empty string,
if the column has no declared type. FossilOrigin-Name: 605eba4a756e7185119088e2242f82691d078b01
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c12
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;
}
/*