SQLite

Check-in [8b0fe63f]
Login

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

Overview
Comment:Ensure that the VACUUM command is not confused by alternative encodings when it is the first command run on new database connection. Forum post 09503b4d33. Problem introduced by check-in [a02da71f3a80dd8e].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8b0fe63f873661037351fc1eba6071b98b5c97a0fc8bd8a504a90d047f78bc0d
User & Date: drh 2023-04-18 15:21:55
Original Comment: Ensure that the VACUUM command is not confused by alternative encodings when it is the first command run on new database connection. Forum post 09503b4d33.
Context
2023-04-18
23:05
CLI to cease dumping back to OS shell on single ^C when interactive. (check-in: ba8e4378 user: larrybr tags: trunk)
22:28
CLI to cease dumping back to OS shell on single ^C when interactive. (check-in: 7b1f6352 user: larrybr tags: cli-no-dump)
20:02
Make use of F_BARRIERFSYNC as an alternative to F_FULLFSYNC when it is available. (Leaf check-in: 3c517ba5 user: drh tags: barrier-fsync)
16:44
Ensure that the VACUUM command is not confused by alternative encodings when it is the first command run on new database connection. (check-in: 441f4e4a user: drh tags: branch-3.41)
15:21
Ensure that the VACUUM command is not confused by alternative encodings when it is the first command run on new database connection. Forum post 09503b4d33. Problem introduced by check-in [a02da71f3a80dd8e]. (check-in: 8b0fe63f user: drh tags: trunk)
14:13
Another fix to the indexed expressions in aggregate queries with GROUP BY enhancement of ticket [99378177930f87bd] and implemented by check-in [b9190d3da70c4171] to address a problem described by forum post f34e32d120, (check-in: 5acc3ef8 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/prepare.c.

302
303
304
305
306
307
308
309


310
311
312
313
314
315
316
#ifndef SQLITE_OMIT_UTF16
      /* If opening the main database, set ENC(db). */
      encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3;
      if( encoding==0 ) encoding = SQLITE_UTF8;
#else
      encoding = SQLITE_UTF8;
#endif
      if( db->nVdbeActive>0 && encoding!=ENC(db) ){


        rc = SQLITE_LOCKED;
        goto initone_error_out;
      }else{
        sqlite3SetTextEncoding(db, encoding);
      }
    }else{
      /* If opening an attached database, the encoding much match ENC(db) */







|
>
>







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
#ifndef SQLITE_OMIT_UTF16
      /* If opening the main database, set ENC(db). */
      encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3;
      if( encoding==0 ) encoding = SQLITE_UTF8;
#else
      encoding = SQLITE_UTF8;
#endif
      if( db->nVdbeActive>0 && encoding!=ENC(db)
       && (db->mDbFlags & DBFLAG_Vacuum)==0
      ){
        rc = SQLITE_LOCKED;
        goto initone_error_out;
      }else{
        sqlite3SetTextEncoding(db, encoding);
      }
    }else{
      /* If opening an attached database, the encoding much match ENC(db) */