
sqlite
久许
朋友拍了拍我,说我可不是什么幺蛾子
展开
-
The SQLite Bytecode Engine
原文地址:https://www.sqlite.org/opcode.html1.执行摘要SQLite 通过将SQL语句翻译为字节码之后在虚拟机上运行该字节码的方式来工作。这篇文章来描述字节码引擎是如何工作的。这篇文章描述的是SQLite的内在。使用SQLite进行常规应用开发不需要此处提供的信息。这篇文章的目的是让人们更加深入了解SQLite的内部的运行机理。字节码引擎并不是SQ...翻译 2019-05-20 20:33:25 · 451 阅读 · 0 评论 -
sqlite源码中关于位图Bitvec的处理
关于Bitvet/*A bitmap is an instance of the following structure.This bitmap records the existence of zero or more bitswith values between 1 and iSize, inclusive.There are three possible represent...原创 2019-08-07 20:20:33 · 350 阅读 · 0 评论 -
sqlite源码中表示WSD的方式
/*When SQLITE_OMIT_WSD is defined, it means that the target platform doesnot support Writable Static Data (WSD) such as global and static variables.All variables must either be on the stack or dyna...原创 2019-08-10 10:51:38 · 472 阅读 · 0 评论 -
sqlite源码之memjournal.c
/*2008 October 7The author disclaims copyright to this source code. In place ofa legal notice, here is a blessing:May you do good and not evil.May you find forgiveness for yourself and forgive o...原创 2019-08-19 17:15:45 · 298 阅读 · 0 评论 -
sqlite源码之pcache1.c
/*Free slots in the allocator used to divide up the global page cachebuffer provided using the SQLITE_CONFIG_PAGECACHE mechanism.*/struct PgFreeslot { PgFreeslot *pNext; /* Next free slot */};...原创 2019-08-11 10:10:00 · 379 阅读 · 0 评论 -
sqlite实现sqlite3_status接口
This module implements the sqlite3_status() interface and relatedfunctionality.*/#include "sqliteInt.h"#include "vdbeInt.h"/*Variables in which to record status information.*/#if SQLITE_PTR...原创 2019-08-10 19:54:31 · 493 阅读 · 0 评论 -
SQLite源码之pcache.c续
pcacheFetchFinishWithInit/*This is a helper routine for sqlite3PcacheFetchFinish()In the uncommon case where the page being fetched has not beeninitialized, this routine is invoked to do the ini...原创 2019-08-15 17:30:06 · 231 阅读 · 0 评论 -
sqlite源码之os.c
/*2005 November 29The author disclaims copyright to this source code. In place ofa legal notice, here is a blessing:May you do good and not evil.May you find forgiveness for yourself and forgive...原创 2019-08-20 11:12:16 · 420 阅读 · 0 评论 -
PgHdr,PCache,PgHdr1,PGroup,PCache1,PgFreeslot
PgHdr/*Every page in the cache is controlled by an instance of the followingstructure.*/struct PgHdr { sqlite3_pcache_page *pPage; /* Pcache object page handle */ void *pData; ...原创 2019-08-09 21:43:48 · 496 阅读 · 0 评论 -
SQLite源码之pcache.c
/* Bit values for PgHdr.flags */如果换算成二进制的话,那么下表的各个标志的值分别为:0000 0000 00010000 0000 00100000 0000 01000000 0000 10000000 0001 00000000 0010 00000000 0100 0000#define PGHDR_CLEAN 0x...原创 2019-08-14 21:44:00 · 349 阅读 · 0 评论 -
SQLite杂念
1.2.8.5故障恢复the journal keeps an account of all write operations carried out by transaction on the database日志保存数据库上事务执行的所有写入操作的帐户Each log record has a header that is a descriptor for therecord, ...原创 2019-08-08 14:46:48 · 971 阅读 · 0 评论 -
sqlite源码分析
pager.c文件中有Pager的定义struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ u8 journalMode;...原创 2019-06-09 18:48:20 · 1706 阅读 · 0 评论 -
C#操作SQLite数据库
首先获取System.Data.SQLite支持然后使用SQLiteHelperusing System;using System.Collections.Generic;using System.Data.SQLite;using System.Data; namespace WindowsFormsApplication2{ public class...原创 2019-06-20 10:18:48 · 4603 阅读 · 0 评论 -
sqlite页面格式分析
B+树内部页格式分析指针数组内容为:0FFA0FF4 0FEE0FE8 0FE20FDC 0FD60FD0 0FCA0FC4 0FBE0FB8 0FB20FAC 0FA60FA0 0F9A指针数组指向的单元的内容为:0F9AH 地址:80900000 0013A177 (格式为:指针+key,即Ptr(0),Key(0))0FA0H 地址:8096 ...原创 2019-06-10 22:47:05 · 643 阅读 · 0 评论 -
sqlite页面分析
首先建表然后使用pyhton辅助生成插入数据的sql语句生成的sql语句如下:insert into stu values(NULL,'zhangsanaa');insert into stu values(NULL,'zhangsanab');insert into stu values(NULL,'zhangsanac');insert into stu values...原创 2019-06-11 22:22:48 · 2261 阅读 · 0 评论 -
sqlite之pager模块
Pager是the page cache。不仅仅包含cache实体,而且包含cache的其他的属性。struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ u8 exclusiveMode; /* Boolean. True if locking_mode==EXC...翻译 2019-07-25 11:29:41 · 1309 阅读 · 3 评论 -
sqlite3之btree.c探究
sqlite3Malloc/*Allocate memory. This routine is like sqlite3_malloc() except that itassumes the memory subsystem has already been initialized.*/void *sqlite3Malloc(u64 n){ void *p; if( n==...原创 2019-07-30 16:42:16 · 839 阅读 · 0 评论 -
sqlite学习
数据库最大页数 2^31如何找到一个指针所指向的内容? 1、找到指针映射页面的页码(PTRMAP_PAGENO) 2、找到对应指针的偏移(PTRMAP_PTROFFSET)指针映射的目的是什么? 将页面从文件中的一个位置移动到另一个位置,旧页更新后,必须更新原旧页的父级中的指针指向新位置每个SQLite表必须设置btree_intkey或...原创 2019-07-30 17:03:24 · 462 阅读 · 0 评论 -
SQLite源码之pcache1.c续
pcache1Unpin/*Implementation of the sqlite3_pcache.xUnpin method.Mark a page as unpinned (eligible for asynchronous recycling).*/最后一步*ppFirst = pPage最终结尾。ppFirst是指向PgHdr1指针的指针。ppFirst一直没有变,但是p...原创 2019-08-13 00:15:09 · 412 阅读 · 0 评论