aboutsummaryrefslogtreecommitdiff
path: root/src/build.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2015-11-19 16:46:46 +0000
committerdan <dan@noemail.net>2015-11-19 16:46:46 +0000
commitba68f8f3f58437deaea3d1bb26ca44a09faa837f (patch)
treef7a467d0f485237899e50cc52e3000bcda160fa5 /src/build.c
parent1a1d3cd2f3b9d9dadf50fe84c839e7d7c8b00488 (diff)
downloadsqlite-ba68f8f3f58437deaea3d1bb26ca44a09faa837f.tar.gz
sqlite-ba68f8f3f58437deaea3d1bb26ca44a09faa837f.zip
Fix problems with INSERT INTO ... SELECT ... statements that write to tables with __hidden__ columns.
FossilOrigin-Name: 59bd0ec7d4327852ee8c0206b2c59d0a12484db8
Diffstat (limited to 'src/build.c')
-rw-r--r--src/build.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/build.c b/src/build.c
index 0e8d4cf0e..f928ba307 100644
--- a/src/build.c
+++ b/src/build.c
@@ -1052,10 +1052,12 @@ begin_table_error:
/* Set properties of a table column based on the (magical)
** name of the column.
*/
-void sqlite3ColumnPropertiesFromName(Column *pCol){
+void sqlite3ColumnPropertiesFromName(Table *pTab, Column *pCol){
#if SQLITE_ENABLE_HIDDEN_COLUMNS
if( sqlite3_strnicmp(pCol->zName, "__hidden__", 10)==0 ){
pCol->colFlags |= COLFLAG_HIDDEN;
+ }else if( pTab && pCol!=pTab->aCol && (pCol[-1].colFlags & COLFLAG_HIDDEN) ){
+ pTab->tabFlags |= TF_OOOHidden;
}
#endif
}
@@ -1103,7 +1105,7 @@ void sqlite3AddColumn(Parse *pParse, Token *pName){
pCol = &p->aCol[p->nCol];
memset(pCol, 0, sizeof(p->aCol[0]));
pCol->zName = z;
- sqlite3ColumnPropertiesFromName(pCol);
+ sqlite3ColumnPropertiesFromName(p, pCol);
/* If there is no type specified, columns have the default affinity
** 'BLOB'. If there is a type specified, then sqlite3AddColumnType() will