/ Check-in [e71ceb60]
Login

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

Overview
Comment:Updates to documentation on sqlite3_serialize() and sqlite3_deserialize(). No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e71ceb6089695c651aaf1fa8662c5caf771ac9efc2f2e8efa0eddae6a6a389ea
User & Date: drh 2018-03-08 16:36:23
Context
2018-03-08
18:09
Include the 'sessionfuzz' tool in the clean target for MSVC. check-in: 0f5a8666 user: mistachkin tags: trunk
16:36
Updates to documentation on sqlite3_serialize() and sqlite3_deserialize(). No changes to code. check-in: e71ceb60 user: drh tags: trunk
2018-03-07
21:39
Fix harmless compiler warnings in the 'dbdump' tool. check-in: 2b9bb266 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqlite.h.in.

  8727   8727   **
  8728   8728   ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
  8729   8729   */
  8730   8730   SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb);
  8731   8731   
  8732   8732   /*
  8733   8733   ** CAPI3REF: Serialize a database
  8734         -** EXPERIMENTAL
  8735   8734   **
  8736   8735   ** The sqlite3_serialize(D,S,P,F) interface returns a pointer to memory
  8737   8736   ** that is a serialization of the S database on [database connection] D.
  8738   8737   ** If P is not a NULL pointer, then the size of the database in bytes
  8739   8738   ** is written into *P.
  8740   8739   **
  8741   8740   ** For an ordinary on-disk database file, the serialization is just a
................................................................................
  8747   8746   ** the database into memory obtained from [sqlite3_malloc64()] and returns
  8748   8747   ** a pointer to that memory.  The caller is responsible for freeing the
  8749   8748   ** returned value to avoid a memory leak.  However, if the F argument
  8750   8749   ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations
  8751   8750   ** are made, and the sqlite3_serialize() function will return a pointer
  8752   8751   ** to the contiguous memory representation of the database that SQLite
  8753   8752   ** is currently using for that database, or NULL if the no such contiguous
  8754         -** memory representation of the database exists.  A contigous memory
         8753  +** memory representation of the database exists.  A contiguous memory
  8755   8754   ** representation of the database will usually only exist if there has
  8756   8755   ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same
  8757   8756   ** values of D and S.
  8758   8757   ** The size of the database is written into *P even if the 
  8759   8758   ** SQLITE_SERIALIZE_NOCOPY bit is set but no contigious copy
  8760   8759   ** of the database exists.
  8761   8760   **
................................................................................
  8771   8770     const char *zSchema,   /* Which DB to serialize. ex: "main", "temp", ... */
  8772   8771     sqlite3_int64 *piSize, /* Write size of the DB here, if not NULL */
  8773   8772     unsigned int mFlags    /* Zero or more SQLITE_SERIALIZE_* flags */
  8774   8773   );
  8775   8774   
  8776   8775   /*
  8777   8776   ** CAPI3REF: Flags for sqlite3_serialize
  8778         -** EXPERIMENTAL
  8779   8777   **
  8780   8778   ** Zero or more of the following constants can be OR-ed together for
  8781   8779   ** the F argument to [sqlite3_serialize(D,S,P,F)].
  8782   8780   **
  8783   8781   ** SQLITE_SERIALIZE_NOCOPY means that [sqlite3_serialize()] will return
  8784   8782   ** a pointer to contiguous in-memory database that it is currently using,
  8785   8783   ** without making a copy of the database.  If SQLite is not currently using
................................................................................
  8788   8786   ** using a contiguous in-memory database if it has been initialized by a
  8789   8787   ** prior call to [sqlite3_deserialize()].
  8790   8788   */
  8791   8789   #define SQLITE_SERIALIZE_NOCOPY 0x001   /* Do no memory allocations */
  8792   8790   
  8793   8791   /*
  8794   8792   ** CAPI3REF: Deserialize a database
  8795         -** EXPERIMENTAL
  8796   8793   **
  8797   8794   ** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the 
  8798   8795   ** [database connection] D to disconnection from database S and then
  8799   8796   ** reopen S as an in-memory database based on the serialization contained
  8800   8797   ** in P.  The serialized database P is N bytes in size.  M is the size of
  8801   8798   ** the buffer P, which might be larger than N.  If M is larger than N, and
  8802   8799   ** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
................................................................................
  8827   8824     sqlite3_int64 szDb,     /* Number bytes in the deserialization */
  8828   8825     sqlite3_int64 szBuf,    /* Total size of buffer pData[] */
  8829   8826     unsigned mFlags         /* Zero or more SQLITE_DESERIALIZE_* flags */
  8830   8827   );
  8831   8828   
  8832   8829   /*
  8833   8830   ** CAPI3REF: Flags for sqlite3_deserialize()
  8834         -** EXPERIMENTAL
  8835   8831   **
  8836   8832   ** The following are allowed values for 6th argument (the F argument) to
  8837   8833   ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
  8838   8834   **
  8839   8835   ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
  8840   8836   ** in the P argument is held in memory obtained from [sqlite3_malloc64()]
  8841   8837   ** and that SQLite should take ownership of this memory and automatically