aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <>2021-07-30 23:30:30 +0000
committerdrh <>2021-07-30 23:30:30 +0000
commitc2df4d6adb44e5f9587bf962c917c46c603825c9 (patch)
tree463be0579cf67d7eae8f67743f9e5c3c715b7936 /src/sqliteInt.h
parente48f261ebfd36b4935c2d700269790239dac37e5 (diff)
downloadsqlite-c2df4d6adb44e5f9587bf962c917c46c603825c9.tar.gz
sqlite-c2df4d6adb44e5f9587bf962c917c46c603825c9.zip
Recognize certain standard datatypes ("INT", "INTEGER", "REAL", "TEXT", and
"BLOB") and if a column has one of those datatypes, store the type part of the bit-field information in the Column structure to save space. FossilOrigin-Name: d2da62a9df63036b02dadca3798de9e623c2680b3ef0c37d2b18bb88693afd7f
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 7d6fda4c6..8f63d777a 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2037,9 +2037,25 @@ struct Column {
char affinity; /* One of the SQLITE_AFF_... values */
u8 szEst; /* Estimated size of value in this column. sizeof(INT)==1 */
u8 hName; /* Column name hash for faster lookup */
+ u8 eType; /* One of the standard types */
u16 colFlags; /* Boolean properties. See COLFLAG_ defines below */
};
+/* Allowed values for Column.eType.
+**
+** Values must match entries in the global constant arrays
+** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more
+** than the offset into these arrays for the corresponding name.
+** Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
+*/
+#define COLTYPE_CUSTOM 0 /* Type appended to zName */
+#define COLTYPE_BLOB 1
+#define COLTYPE_INT 2
+#define COLTYPE_INTEGER 3
+#define COLTYPE_REAL 4
+#define COLTYPE_TEXT 5
+#define SQLITE_N_STDTYPE 5 /* Number of standard types */
+
/* Allowed values for Column.colFlags.
**
** Constraints:
@@ -4794,6 +4810,9 @@ void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8);
#ifndef SQLITE_AMALGAMATION
extern const unsigned char sqlite3OpcodeProperty[];
extern const char sqlite3StrBINARY[];
+extern const unsigned char sqlite3StdTypeLen[];
+extern const char sqlite3StdTypeAffinity[];
+extern const char *sqlite3StdType[];
extern const unsigned char sqlite3UpperToLower[];
extern const unsigned char *sqlite3aLTb;
extern const unsigned char *sqlite3aEQb;