mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
Upgraded bundled SQLite library for PDO:SQLite to 3.2.5 (step 1)
This commit is contained in:
parent
3a21310f37
commit
c6aae12cc1
64 changed files with 6261 additions and 4244 deletions
|
|
@ -25,7 +25,7 @@
|
|||
** set the sqlite3_vdbe_addop_trace to 1 and all opcodes will be printed
|
||||
** as they are added to the instruction stream.
|
||||
*/
|
||||
#ifndef NDEBUG
|
||||
#ifdef SQLITE_DEBUG
|
||||
int sqlite3_vdbe_addop_trace = 0;
|
||||
#endif
|
||||
|
||||
|
|
@ -109,6 +109,7 @@ int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
|
|||
pOp->p2 = p2;
|
||||
pOp->p3 = 0;
|
||||
pOp->p3type = P3_NOTUSED;
|
||||
p->expired = 0;
|
||||
#ifdef SQLITE_DEBUG
|
||||
if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
|
||||
#endif
|
||||
|
|
@ -442,47 +443,6 @@ void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** If the P3 operand to the specified instruction appears
|
||||
** to be a quoted string token, then this procedure removes
|
||||
** the quotes.
|
||||
**
|
||||
** The quoting operator can be either a grave ascent (ASCII 0x27)
|
||||
** or a double quote character (ASCII 0x22). Two quotes in a row
|
||||
** resolve to be a single actual quote character within the string.
|
||||
*/
|
||||
void sqlite3VdbeDequoteP3(Vdbe *p, int addr){
|
||||
Op *pOp;
|
||||
assert( p->magic==VDBE_MAGIC_INIT );
|
||||
if( p->aOp==0 ) return;
|
||||
if( addr<0 || addr>=p->nOp ){
|
||||
addr = p->nOp - 1;
|
||||
if( addr<0 ) return;
|
||||
}
|
||||
pOp = &p->aOp[addr];
|
||||
if( pOp->p3==0 || pOp->p3[0]==0 ) return;
|
||||
if( pOp->p3type==P3_STATIC ){
|
||||
pOp->p3 = sqliteStrDup(pOp->p3);
|
||||
pOp->p3type = P3_DYNAMIC;
|
||||
}
|
||||
assert( pOp->p3type==P3_DYNAMIC );
|
||||
sqlite3Dequote(pOp->p3);
|
||||
}
|
||||
|
||||
/*
|
||||
** Search the current program starting at instruction addr for the given
|
||||
** opcode and P2 value. Return the address plus 1 if found and 0 if not
|
||||
** found.
|
||||
*/
|
||||
int sqlite3VdbeFindOp(Vdbe *p, int addr, int op, int p2){
|
||||
int i;
|
||||
assert( p->magic==VDBE_MAGIC_INIT );
|
||||
for(i=addr; i<p->nOp; i++){
|
||||
if( p->aOp[i].opcode==op && p->aOp[i].p2==p2 ) return i+1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the opcode for a given address.
|
||||
*/
|
||||
|
|
@ -952,18 +912,6 @@ int sqlite3VdbeAggReset(sqlite3 *db, Agg *pAgg, KeyInfo *pKeyInfo){
|
|||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Delete a keylist
|
||||
*/
|
||||
void sqlite3VdbeKeylistFree(Keylist *p){
|
||||
while( p ){
|
||||
Keylist *pNext = p->pNext;
|
||||
sqliteFree(p);
|
||||
p = pNext;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Close a cursor and release all the resources that cursor happens
|
||||
** to hold.
|
||||
|
|
@ -1010,13 +958,10 @@ static void Cleanup(Vdbe *p){
|
|||
}
|
||||
closeAllCursors(p);
|
||||
releaseMemArray(p->aMem, p->nMem);
|
||||
if( p->pList ){
|
||||
sqlite3VdbeKeylistFree(p->pList);
|
||||
p->pList = 0;
|
||||
}
|
||||
sqlite3VdbeFifoClear(&p->sFifo);
|
||||
if( p->contextStack ){
|
||||
for(i=0; i<p->contextStackTop; i++){
|
||||
sqlite3VdbeKeylistFree(p->contextStack[i].pList);
|
||||
sqlite3VdbeFifoClear(&p->contextStack[i].sFifo);
|
||||
}
|
||||
sqliteFree(p->contextStack);
|
||||
}
|
||||
|
|
@ -1145,6 +1090,7 @@ static int vdbeCommit(sqlite3 *db){
|
|||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
else{
|
||||
int needSync = 0;
|
||||
char *zMaster = 0; /* File-name for the master journal */
|
||||
char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt);
|
||||
OsFile master;
|
||||
|
|
@ -1180,6 +1126,9 @@ static int vdbeCommit(sqlite3 *db){
|
|||
if( pBt && sqlite3BtreeIsInTrans(pBt) ){
|
||||
char const *zFile = sqlite3BtreeGetJournalname(pBt);
|
||||
if( zFile[0]==0 ) continue; /* Ignore :memory: databases */
|
||||
if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){
|
||||
needSync = 1;
|
||||
}
|
||||
rc = sqlite3OsWrite(&master, zFile, strlen(zFile)+1);
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3OsClose(&master);
|
||||
|
|
@ -1196,7 +1145,7 @@ static int vdbeCommit(sqlite3 *db){
|
|||
*/
|
||||
zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt);
|
||||
rc = sqlite3OsOpenDirectory(zMainFile, &master);
|
||||
if( rc!=SQLITE_OK || (rc = sqlite3OsSync(&master))!=SQLITE_OK ){
|
||||
if( rc!=SQLITE_OK || (needSync && (rc=sqlite3OsSync(&master))!=SQLITE_OK) ){
|
||||
sqlite3OsClose(&master);
|
||||
sqlite3OsDelete(zMaster);
|
||||
sqliteFree(zMaster);
|
||||
|
|
@ -1763,7 +1712,7 @@ int sqlite3VdbeSerialGet(
|
|||
pMem->flags = MEM_Int;
|
||||
return 6;
|
||||
}
|
||||
case 6: /* 6-byte signed integer */
|
||||
case 6: /* 8-byte signed integer */
|
||||
case 7: { /* IEEE floating point */
|
||||
u64 x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
|
||||
u32 y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue