Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -294,10 +294,11 @@ ** representation. */ if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){ sqlite3VdbeMemStringify(pRec, enc, 1); } + pRec->flags &= ~(MEM_Real|MEM_Int); } } /* ** Try to convert the type of a function argument or a result column Index: test/trigger1.test ================================================================== --- test/trigger1.test +++ test/trigger1.test @@ -709,7 +709,23 @@ CREATE TRIGGER main.t16err7 AFTER INSERT ON tA BEGIN DELETE FROM t16 INDEXED BY t16a WHERE a=123; END; } } {1 {the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers}} + +#------------------------------------------------------------------------- +# Test that bug [34cd55d68e0e6e7c] has been fixed. +# +do_execsql_test trigger1-17.0 { + CREATE TABLE t17a(ii INT); + CREATE TABLE t17b(tt TEXT PRIMARY KEY, ss); + CREATE TRIGGER t17a_ai AFTER INSERT ON t17a BEGIN + INSERT INTO t17b(tt) VALUES(new.ii); + END; + CREATE TRIGGER t17b_ai AFTER INSERT ON t17b BEGIN + UPDATE t17b SET ss = 4; + END; + INSERT INTO t17a(ii) VALUES('1'); + PRAGMA integrity_check; +} {ok} finish_test