Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add documentation for sqlite3changeset_concat() to sqlite3session.h. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | sessions |
Files: | files | file ages | folders |
SHA1: |
ada9efa53a6ea55f89d237cfd530f1d1 |
User & Date: | dan 2011-04-15 12:04:50.155 |
Context
2011-04-15
| ||
15:04 | Have sqlite3changeset_concat() return SQLITE_SCHEMA if an attempt is made to concatenate changesets based on incompatible database schemas. (check-in: 343b64517d user: dan tags: sessions) | |
12:04 | Add documentation for sqlite3changeset_concat() to sqlite3session.h. (check-in: ada9efa53a user: dan tags: sessions) | |
2011-04-14
| ||
18:01 | Add further tests for the sqlite3changeset_concat() function. Also fixes. (check-in: 1fc3f15d88 user: dan tags: sessions) | |
Changes
Changes to ext/session/sqlite3session.h.
︙ | ︙ | |||
519 520 521 522 523 524 525 | */ int sqlite3changeset_invert( int nIn, void *pIn, /* Input changeset */ int *pnOut, void **ppOut /* OUT: Inverse of input */ ); /* | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > | | | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | */ int sqlite3changeset_invert( int nIn, void *pIn, /* Input changeset */ int *pnOut, void **ppOut /* OUT: Inverse of input */ ); /* ** CAPI3REF: Concatenate Two Changeset Objects ** ** This function is used to concatenate two changesets, A and B, into a ** single changeset. The result is a changeset equivalent to applying ** changeset A followed by changeset B. ** ** Rows are identified by the values in their PRIMARY KEY columns. A change ** in changeset A is considered to apply to the same row as a change in ** changeset B if the two rows have the same primary key. ** ** Changes to rows that appear only in changeset A or B are copied into the ** output changeset. Or, if both changeset A and B contain a change that ** applies to a single row, the output depends on the type of each change, ** as follows: ** ** <table border=1 style="margin-left:8ex;margin-right:8ex"> ** <tr><th style="white-space:pre">Change A </th> ** <th style="white-space:pre">Change B </th> ** <th>Output Change ** <tr><td>INSERT <td>INSERT <td> ** Change A is copied into the output changeset. Change B is discarded. ** This case does not occur if changeset B is recorded immediately after ** changeset A. ** <tr><td>INSERT <td>UPDATE <td> ** An INSERT change is copied into the output changeset. The values in ** the INSERT change are as if the row was inserted by change A and then ** updated according to change B. ** <tr><td>INSERT <td>DELETE <td> ** No change at all is copied into the output changeset. ** <tr><td>UPDATE <td>INSERT <td> ** Change A is copied into the output changeset. Change B is discarded. ** This case does not occur if changeset B is recorded immediately after ** changeset A. ** <tr><td>UPDATE <td>UPDATE <td> ** A single UPDATE is copied into the output changeset. The accompanying ** values are as if the row was updated once by change A and then again ** by change B. ** <tr><td>UPDATE <td>DELETE <td> ** A single DELETE is copied into the output changeset. ** <tr><td>DELETE <td>INSERT <td> ** If one or more of the column values in the row inserted by change ** B differ from those in the row deleted by change A, an UPDATE ** change is added to the output changeset. Otherwise, if the inserted ** row is exactly the same as the deleted row, no change is added to ** the output changeset. ** <tr><td>DELETE <td>UPDATE <td> ** Change A is copied into the output changeset. Change B is discarded. ** This case does not occur if changeset B is recorded immediately after ** changeset A. ** <tr><td>DELETE <td>DELETE <td> ** Change A is copied into the output changeset. Change B is discarded. ** This case does not occur if changeset B is recorded immediately after ** changeset A. ** </table> ** ** If the two changesets contain changes to the same table, then the number ** of columns and the position of the primary key columns for the table must ** be the same in each changeset. If this is not the case, attempting to ** concatenate the two changesets together fails and this function returns ** SQLITE_SCHEMA. If either of the two input changesets appear to be corrupt, ** and the corruption is detected, SQLITE_CORRUPT is returned. Or, if an ** out-of-memory condition occurs during processing, this function returns ** SQLITE_NOMEM. ** ** If none of the above errors occur, SQLITE_OK is returned and *ppOut set ** to point to a buffer containing the output changeset. It is the ** responsibility of the caller to eventually call sqlite3_free() on *ppOut ** to release memory allocated for the buffer. *pnOut is set to the number ** of bytes in the output changeset. If an error does occur, both *ppOut and ** *pnOut are set to zero before returning. */ int sqlite3changeset_concat( int nA, /* Number of bytes in buffer pA */ void *pA, /* Pointer to buffer containing changeset A */ int nB, /* Number of bytes in buffer pB */ void *pB, /* Pointer to buffer containing changeset B */ int *pnOut, /* OUT: Number of bytes in output changeset */ void **ppOut /* OUT: Buffer containing output changeset */ ); /* ** CAPI3REF: Apply A Changeset To A Database ** ** Apply a changeset to a database. This function attempts to update the ** "main" database attached to handle db with the changes found in the |
︙ | ︙ |