/ Check-in [f5d0ce80]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value. Fix for [34cd55d6].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f5d0ce80792d58ef424300f973f8876d835ed4ad
User & Date: dan 2015-05-19 19:44:25
Original Comment: Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value.
Context
2015-05-19
22:20
Allow R-Tree geometry functions to take 8-byte BLOB arguments which are passed directly through to the underlying callback, and which can be used to pass pointers into the callback. check-in: b271ed56 user: drh tags: trunk
19:52
Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value. Fix for [34cd55d6]. Increase the version number to 3.8.10.2. check-in: 40f67265 user: drh tags: branch-3.8.10
19:44
Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value. Fix for [34cd55d6]. check-in: f5d0ce80 user: dan tags: trunk
17:48
Remove the sqlite3ota_open_v2() API. Add a new parameter to sqlite3ota_open() instead. check-in: c74e0bc4 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

   292    292       /* Only attempt the conversion to TEXT if there is an integer or real
   293    293       ** representation (blob and NULL do not get converted) but no string
   294    294       ** representation.
   295    295       */
   296    296       if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){
   297    297         sqlite3VdbeMemStringify(pRec, enc, 1);
   298    298       }
          299  +    pRec->flags &= ~(MEM_Real|MEM_Int);
   299    300     }
   300    301   }
   301    302   
   302    303   /*
   303    304   ** Try to convert the type of a function argument or a result column
   304    305   ** into a numeric representation.  Use either INTEGER or REAL whichever
   305    306   ** is appropriate.  But only do the conversion if it is possible without

Changes to test/trigger1.test.

   707    707   do_test trigger1-16.7 {
   708    708     catchsql {
   709    709       CREATE TRIGGER main.t16err7 AFTER INSERT ON tA BEGIN
   710    710         DELETE FROM t16 INDEXED BY t16a WHERE a=123;
   711    711       END;
   712    712     }
   713    713   } {1 {the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers}}
          714  +
          715  +#-------------------------------------------------------------------------
          716  +# Test that bug [34cd55d68e0e6e7c] has been fixed.
          717  +#
          718  +do_execsql_test trigger1-17.0 {
          719  +  CREATE TABLE t17a(ii INT);
          720  +  CREATE TABLE t17b(tt TEXT PRIMARY KEY, ss);
          721  +  CREATE TRIGGER t17a_ai AFTER INSERT ON t17a BEGIN
          722  +    INSERT INTO t17b(tt) VALUES(new.ii);
          723  +  END;
          724  +  CREATE TRIGGER t17b_ai AFTER INSERT ON t17b BEGIN
          725  +    UPDATE t17b SET ss = 4;
          726  +  END;
          727  +  INSERT INTO t17a(ii) VALUES('1');
          728  +  PRAGMA integrity_check;
          729  +} {ok}
   714    730   
   715    731   finish_test