Go to the source code of this file.
Defines | |
#define | expandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0) |
#define | MEMCELLSIZE (size_t)(&(((Mem *)0)->zMalloc)) |
Functions | |
int | sqlite3VdbeChangeEncoding (Mem *pMem, int desiredEnc) |
int | sqlite3VdbeMemGrow (Mem *pMem, int n, int preserve) |
int | sqlite3VdbeMemMakeWriteable (Mem *pMem) |
int | sqlite3VdbeMemExpandBlob (Mem *pMem) |
int | sqlite3VdbeMemNulTerminate (Mem *pMem) |
int | sqlite3VdbeMemStringify (Mem *pMem, int enc) |
int | sqlite3VdbeMemFinalize (Mem *pMem, FuncDef *pFunc) |
void | sqlite3VdbeMemReleaseExternal (Mem *p) |
void | sqlite3VdbeMemRelease (Mem *p) |
static i64 | doubleToInt64 (double r) |
i64 | sqlite3VdbeIntValue (Mem *pMem) |
double | sqlite3VdbeRealValue (Mem *pMem) |
void | sqlite3VdbeIntegerAffinity (Mem *pMem) |
static void | setTypeFlag (Mem *pMem, int f) |
int | sqlite3VdbeMemIntegerify (Mem *pMem) |
int | sqlite3VdbeMemRealify (Mem *pMem) |
int | sqlite3VdbeMemNumerify (Mem *pMem) |
void | sqlite3VdbeMemSetNull (Mem *pMem) |
void | sqlite3VdbeMemSetZeroBlob (Mem *pMem, int n) |
void | sqlite3VdbeMemSetInt64 (Mem *pMem, i64 val) |
void | sqlite3VdbeMemSetDouble (Mem *pMem, double val) |
int | sqlite3VdbeMemTooBig (Mem *p) |
void | sqlite3VdbeMemShallowCopy (Mem *pTo, const Mem *pFrom, int srcType) |
int | sqlite3VdbeMemCopy (Mem *pTo, const Mem *pFrom) |
void | sqlite3VdbeMemMove (Mem *pTo, Mem *pFrom) |
int | sqlite3VdbeMemSetStr (Mem *pMem, const char *z, int n, u8 enc, void(*xDel)(void *)) |
int | sqlite3MemCompare (const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl) |
int | sqlite3VdbeMemFromBtree (BtCursor *pCur, int offset, int amt, int key, Mem *pMem) |
const void * | sqlite3ValueText (sqlite3_value *pVal, u8 enc) |
sqlite3_value * | sqlite3ValueNew (sqlite3 *db) |
int | sqlite3ValueFromExpr (sqlite3 *db, Expr *pExpr, u8 enc, u8 affinity, sqlite3_value **ppVal) |
void | sqlite3ValueSetStr (sqlite3_value *v, int n, const void *z, u8 enc, void(*xDel)(void *)) |
void | sqlite3ValueFree (sqlite3_value *v) |
int | sqlite3ValueBytes (sqlite3_value *pVal, u8 enc) |
#define expandBlob | ( | P | ) | (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0) |
Definition at line 28 of file vdbemem.c.
Referenced by sqlite3ValueText(), and sqlite3VdbeMemMakeWriteable().
#define MEMCELLSIZE (size_t)(&(((Mem *)0)->zMalloc)) |
Definition at line 509 of file vdbemem.c.
Referenced by sqlite3VdbeMemCopy(), and sqlite3VdbeMemShallowCopy().
static i64 doubleToInt64 | ( | double | r | ) | [static] |
Definition at line 300 of file vdbemem.c.
References LARGEST_INT64, and SMALLEST_INT64.
Referenced by sqlite3VdbeIntegerAffinity(), sqlite3VdbeIntValue(), and sqlite3VdbeMemNumerify().
static void setTypeFlag | ( | Mem * | pMem, | |
int | f | |||
) | [static] |
Definition at line 394 of file vdbemem.c.
References MemSetTypeFlag.
Referenced by sqlite3VdbeMemIntegerify(), sqlite3VdbeMemNumerify(), sqlite3VdbeMemRealify(), sqlite3VdbeMemSetNull(), and sqlite3VdbeMemSetZeroBlob().
Definition at line 664 of file vdbemem.c.
References CollSeq::enc, Mem::enc, Mem::flags, Mem::i, MEM_Ephem, MEM_Int, MEM_Null, MEM_Real, MEM_Str, Mem::n, CollSeq::pUser, Mem::r, sqlite3ValueText(), sqlite3VdbeMemRelease(), sqlite3VdbeMemShallowCopy(), SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8, Mem::u, CollSeq::xCmp, and Mem::z.
Referenced by minmaxFunc(), minmaxStep(), nullifFunc(), sqlite3VdbeExec(), and sqlite3VdbeRecordCompare().
int sqlite3ValueBytes | ( | sqlite3_value * | pVal, | |
u8 | enc | |||
) |
Definition at line 1037 of file vdbemem.c.
References Mem::flags, Mem::i, MEM_Blob, MEM_Zero, Mem::n, sqlite3ValueText(), and Mem::u.
Referenced by sqlite3_value_bytes(), and sqlite3_value_bytes16().
void sqlite3ValueFree | ( | sqlite3_value * | v | ) |
Definition at line 1027 of file vdbemem.c.
References db, sqlite3DbFree(), and sqlite3VdbeMemRelease().
Referenced by callCollNeeded(), freeP4(), sqlite3_close(), sqlite3_complete16(), sqlite3_open16(), sqlite3AlterFinishAddColumn(), and sqlite3ValueFromExpr().
int sqlite3ValueFromExpr | ( | sqlite3 * | db, | |
Expr * | pExpr, | |||
u8 | enc, | |||
u8 | affinity, | |||
sqlite3_value ** | ppVal | |||
) |
Definition at line 950 of file vdbemem.c.
References Mem::i, sqlite3::mallocFailed, Token::n, Expr::op, Expr::pLeft, Mem::r, sqlite3DbFree(), sqlite3DbStrNDup(), sqlite3Dequote(), sqlite3HexToBlob(), sqlite3ValueApplyAffinity(), sqlite3ValueFree(), sqlite3ValueFromExpr(), sqlite3ValueNew(), sqlite3ValueSetStr(), sqlite3VdbeMemSetStr(), SQLITE_AFF_NONE, SQLITE_AFF_NUMERIC, SQLITE_DYNAMIC, SQLITE_NOMEM, SQLITE_OK, SQLITE_UTF8, TK_BLOB, TK_FLOAT, TK_INTEGER, TK_STRING, TK_UMINUS, Expr::token, Mem::u, and Token::z.
Referenced by sqlite3AlterFinishAddColumn(), sqlite3ColumnDefault(), and sqlite3ValueFromExpr().
sqlite3_value* sqlite3ValueNew | ( | sqlite3 * | db | ) |
Definition at line 930 of file vdbemem.c.
References Mem::db, Mem::flags, MEM_Null, sqlite3DbMallocZero(), SQLITE_NULL, and Mem::type.
Referenced by callCollNeeded(), sqlite3_complete16(), sqlite3_open16(), sqlite3Error(), and sqlite3ValueFromExpr().
void sqlite3ValueSetStr | ( | sqlite3_value * | v, | |
int | n, | |||
const void * | z, | |||
u8 | enc, | |||
void(*)(void *) | xDel | |||
) |
Definition at line 1014 of file vdbemem.c.
References sqlite3VdbeMemSetStr().
Referenced by callCollNeeded(), sqlite3_complete16(), sqlite3_errmsg16(), sqlite3_open16(), sqlite3Error(), sqlite3ValueFromExpr(), and sqlite3VdbeReset().
const void* sqlite3ValueText | ( | sqlite3_value * | pVal, | |
u8 | enc | |||
) |
Definition at line 892 of file vdbemem.c.
References Mem::db, Mem::enc, expandBlob, Mem::flags, sqlite3::mallocFailed, MEM_Blob, MEM_Ephem, MEM_Null, MEM_Static, sqlite3::mutex, sqlite3_mutex_held, sqlite3VdbeChangeEncoding(), sqlite3VdbeMemMakeWriteable(), sqlite3VdbeMemNulTerminate(), sqlite3VdbeMemStringify(), SQLITE_OK, SQLITE_PTR_TO_INT, SQLITE_UTF16_ALIGNED, and Mem::z.
Referenced by callCollNeeded(), sqlite3_complete16(), sqlite3_open16(), sqlite3_value_text(), sqlite3_value_text16(), sqlite3_value_text16be(), sqlite3_value_text16le(), sqlite3MemCompare(), and sqlite3ValueBytes().
int sqlite3VdbeChangeEncoding | ( | Mem * | pMem, | |
int | desiredEnc | |||
) |
Definition at line 43 of file vdbemem.c.
References Mem::db, Mem::enc, Mem::flags, MEM_Str, sqlite3::mutex, sqlite3_mutex_held, sqlite3VdbeMemTranslate(), SQLITE_ERROR, SQLITE_NOMEM, and SQLITE_OK.
Referenced by applyNumericAffinity(), bindText(), sqlite3_bind_value(), sqlite3Utf16to8(), sqlite3ValueText(), sqlite3VdbeExec(), sqlite3VdbeIntValue(), sqlite3VdbeMemStringify(), and sqlite3VdbeRealValue().
void sqlite3VdbeIntegerAffinity | ( | Mem * | pMem | ) |
Definition at line 384 of file vdbemem.c.
References Mem::db, doubleToInt64(), Mem::flags, Mem::i, MEM_Int, MEM_Real, sqlite3::mutex, Mem::r, sqlite3_mutex_held, and Mem::u.
Referenced by applyAffinity(), and sqlite3VdbeExec().
Definition at line 330 of file vdbemem.c.
References Mem::db, doubleToInt64(), Mem::flags, Mem::i, MEM_Blob, MEM_Int, MEM_Real, MEM_Str, sqlite3::mutex, Mem::r, sqlite3_mutex_held, sqlite3Atoi64(), sqlite3VdbeChangeEncoding(), sqlite3VdbeMemNulTerminate(), SQLITE_UTF8, Mem::u, and Mem::z.
Referenced by sqlite3_value_int(), sqlite3_value_int64(), sqlite3VdbeExec(), and sqlite3VdbeMemIntegerify().
Definition at line 532 of file vdbemem.c.
References Mem::flags, MEM_Blob, MEM_Dyn, MEM_Ephem, MEM_Static, MEM_Str, MEMCELLSIZE, sqlite3VdbeMemMakeWriteable(), sqlite3VdbeMemReleaseExternal(), and SQLITE_OK.
Referenced by minmaxStep(), sqlite3_bind_value(), and sqlite3_result_value().
int sqlite3VdbeMemExpandBlob | ( | Mem * | pMem | ) |
Definition at line 143 of file vdbemem.c.
References Mem::db, Mem::flags, Mem::i, MEM_Blob, MEM_Term, MEM_Zero, sqlite3::mutex, Mem::n, sqlite3_mutex_held, sqlite3VdbeMemGrow(), SQLITE_NOMEM, SQLITE_OK, Mem::u, and Mem::z.
Referenced by sqlite3_value_blob(), and sqlite3VdbeExec().
Definition at line 238 of file vdbemem.c.
References Mem::db, Mem::flags, sqlite3_context::isError, MEM_Dyn, MEM_Null, sqlite3::mutex, Mem::pDef, sqlite3_context::pFunc, sqlite3_context::pMem, sqlite3_context::s, sqlite3_mutex_held, sqlite3DbFree(), SQLITE_ERROR, SQLITE_OK, Mem::u, Mem::xDel, FuncDef::xFinalize, and Mem::zMalloc.
Referenced by sqlite3VdbeExec(), and sqlite3VdbeMemReleaseExternal().
Definition at line 788 of file vdbemem.c.
References db, Mem::enc, Mem::flags, MEM_Blob, MEM_Dyn, MEM_Ephem, MEM_Term, sqlite3::mutex, Mem::n, sqlite3_mutex_held, sqlite3BtreeCursorDb(), sqlite3BtreeData(), sqlite3BtreeDataFetch(), sqlite3BtreeKey(), sqlite3BtreeKeyFetch(), sqlite3VdbeMemGrow(), sqlite3VdbeMemRelease(), SQLITE_BLOB, SQLITE_OK, Mem::type, Mem::xDel, and Mem::z.
Referenced by sqlite3VdbeExec(), sqlite3VdbeIdxKeyCompare(), and sqlite3VdbeIdxRowid().
int sqlite3VdbeMemGrow | ( | Mem * | pMem, | |
int | n, | |||
int | preserve | |||
) |
Definition at line 77 of file vdbemem.c.
References Mem::db, Mem::flags, MEM_Dyn, MEM_Ephem, MEM_Null, MEM_Static, Mem::n, sqlite3DbFree(), sqlite3DbMallocRaw(), sqlite3DbMallocSize(), sqlite3DbReallocOrFree(), SQLITE_NOMEM, SQLITE_OK, Mem::xDel, Mem::z, and Mem::zMalloc.
Referenced by allocateCursor(), sqlite3_aggregate_context(), sqlite3VdbeExec(), sqlite3VdbeList(), sqlite3VdbeMemExpandBlob(), sqlite3VdbeMemFromBtree(), sqlite3VdbeMemMakeWriteable(), sqlite3VdbeMemNulTerminate(), sqlite3VdbeMemSetStr(), and sqlite3VdbeMemStringify().
int sqlite3VdbeMemIntegerify | ( | Mem * | pMem | ) |
Definition at line 401 of file vdbemem.c.
References Mem::db, Mem::i, MEM_Int, sqlite3::mutex, setTypeFlag(), sqlite3_mutex_held, sqlite3VdbeIntValue(), SQLITE_OK, and Mem::u.
Referenced by sqlite3VdbeExec(), and sqlite3VdbeMemNumerify().
int sqlite3VdbeMemMakeWriteable | ( | Mem * | pMem | ) |
Definition at line 121 of file vdbemem.c.
References Mem::db, expandBlob, f(), Mem::flags, MEM_Blob, MEM_Str, MEM_Term, sqlite3::mutex, Mem::n, sqlite3_mutex_held, sqlite3VdbeMemGrow(), SQLITE_NOMEM, SQLITE_OK, Mem::z, and Mem::zMalloc.
Referenced by sqlite3ValueText(), sqlite3VdbeExec(), sqlite3VdbeMemCopy(), sqlite3VdbeMemHandleBom(), and sqlite3VdbeMemTranslate().
Definition at line 555 of file vdbemem.c.
References Mem::db, Mem::flags, MEM_Null, sqlite3::mutex, sqlite3_mutex_held, sqlite3VdbeMemRelease(), Mem::xDel, and Mem::zMalloc.
Referenced by sqlite3TransferBindings(), and sqlite3VdbeExec().
int sqlite3VdbeMemNulTerminate | ( | Mem * | pMem | ) |
Definition at line 170 of file vdbemem.c.
References Mem::db, Mem::flags, MEM_Str, MEM_Term, sqlite3::mutex, Mem::n, sqlite3_mutex_held, sqlite3VdbeMemGrow(), SQLITE_NOMEM, SQLITE_OK, and Mem::z.
Referenced by applyNumericAffinity(), sqlite3ValueText(), sqlite3VdbeExec(), sqlite3VdbeIntValue(), and sqlite3VdbeRealValue().
int sqlite3VdbeMemNumerify | ( | Mem * | pMem | ) |
Definition at line 423 of file vdbemem.c.
References Mem::db, doubleToInt64(), Mem::flags, MEM_Blob, MEM_Int, MEM_Null, MEM_Real, MEM_Str, sqlite3::mutex, Mem::r, setTypeFlag(), sqlite3_mutex_held, sqlite3VdbeMemIntegerify(), sqlite3VdbeRealValue(), and SQLITE_OK.
Referenced by sqlite3VdbeExec().
int sqlite3VdbeMemRealify | ( | Mem * | pMem | ) |
Definition at line 412 of file vdbemem.c.
References Mem::db, MEM_Real, sqlite3::mutex, Mem::r, setTypeFlag(), sqlite3_mutex_held, sqlite3VdbeRealValue(), and SQLITE_OK.
Referenced by applyNumericAffinity(), and sqlite3VdbeExec().
void sqlite3VdbeMemRelease | ( | Mem * | p | ) |
Definition at line 280 of file vdbemem.c.
References Mem::db, sqlite3DbFree(), sqlite3VdbeMemReleaseExternal(), Mem::xDel, Mem::z, and Mem::zMalloc.
Referenced by minMaxFinalize(), releaseMemArray(), sqlite3_clear_bindings(), sqlite3MemCompare(), sqlite3Utf16to8(), sqlite3ValueFree(), sqlite3VdbeDeleteUnpackedRecord(), sqlite3VdbeExec(), sqlite3VdbeIdxKeyCompare(), sqlite3VdbeIdxRowid(), sqlite3VdbeMemFromBtree(), sqlite3VdbeMemMove(), sqlite3VdbeMemReleaseExternal(), sqlite3VdbeMemSetDouble(), sqlite3VdbeMemSetInt64(), sqlite3VdbeMemSetStr(), sqlite3VdbeMemSetZeroBlob(), sqlite3VdbeMemTranslate(), sqlite3VdbeRecordCompare(), and vdbeUnbind().
void sqlite3VdbeMemReleaseExternal | ( | Mem * | p | ) |
Definition at line 263 of file vdbemem.c.
References Mem::db, Mem::flags, MEM_Agg, MEM_Dyn, sqlite3::mutex, Mem::pDef, sqlite3_mutex_held, sqlite3VdbeMemFinalize(), sqlite3VdbeMemRelease(), Mem::u, Mem::xDel, and Mem::z.
Referenced by sqlite3_aggregate_context(), sqlite3VdbeExec(), sqlite3VdbeMemCopy(), sqlite3VdbeMemRelease(), and sqlite3VdbeMemShallowCopy().
void sqlite3VdbeMemSetDouble | ( | Mem * | pMem, | |
double | val | |||
) |
Definition at line 479 of file vdbemem.c.
References Mem::flags, MEM_Real, Mem::r, sqlite3IsNaN(), sqlite3VdbeMemRelease(), sqlite3VdbeMemSetNull(), SQLITE_FLOAT, and Mem::type.
Referenced by sqlite3_bind_double(), and sqlite3_result_double().
Definition at line 468 of file vdbemem.c.
References Mem::flags, Mem::i, MEM_Int, sqlite3VdbeMemRelease(), SQLITE_INTEGER, Mem::type, and Mem::u.
Referenced by sqlite3_bind_int64(), sqlite3_result_int(), and sqlite3_result_int64().
void sqlite3VdbeMemSetNull | ( | Mem * | pMem | ) |
Definition at line 444 of file vdbemem.c.
References MEM_Null, setTypeFlag(), SQLITE_NULL, and Mem::type.
Referenced by sqlite3_result_error_nomem(), sqlite3_result_null(), sqlite3VdbeExec(), sqlite3VdbeMemSetDouble(), and sqlite3VdbeMemSetStr().
Definition at line 576 of file vdbemem.c.
References sqlite3::aLimit, Mem::db, Mem::enc, Mem::flags, MEM_Blob, MEM_Dyn, MEM_Static, MEM_Str, MEM_Term, sqlite3::mutex, Mem::n, sqlite3_mutex_held, sqlite3VdbeMemGrow(), sqlite3VdbeMemHandleBom(), sqlite3VdbeMemRelease(), sqlite3VdbeMemSetNull(), SQLITE_BLOB, SQLITE_DYNAMIC, SQLITE_LIMIT_LENGTH, SQLITE_MAX_LENGTH, SQLITE_NOMEM, SQLITE_OK, SQLITE_STATIC, SQLITE_TEXT, SQLITE_TOOBIG, SQLITE_TRANSIENT, SQLITE_UTF8, Mem::type, Mem::xDel, Mem::z, and Mem::zMalloc.
Referenced by bindText(), sqlite3_result_blob(), sqlite3_result_error(), sqlite3_result_error16(), sqlite3_result_error_toobig(), sqlite3_result_text(), sqlite3_result_text16(), sqlite3_result_text16be(), sqlite3_result_text16le(), sqlite3Utf16to8(), sqlite3ValueFromExpr(), sqlite3ValueSetStr(), sqlite3VdbeExec(), sqlite3VdbeList(), and sqlite3VdbeSetColName().
void sqlite3VdbeMemSetZeroBlob | ( | Mem * | pMem, | |
int | n | |||
) |
Definition at line 453 of file vdbemem.c.
References Mem::enc, Mem::flags, Mem::i, MEM_Blob, MEM_Zero, Mem::n, setTypeFlag(), sqlite3VdbeMemRelease(), SQLITE_BLOB, SQLITE_UTF8, Mem::type, and Mem::u.
Referenced by sqlite3_bind_zeroblob(), and sqlite3_result_zeroblob().
Definition at line 517 of file vdbemem.c.
References Mem::flags, MEM_Dyn, MEM_Ephem, MEM_Static, MEMCELLSIZE, sqlite3VdbeMemReleaseExternal(), Mem::xDel, Mem::z, and Mem::zMalloc.
Referenced by sqlite3MemCompare(), and sqlite3VdbeExec().
int sqlite3VdbeMemStringify | ( | Mem * | pMem, | |
int | enc | |||
) |
Definition at line 197 of file vdbemem.c.
References Mem::db, Mem::enc, Mem::flags, Mem::i, MEM_Blob, MEM_Int, MEM_Real, MEM_Str, MEM_Term, MEM_Zero, sqlite3::mutex, Mem::n, Mem::r, sqlite3_mutex_held, sqlite3_snprintf(), sqlite3VdbeChangeEncoding(), sqlite3VdbeMemGrow(), SQLITE_NOMEM, SQLITE_OK, SQLITE_UTF8, Mem::u, and Mem::z.
Referenced by applyAffinity(), and sqlite3ValueText().
int sqlite3VdbeMemTooBig | ( | Mem * | p | ) |
Definition at line 494 of file vdbemem.c.
References sqlite3::aLimit, Mem::db, Mem::flags, Mem::i, MEM_Blob, MEM_Str, MEM_Zero, Mem::n, SQLITE_LIMIT_LENGTH, and Mem::u.
Referenced by sqlite3VdbeExec().
double sqlite3VdbeRealValue | ( | Mem * | pMem | ) |
Definition at line 359 of file vdbemem.c.
References Mem::db, Mem::flags, Mem::i, MEM_Blob, MEM_Int, MEM_Real, MEM_Str, sqlite3::mutex, Mem::r, sqlite3_mutex_held, sqlite3AtoF(), sqlite3VdbeChangeEncoding(), sqlite3VdbeMemNulTerminate(), SQLITE_UTF8, Mem::u, and Mem::z.
Referenced by sqlite3_value_double(), sqlite3VdbeExec(), sqlite3VdbeMemNumerify(), and sqlite3VdbeMemRealify().
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:02 2011 by Doxygen 1.6.1