/ Check-in [bf93f7b5]
Login

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

Overview
Comment:Update comments in sqlite3session.c to describe the format of "rebase blobs", as well as changesets and patchsets.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bf93f7b56b1d15682988daf3f1c293caf755433defdecd52ba8782fc40e92bd7
User & Date: dan 2018-10-30 19:14:16
Context
2018-10-31
01:04
Improved corrupt database detection in the relocatePage() routine of the b-tree module. check-in: d5787333 user: drh tags: trunk
2018-10-30
19:14
Update comments in sqlite3session.c to describe the format of "rebase blobs", as well as changesets and patchsets. check-in: bf93f7b5 user: dan tags: trunk
16:25
Split the SQLITE_WriteSchema flag in two flags, WriteSchema and SQLITE_NoSchemaError. Set only WriteSchema on a VACUUM to avoid problems when trying to vacuum a corrupt database. With this change, the size of the flags field on sqlite3 must grow from 32 to 64 bytes. check-in: 4f987810 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/session/sqlite3session.c.

   242    242   ** columns and columns that are modified by the UPDATE are set to "undefined".
   243    243   ** PRIMARY KEY fields contain the values identifying the table row to update,
   244    244   ** and fields associated with modified columns contain the new column values.
   245    245   **
   246    246   ** The records associated with INSERT changes are in the same format as for
   247    247   ** changesets. It is not possible for a record associated with an INSERT
   248    248   ** change to contain a field set to "undefined".
          249  +**
          250  +** REBASE BLOB FORMAT:
          251  +**
          252  +** A rebase blob may be output by sqlite3changeset_apply_v2() and its 
          253  +** streaming equivalent for use with the sqlite3_rebaser APIs to rebase
          254  +** existing changesets. A rebase blob contains one entry for each conflict
          255  +** resolved using either the OMIT or REPLACE strategies within the apply_v2()
          256  +** call.
          257  +**
          258  +** The format used for a rebase blob is very similar to that used for
          259  +** changesets. All entries related to a single table are grouped together.
          260  +**
          261  +** Each group of entries begins with a table header in changeset format:
          262  +**
          263  +**   1 byte: Constant 0x54 (capital 'T')
          264  +**   Varint: Number of columns in the table.
          265  +**   nCol bytes: 0x01 for PK columns, 0x00 otherwise.
          266  +**   N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated.
          267  +**
          268  +** Followed by one or more entries associated with the table.
          269  +**
          270  +**   1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09).
          271  +**   1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT.
          272  +**   record: (in the record format defined above).
          273  +**
          274  +** In a rebase blob, the first field is set to SQLITE_INSERT if the change
          275  +** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if
          276  +** it was a DELETE. The second field is set to 0x01 if the conflict 
          277  +** resolution strategy was REPLACE, or 0x00 if it was OMIT.
          278  +**
          279  +** If the change that caused the conflict was a DELETE, then the single
          280  +** record is a copy of the old.* record from the original changeset. If it
          281  +** was an INSERT, then the single record is a copy of the new.* record. If
          282  +** the conflicting change was an UPDATE, then the single record is a copy
          283  +** of the new.* record with the PK fields filled in based on the original
          284  +** old.* record.
   249    285   */
   250    286   
   251    287   /*
   252    288   ** For each row modified during a session, there exists a single instance of
   253    289   ** this structure stored in a SessionTable.aChange[] hash table.
   254    290   */
   255    291   struct SessionChange {