mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
upgrade bundled sqlite to sqlite 3.1.3
This commit is contained in:
parent
58f61a16ee
commit
ae5649598d
62 changed files with 11169 additions and 5661 deletions
|
@ -34,10 +34,21 @@
|
|||
** between formats.
|
||||
*/
|
||||
int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
|
||||
int rc;
|
||||
if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
return sqlite3VdbeMemTranslate(pMem, desiredEnc);
|
||||
#ifdef SQLITE_OMIT_UTF16
|
||||
return SQLITE_ERROR;
|
||||
#else
|
||||
rc = sqlite3VdbeMemTranslate(pMem, desiredEnc);
|
||||
if( rc==SQLITE_NOMEM ){
|
||||
sqlite3VdbeMemRelease(pMem);
|
||||
pMem->flags = MEM_Null;
|
||||
pMem->z = 0;
|
||||
}
|
||||
return rc;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -390,6 +401,8 @@ int sqlite3VdbeMemSetStr(
|
|||
pMem->type = enc==0 ? SQLITE_BLOB : SQLITE_TEXT;
|
||||
pMem->n = n;
|
||||
|
||||
assert( enc==0 || enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE
|
||||
|| enc==SQLITE_UTF16BE );
|
||||
switch( enc ){
|
||||
case 0:
|
||||
pMem->flags |= MEM_Blob;
|
||||
|
@ -403,6 +416,7 @@ int sqlite3VdbeMemSetStr(
|
|||
}
|
||||
break;
|
||||
|
||||
#ifndef SQLITE_OMIT_UTF16
|
||||
case SQLITE_UTF16LE:
|
||||
case SQLITE_UTF16BE:
|
||||
pMem->flags |= MEM_Str;
|
||||
|
@ -413,10 +427,7 @@ int sqlite3VdbeMemSetStr(
|
|||
if( sqlite3VdbeMemHandleBom(pMem) ){
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
#endif /* SQLITE_OMIT_UTF16 */
|
||||
}
|
||||
if( pMem->flags&MEM_Ephem ){
|
||||
return sqlite3VdbeMemMakeWriteable(pMem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue