aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-12-09 15:52:07 +0000
committerdrh <drh@noemail.net>2019-12-09 15:52:07 +0000
commitebd70eedd5d6e6a890a670b5ee874a5eae86b4dd (patch)
tree2970ff045b83a7aec6175de8d3586c3d439a65e8 /src
parent7a9698456dfb800878cb4414238927fc86907f93 (diff)
downloadsqlite-ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd.tar.gz
sqlite-ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd.zip
Fix the NOT NULL verification logic in PRAGMA integrity_check so that it
works for generated columns whose value is the result of a comparison operator. Ticket [bd8c280671ba44a7] FossilOrigin-Name: f3b39c71b88cb6721f443de56cdce4c08252453a5e340b00a2bd88dc10c42400
Diffstat (limited to 'src')
-rw-r--r--src/pragma.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pragma.c b/src/pragma.c
index 8878e7353..9b83807c6 100644
--- a/src/pragma.c
+++ b/src/pragma.c
@@ -1596,7 +1596,9 @@ void sqlite3Pragma(
if( j==pTab->iPKey ) continue;
if( pTab->aCol[j].notNull==0 ) continue;
sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3);
- sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
+ if( sqlite3VdbeGetOp(v,-1)->opcode==OP_Column ){
+ sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
+ }
jmp2 = sqlite3VdbeAddOp1(v, OP_NotNull, 3); VdbeCoverage(v);
zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName,
pTab->aCol[j].zName);