SQLite

Check-in [25fa16a2e1]
Login

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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 25fa16a2e1f324790f4b293df5d7142575034428
User & Date: drh 2005-11-15 02:14:01.000
Context
2005-11-16
04:34
Avoid unnecessary strlen() calls in the OP_String opcode. (CVS 2768) (check-in: 2e195e96bc 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: 25fa16a2e1 user: drh tags: trunk)
2005-11-14
22:29
Create separate affinities for INTEGER and REAL. (CVS 2766) (check-in: ce06c123d0 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
39
40
41
42
43
44
45

46
47
48
49
50
51
52
53







-
+







**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** in this file for details.  If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.496 2005/11/14 22:29:05 drh Exp $
** $Id: vdbe.c,v 1.497 2005/11/15 02:14:01 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
204
205
206
207
208
209
210
211


212

213
214
215
216
217
218
219
204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
219
220
221







-
+
+

+







    if( 0==(pRec->flags&(MEM_Real|MEM_Int)) ){
      /* pRec does not have a valid integer or real representation. 
      ** Attempt a conversion if pRec has a string representation and
      ** it looks like a number.
      */
      int realnum;
      sqlite3VdbeMemNulTerminate(pRec);
      if( (pRec->flags&MEM_Str) && sqlite3IsNumber(pRec->z, &realnum, enc) ){
      if( (pRec->flags&MEM_Str)
           && sqlite3IsNumber(pRec->z, &realnum, pRec->enc) ){
        i64 value;
        sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8);
        if( !realnum && sqlite3atoi64(pRec->z, &value) ){
          sqlite3VdbeMemRelease(pRec);
          pRec->i = value;
          pRec->flags = MEM_Int;
        }else{
          sqlite3VdbeMemNumerify(pRec);
        }