/ Check-in [25fa16a2]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a bug in UTF-16 handling introduced by the previous check-in. (CVS 2767)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 25fa16a2e1f324790f4b293df5d7142575034428
User & Date: drh 2005-11-15 02:14:01
Context
2005-11-16
04:34
Avoid unnecessary strlen() calls in the OP_String opcode. (CVS 2768) check-in: 2e195e96 user: drh tags: trunk
2005-11-15
02:14
Fix a bug in UTF-16 handling introduced by the previous check-in. (CVS 2767) check-in: 25fa16a2 user: drh tags: trunk
2005-11-14
22:29
Create separate affinities for INTEGER and REAL. (CVS 2766) check-in: ce06c123 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.496 2005/11/14 22:29:05 drh Exp $
           46  +** $Id: vdbe.c,v 1.497 2005/11/15 02:14:01 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include "os.h"
    50     50   #include <ctype.h>
    51     51   #include "vdbeInt.h"
    52     52   
    53     53   /*
................................................................................
   204    204       if( 0==(pRec->flags&(MEM_Real|MEM_Int)) ){
   205    205         /* pRec does not have a valid integer or real representation. 
   206    206         ** Attempt a conversion if pRec has a string representation and
   207    207         ** it looks like a number.
   208    208         */
   209    209         int realnum;
   210    210         sqlite3VdbeMemNulTerminate(pRec);
   211         -      if( (pRec->flags&MEM_Str) && sqlite3IsNumber(pRec->z, &realnum, enc) ){
          211  +      if( (pRec->flags&MEM_Str)
          212  +           && sqlite3IsNumber(pRec->z, &realnum, pRec->enc) ){
   212    213           i64 value;
          214  +        sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8);
   213    215           if( !realnum && sqlite3atoi64(pRec->z, &value) ){
   214    216             sqlite3VdbeMemRelease(pRec);
   215    217             pRec->i = value;
   216    218             pRec->flags = MEM_Int;
   217    219           }else{
   218    220             sqlite3VdbeMemNumerify(pRec);
   219    221           }