mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 22:32:28 +00:00
Revert whitespace fixes to third_party (#501)
This commit is contained in:
parent
d4000bb8f7
commit
9de3d8f1e6
365 changed files with 39190 additions and 39211 deletions
52
third_party/sqlite3/vdbeblob.c
vendored
52
third_party/sqlite3/vdbeblob.c
vendored
|
@ -49,7 +49,7 @@ struct Incrblob {
|
|||
** sqlite3DbFree().
|
||||
**
|
||||
** If an error does occur, then the b-tree cursor is closed. All subsequent
|
||||
** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
|
||||
** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
|
||||
** immediately return SQLITE_ABORT.
|
||||
*/
|
||||
static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
|
||||
|
@ -57,7 +57,7 @@ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
|
|||
char *zErr = 0; /* Error message */
|
||||
Vdbe *v = (Vdbe *)p->pStmt;
|
||||
|
||||
/* Set the value of register r[1] in the SQL statement to integer iRow.
|
||||
/* Set the value of register r[1] in the SQL statement to integer iRow.
|
||||
** This is done directly as a performance optimization
|
||||
*/
|
||||
v->aMem[1].flags = MEM_Int;
|
||||
|
@ -201,7 +201,7 @@ int sqlite3_blob_open(
|
|||
}
|
||||
|
||||
/* If the value is being opened for writing, check that the
|
||||
** column is not indexed, and that it is not part of a foreign key.
|
||||
** column is not indexed, and that it is not part of a foreign key.
|
||||
*/
|
||||
if( wrFlag ){
|
||||
const char *zFault = 0;
|
||||
|
@ -210,7 +210,7 @@ int sqlite3_blob_open(
|
|||
if( db->flags&SQLITE_ForeignKeys ){
|
||||
/* Check that the column is not part of an FK child key definition. It
|
||||
** is not necessary to check if it is part of a parent key, as parent
|
||||
** key columns must be indexed. The check below will pick up this
|
||||
** key columns must be indexed. The check below will pick up this
|
||||
** case. */
|
||||
FKey *pFKey;
|
||||
for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
||||
|
@ -244,8 +244,8 @@ int sqlite3_blob_open(
|
|||
pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(&sParse);
|
||||
assert( pBlob->pStmt || db->mallocFailed );
|
||||
if( pBlob->pStmt ){
|
||||
|
||||
/* This VDBE program seeks a btree cursor to the identified
|
||||
|
||||
/* This VDBE program seeks a btree cursor to the identified
|
||||
** db/table/row entry. The reason for using a vdbe program instead
|
||||
** of writing code to use the b-tree layer directly is that the
|
||||
** vdbe program will take advantage of the various transaction,
|
||||
|
@ -253,11 +253,11 @@ int sqlite3_blob_open(
|
|||
**
|
||||
** After seeking the cursor, the vdbe executes an OP_ResultRow.
|
||||
** Code external to the Vdbe then "borrows" the b-tree cursor and
|
||||
** uses it to implement the blob_read(), blob_write() and
|
||||
** uses it to implement the blob_read(), blob_write() and
|
||||
** blob_bytes() functions.
|
||||
**
|
||||
** The sqlite3_blob_close() function finalizes the vdbe program,
|
||||
** which closes the b-tree cursor and (possibly) commits the
|
||||
** which closes the b-tree cursor and (possibly) commits the
|
||||
** transaction.
|
||||
*/
|
||||
static const int iLn = VDBE_OFFSET_LINENO(2);
|
||||
|
@ -274,7 +274,7 @@ int sqlite3_blob_open(
|
|||
int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
|
||||
VdbeOp *aOp;
|
||||
|
||||
sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag,
|
||||
sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag,
|
||||
pTab->pSchema->schema_cookie,
|
||||
pTab->pSchema->iGeneration);
|
||||
sqlite3VdbeChangeP5(v, 1);
|
||||
|
@ -282,7 +282,7 @@ int sqlite3_blob_open(
|
|||
aOp = sqlite3VdbeAddOpList(v, ArraySize(openBlob), openBlob, iLn);
|
||||
|
||||
/* Make sure a mutex is held on the table to be accessed */
|
||||
sqlite3VdbeUsesBtree(v, iDb);
|
||||
sqlite3VdbeUsesBtree(v, iDb);
|
||||
|
||||
if( db->mallocFailed==0 ){
|
||||
assert( aOp!=0 );
|
||||
|
@ -298,17 +298,17 @@ int sqlite3_blob_open(
|
|||
if( db->mallocFailed==0 ){
|
||||
#endif
|
||||
|
||||
/* Remove either the OP_OpenWrite or OpenRead. Set the P2
|
||||
/* Remove either the OP_OpenWrite or OpenRead. Set the P2
|
||||
** parameter of the other to pTab->tnum. */
|
||||
if( wrFlag ) aOp[1].opcode = OP_OpenWrite;
|
||||
aOp[1].p2 = pTab->tnum;
|
||||
aOp[1].p3 = iDb;
|
||||
aOp[1].p3 = iDb;
|
||||
|
||||
/* Configure the number of columns. Configure the cursor to
|
||||
** think that the table has one more column than it really
|
||||
** does. An OP_Column to retrieve this imaginary column will
|
||||
** always return an SQL NULL. This is useful because it means
|
||||
** we can invoke OP_Column to fill in the vdbe cursors type
|
||||
** we can invoke OP_Column to fill in the vdbe cursors type
|
||||
** and offset cache without causing any IO.
|
||||
*/
|
||||
aOp[1].p4type = P4_INT32;
|
||||
|
@ -321,7 +321,7 @@ int sqlite3_blob_open(
|
|||
sqlite3VdbeMakeReady(v, &sParse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pBlob->iCol = iCol;
|
||||
pBlob->db = db;
|
||||
sqlite3BtreeLeaveAll(db);
|
||||
|
@ -372,10 +372,10 @@ int sqlite3_blob_close(sqlite3_blob *pBlob){
|
|||
** Perform a read or write operation on a blob
|
||||
*/
|
||||
static int blobReadWrite(
|
||||
sqlite3_blob *pBlob,
|
||||
void *z,
|
||||
int n,
|
||||
int iOffset,
|
||||
sqlite3_blob *pBlob,
|
||||
void *z,
|
||||
int n,
|
||||
int iOffset,
|
||||
int (*xCall)(BtCursor*, u32, u32, void*)
|
||||
){
|
||||
int rc;
|
||||
|
@ -405,14 +405,14 @@ static int blobReadWrite(
|
|||
|
||||
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
|
||||
if( xCall==sqlite3BtreePutData && db->xPreUpdateCallback ){
|
||||
/* If a pre-update hook is registered and this is a write cursor,
|
||||
** invoke it here.
|
||||
**
|
||||
/* If a pre-update hook is registered and this is a write cursor,
|
||||
** invoke it here.
|
||||
**
|
||||
** TODO: The preupdate-hook is passed SQLITE_DELETE, even though this
|
||||
** operation should really be an SQLITE_UPDATE. This is probably
|
||||
** incorrect, but is convenient because at this point the new.* values
|
||||
** are not easily obtainable. And for the sessions module, an
|
||||
** SQLITE_UPDATE where the PK columns do not change is handled in the
|
||||
** incorrect, but is convenient because at this point the new.* values
|
||||
** are not easily obtainable. And for the sessions module, an
|
||||
** SQLITE_UPDATE where the PK columns do not change is handled in the
|
||||
** same way as an SQLITE_DELETE (the SQLITE_DELETE code is actually
|
||||
** slightly more efficient). Since you cannot write to a PK column
|
||||
** using the incremental-blob API, this works. For the sessions module
|
||||
|
@ -472,8 +472,8 @@ int sqlite3_blob_bytes(sqlite3_blob *pBlob){
|
|||
**
|
||||
** If an error occurs, or if the specified row does not exist or does not
|
||||
** contain a blob or text value, then an error code is returned and the
|
||||
** database handle error code and message set. If this happens, then all
|
||||
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
|
||||
** database handle error code and message set. If this happens, then all
|
||||
** subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
|
||||
** immediately return SQLITE_ABORT.
|
||||
*/
|
||||
int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue