aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-10-19 13:29:10 +0000
committerdrh <drh@noemail.net>2019-10-19 13:29:10 +0000
commitb9bcf7ca600ab8a94018adc2eac4115441a09d89 (patch)
tree320096c64bdaaa2b5d9b1ca19ff3db9413b7adfe /src/sqliteInt.h
parentf95909c7648942e7157722c33b5e5f9293bf3436 (diff)
downloadsqlite-b9bcf7ca600ab8a94018adc2eac4115441a09d89.tar.gz
sqlite-b9bcf7ca600ab8a94018adc2eac4115441a09d89.zip
Refactor names of column index transformation functions, for clarity.
Get generated columns working with ALTER TABLE RENAME COLUMN. FossilOrigin-Name: 27ab41c9102e7801ff829488fc123a8040da008bef373d6704efbe2f93e1da90
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index a1e6e175b..10b2eeaf3 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1818,8 +1818,21 @@ struct Module {
};
/*
-** information about each column of an SQL table is held in an instance
-** of this structure.
+** Information about each column of an SQL table is held in an instance
+** of the Column structure, in the Table.aCol[] array.
+**
+** Definitions:
+**
+** "table column index" This is the index of the column in the
+** Table.aCol[] array, and also the index of
+** the column in the original CREATE TABLE stmt.
+**
+** "storage column index" This is the index of the column in the
+** record BLOB generated by the OP_MakeRecord
+** opcode. The storage column index is less than
+** or equal to the table column index. It is
+** equal if and only if there are no VIRTUAL
+** columns to the left.
*/
struct Column {
char *zName; /* Name of this column, \000, then the type */
@@ -3952,13 +3965,13 @@ void sqlite3SelectAddColumnTypeAndCollation(Parse*,Table*,Select*,char);
Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
void sqlite3OpenMasterTable(Parse *, int);
Index *sqlite3PrimaryKeyIndex(Table*);
-i16 sqlite3ColumnOfIndex(Index*, i16);
+i16 sqlite3TableColumnToIndex(Index*, i16);
#ifdef SQLITE_OMIT_GENERATED_COLUMNS
-# define sqlite3ColumnOfTable(T,X) (X) /* No-op pass-through */
-# define sqlite3ColumnOfStorage(T,X) (X) /* No-op pass-through */
+# define sqlite3TableColumnToStorage(T,X) (X) /* No-op pass-through */
+# define sqlite3StorageColumnToTable(T,X) (X) /* No-op pass-through */
#else
- i16 sqlite3ColumnOfTable(Table*, i16);
- i16 sqlite3ColumnOfStorage(Table*, i16);
+ i16 sqlite3TableColumnToStorage(Table*, i16);
+ i16 sqlite3StorageColumnToTable(Table*, i16);
#endif
void sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
#if SQLITE_ENABLE_HIDDEN_COLUMNS