/ Check-in [9b8acf83]
Login

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

Overview
Comment:Ensure the return value of sqlite3_errmsg16() is aligned on a 2-byte boundary. Ticket #3665. (CVS 6313)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9b8acf8319ec760713773407a4d5a33dea8d75e8
User & Date: danielk1977 2009-02-23 14:42:53
References
2010-01-05
18:11
Apply fix [9b8acf8319] to the 3.6.1 branch. check-in: 62b4891b user: dan tags: branch-3.6.1
Context
2009-02-23
16:52
Add the reverse_unordered_selects pragma. (CVS 6314) check-in: bc078e00 user: drh tags: trunk
14:42
Ensure the return value of sqlite3_errmsg16() is aligned on a 2-byte boundary. Ticket #3665. (CVS 6313) check-in: 9b8acf83 user: danielk1977 tags: trunk
2009-02-21
22:38
The sqlite3.def file is automatically generated and is not suppose to be part of the source code repository. So it is hereby removed. Ticket #3671. (CVS 6312) check-in: 5dcda154 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.528 2009/02/05 16:31:46 drh Exp $
           17  +** $Id: main.c,v 1.529 2009/02/23 14:42:53 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   
    21     21   #ifdef SQLITE_ENABLE_FTS3
    22     22   # include "fts3.h"
    23     23   #endif
    24     24   #ifdef SQLITE_ENABLE_RTREE
................................................................................
  1254   1254   
  1255   1255   #ifndef SQLITE_OMIT_UTF16
  1256   1256   /*
  1257   1257   ** Return UTF-16 encoded English language explanation of the most recent
  1258   1258   ** error.
  1259   1259   */
  1260   1260   const void *sqlite3_errmsg16(sqlite3 *db){
  1261         -  /* Because all the characters in the string are in the unicode
  1262         -  ** range 0x00-0xFF, if we pad the big-endian string with a 
  1263         -  ** zero byte, we can obtain the little-endian string with
  1264         -  ** &big_endian[1].
  1265         -  */
  1266         -  static const char outOfMemBe[] = {
  1267         -    0, 'o', 0, 'u', 0, 't', 0, ' ', 
  1268         -    0, 'o', 0, 'f', 0, ' ', 
  1269         -    0, 'm', 0, 'e', 0, 'm', 0, 'o', 0, 'r', 0, 'y', 0, 0, 0
         1261  +  static const u16 outOfMem[] = {
         1262  +    'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
  1270   1263     };
  1271         -  static const char misuseBe [] = {
  1272         -    0, 'l', 0, 'i', 0, 'b', 0, 'r', 0, 'a', 0, 'r', 0, 'y', 0, ' ', 
  1273         -    0, 'r', 0, 'o', 0, 'u', 0, 't', 0, 'i', 0, 'n', 0, 'e', 0, ' ', 
  1274         -    0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ', 
  1275         -    0, 'o', 0, 'u', 0, 't', 0, ' ', 
  1276         -    0, 'o', 0, 'f', 0, ' ', 
  1277         -    0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0
         1264  +  static const u16 misuse[] = {
         1265  +    'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', 
         1266  +    'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', 
         1267  +    'c', 'a', 'l', 'l', 'e', 'd', ' ', 
         1268  +    'o', 'u', 't', ' ', 
         1269  +    'o', 'f', ' ', 
         1270  +    's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0
  1278   1271     };
  1279   1272   
  1280   1273     const void *z;
  1281   1274     if( !db ){
  1282         -    return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
         1275  +    return (void *)outOfMem;
  1283   1276     }
  1284   1277     if( !sqlite3SafetyCheckSickOrOk(db) ){
  1285         -    return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
         1278  +    return (void *)misuse;
  1286   1279     }
  1287   1280     sqlite3_mutex_enter(db->mutex);
  1288   1281     assert( !db->mallocFailed );
  1289   1282     z = sqlite3_value_text16(db->pErr);
  1290   1283     if( z==0 ){
  1291   1284       sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode),
  1292   1285            SQLITE_UTF8, SQLITE_STATIC);