Fix problems with INSERT INTO ... SELECT ... statements that write to tables with __hidden__ columns.
FossilOrigin-Name: 59bd0ec7d4327852ee8c0206b2c59d0a12484db8
diff --git a/src/insert.c b/src/insert.c
index 618b2de..4b8ed22 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -1909,6 +1909,11 @@
for(i=0; i<pDest->nCol; i++){
Column *pDestCol = &pDest->aCol[i];
Column *pSrcCol = &pSrc->aCol[i];
+#ifdef SQLITE_ENABLE_HIDDEN_COLUMNS
+ if( (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN ){
+ return 0; /* Neither table may have __hidden__ columns */
+ }
+#endif
if( pDestCol->affinity!=pSrcCol->affinity ){
return 0; /* Affinity must be the same on all columns */
}