/ Check-in [f5d0ce8079]
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: b271ed5653 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: 40f67265c4 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: f5d0ce8079 user: dan tags: trunk
17:48
Remove the sqlite3ota_open_v2() API. Add a new parameter to sqlite3ota_open() instead. check-in: c74e0bc481 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

292
293
294
295
296
297
298

299
300
301
302
303
304
305
    /* Only attempt the conversion to TEXT if there is an integer or real
    ** representation (blob and NULL do not get converted) but no string
    ** representation.
    */
    if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){
      sqlite3VdbeMemStringify(pRec, enc, 1);
    }

  }
}

/*
** Try to convert the type of a function argument or a result column
** into a numeric representation.  Use either INTEGER or REAL whichever
** is appropriate.  But only do the conversion if it is possible without







>







292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
    /* Only attempt the conversion to TEXT if there is an integer or real
    ** representation (blob and NULL do not get converted) but no string
    ** 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
** into a numeric representation.  Use either INTEGER or REAL whichever
** is appropriate.  But only do the conversion if it is possible without

Changes to test/trigger1.test.

707
708
709
710
711
712
713
714
















715
do_test trigger1-16.7 {
  catchsql {
    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}}

















finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
do_test trigger1-16.7 {
  catchsql {
    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