亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fileformat.tcl

?? sqlite庫
?? TCL
?? 第 1 頁 / 共 2 頁
字號:
## Run this script to generated a fileformat.html output file#set rcsid {$Id: fileformat.tcl,v 1.13 2004/10/10 17:24:55 drh Exp $}source common.tclheader {SQLite Database File Format (Version 2)}puts {<h2>SQLite 2.X Database File Format</h2><p>This document describes the disk file format for SQLite versions 2.1through 2.8.  SQLite version 3.0 and following uses a very differentformat which is described separately.</p><h3>1.0 &nbsp; Layers</h3><p>SQLite is implemented in layers.(See the <a href="arch.html">architecture description</a>.)The format of database files is determined by three differentlayers in the architecture.</p><ul><li>The <b>schema</b> layer implemented by the VDBE.</li><li>The <b>b-tree</b> layer implemented by btree.c</li><li>The <b>pager</b> layer implemented by pager.c</li></ul><p>We will describe each layer beginning with the bottom (pager)layer and working upwards.</p><h3>2.0 &nbsp; The Pager Layer</h3><p>An SQLite database consists of"pages" of data.  Each page is 1024 bytes in size.Pages are numbered beginning with 1.A page number of 0 is used to indicate "no such page" in theB-Tree and Schema layers.</p><p>The pager layer is responsible for implementing transactionswith atomic commit and rollback.  It does this using a separatejournal file.  Whenever a new transaction is started, a journalfile is created that records the original state of the database.If the program terminates before completing the transaction, the nextprocess to open the database can use the journal file to restorethe database to its original state.</p><p>The journal file is located in the same directory as the databasefile and has the same name as the database file but with thecharacters "<tt>-journal</tt>" appended.</p><p>The pager layer does not impose any content restrictions on themain database file.  As far as the pager is concerned, each pagecontains 1024 bytes of arbitrary data.  But there is structure tothe journal file.</p><p>A journal file begins with 8 bytes as follows:0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, and 0xd6.Processes that are attempting to rollback a journal use these 8 bytesas a sanity check to make sure the file they think is a journal reallyis a valid journal.  Prior version of SQLite used different journalfile formats.  The magic numbers for these prior formats are differentso that if a new version of the library attempts to rollback a journalcreated by an earlier version, it can detect that the journal usesan obsolete format and make the necessary adjustments.  This articledescribes only the newest journal format - supported as of version2.8.0.</p><p>Following the 8 byte prefix is a three 4-byte integers that tell usthe number of pages that have been committed to the journal,a magic number used forsanity checking each page, and theoriginal size of the main database file before the transaction wasstarted.  The number of committed pages is used to limit how farinto the journal to read.  The use of the checksum magic number isdescribed below.The original size of the database is used to restore the databasefile back to its original size.The size is expressed in pages (1024 bytes per page).</p><p>All three integers in the journal header and all other multi-bytenumbers used in the journal file are big-endian.That means that the most significant byteoccurs first.  That way, a journal file that isoriginally created on one machine can be rolled back by anothermachine that uses a different byte order.  So, for example, atransaction that failed to complete on your big-endian SparcStationcan still be rolled back on your little-endian Linux box.</p><p>After the 8-byte prefix and the three 4-byte integers, thejournal file consists of zero or more page records.  Each pagerecord is a 4-byte (big-endian) page number followed by 1024 bytesof data and a 4-byte checksum.  The data is the original content of the database pagebefore the transaction was started.  So to roll back the transaction,the data is simply written into the corresponding page of themain database file.  Pages can appear in the journal in any order,but they are guaranteed to appear only once. All page numbers will bebetween 1 and the maximum specified by the page size integer thatappeared at the beginning of the journal.</p><p>The so-called checksum at the end of each record is not really achecksum - it is the sum of the page number and the magic number whichwas the second integer in the journal header.  The purpose of thisvalue is to try to detect journal corruption that might have occurredbecause of a power loss or OS crash that occurred which the journalfile was being written to disk.  It could have been the case that themeta-data for the journal file, specifically the size of the file, hadbeen written to the disk so that when the machine reboots it appears thatfile is large enough to hold the current record.  But even though thefile size has changed, the data for the file might not have made it tothe disk surface at the time of the OS crash or power loss.  This meansthat after reboot, the end of the journal file will contain quasi-randomgarbage data.  The checksum is an attempt to detect such corruption.  Ifthe checksum does not match, that page of the journal is not rolled back.</p><p>Here is a summary of the journal file format:</p><ul><li>8 byte prefix: 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd6</li><li>4 byte number of records in journal</li><li>4 byte magic number used for page checksums</li><li>4 byte initial database page count</li><li>Zero or more instances of the following:   <ul>   <li>4 byte page number</li>   <li>1024 bytes of original data for the page</li>   <li>4 byte checksum</li>   </ul></li></ul><h3>3.0 &nbsp; The B-Tree Layer</h3><p>The B-Tree layer builds on top of the pager layer to implementone or more separate b-trees all in the same disk file.  Thealgorithms used are taken from Knuth's <i>The Art Of ComputerProgramming.</i></p><p>Page 1 of a database contains a header string used for sanitychecking, a few 32-bit words of configuration data, and a pointerto the beginning of a list of unused pages in the database.All other pages in thedatabase are either pages of a b-tree, overflow pages, or unusedpages on the freelist.</p><p>Each b-tree page contains zero or more database entries.Each entry has an unique key of one or more bytes and data ofzero or more bytes.Both the key and data are arbitrary byte sequences.  The combinationof key and data are collectively known as "payload".  The currentimplementation limits the amount of payload in a single entry to1048576 bytes.  This limit can be raised to 16777216 by adjustinga single #define in the source code and recompiling.  But most entriescontain less than a hundred bytes of payload so a megabyte limit seemsmore than enough.</p><p>Up to 238 bytes of payload for an entry can be held directly ona b-tree page.  Any additional payload is contained on a linked listof overflow pages.  This limit on the amount of payload held directlyon b-tree pages guarantees that each b-tree page can hold at least4 entries.  In practice, most entries are smaller than 238 bytes andthus most pages can hold more than 4 entries.</p><p>A single database file can hold any number of separate, independent b-trees.Each b-tree is identified by its root page, which never changes.Child pages of the b-tree may change as entries are added and removedand pages split and combine.  But the root page always stays the same.The b-tree itself does not record which pages are root pages and whichare not.  That information is handled entirely at the schema layer.</p><h4>3.1 &nbsp; B-Tree Page 1 Details</h4><p>Page 1 begins with the following 48-byte string:</p><blockquote><pre>** This file contains an SQLite 2.1 database **</pre></blockquote><p>If you count the number of characters in the string above, you willsee that there are only 47.  A '\000' terminator byte is added tobring the total to 48.</p><p>A frequent question is why the string says version 2.1 when (asof this writing) we are up to version 2.7.0 of SQLite and anychange to the second digit of the version is suppose to representa database format change.  The answer to this is that the B-treelayer has not changed any since version 2.1.  There have beendatabase format changes since version 2.1 but those changes haveall been in the schema layer.  Because the format of the b-treelayer is unchanged since version 2.1.0, the header string stillsays version 2.1.</p><p>After the format string is a 4-byte integer used to determine thebyte-order of the database.  The integer has a value of0xdae37528.  If this number is expressed as 0xda, 0xe3, 0x75, 0x28, thenthe database is in a big-endian format and all 16 and 32-bit integerselsewhere in the b-tree layer are also big-endian.  If the number isexpressed as 0x28, 0x75, 0xe3, and 0xda, then the database is in alittle-endian format and all other multi-byte numbers in the b-tree layer are also little-endian.  Prior to version 2.6.3, the SQLite engine was only able to read databasesthat used the same byte order as the processor they were running on.But beginning with 2.6.3, SQLite can read or write databases in anybyte order.</p><p>After the byte-order code are six 4-byte integers.  Each integer is in thebyte order determined by the byte-order code.  The first integer is thepage number for the first page of the freelist.  If there are no unusedpages in the database, then this integer is 0.  The second integer isthe number of unused pages in the database.  The last 4 integers arenot used by the b-tree layer.  These are the so-called "meta" values thatare passed up to the schema layerand used there for configuration and format version information.All bytes of page 1 past beyond the meta-value integers are unused and are initialized to zero.</p><p>Here is a summary of the information contained on page 1 in the b-tree layer:</p><ul><li>48 byte header string</li><li>4 byte integer used to determine the byte-order</li><li>4 byte integer which is the first page of the freelist</li><li>4 byte integer which is the number of pages on the freelist</li><li>36 bytes of meta-data arranged as nine 4-byte integers</li><li>928 bytes of unused space</li></ul><h4>3.2 &nbsp; Structure Of A Single B-Tree Page</h4><p>Conceptually, a b-tree page contains N database entries and N+1 pointersto other b-tree pages.</p><blockquote><table border=1 cellspacing=0 cellpadding=5><tr><td align="center">Ptr<br>0</td><td align="center">Entry<br>0</td><td align="center">Ptr<br>1</td><td align="center">Entry<br>1</td><td align="center"><b>...</b></td><td align="center">Ptr<br>N-1</td><td align="center">Entry<br>N-1</td><td align="center">Ptr<br>N</td></tr></table></blockquote><p>The entries are arranged in increasing order.  That is, the key toEntry 0 is less than the key to Entry 1, and the key to Entry 1 isless than the key of Entry 2, and so forth.  The pointers point topages containing additional entries that have keys in between theentries on either side.  So Ptr 0 points to another b-tree page thatcontains entries that all have keys less than Key 0, and Ptr 1points to a b-tree pages where all entries have keys greater than Key 0but less than Key 1, and so forth.</p><p>Each b-tree page in SQLite consists of a header, zero or more "cells"each holding a single entry and pointer, and zero or more "free blocks"that represent unused space on the page.</p><p>The header on a b-tree page is the first 8 bytes of the page.The header contains the valueof the right-most pointer (Ptr N) and the byte offset into the pageof the first cell and the first free block.  The pointer is a 32-bitvalue and the offsets are each 16-bit values.  We have:</p><blockquote><table border=1 cellspacing=0 cellpadding=5><tr><td align="center" width=30>0</td><td align="center" width=30>1</td><td align="center" width=30>2</td><td align="center" width=30>3</td><td align="center" width=30>4</td><td align="center" width=30>5</td><td align="center" width=30>6</td><td align="center" width=30>7</td></tr><tr><td align="center" colspan=4>Ptr N</td><td align="center" colspan=2>Cell 0</td><td align="center" colspan=2>Freeblock 0</td></tr></table></blockquote><p>The 1016 bytes of a b-tree page that come after the header containcells and freeblocks.  All 1016 bytes are covered by either a cellor a freeblock.</p><p>The cells are connected in a linked list.  Cell 0 contains Ptr 0 andEntry 0.  Bytes 4 and 5 of the header point to Cell 0.  Cell 0 thenpoints to Cell 1 which contains Ptr 1 and Entry 1.  And so forth.Cells vary in size.  Every cell has a 12-byte header and at least 4bytes of payload space.  Space is allocated to payload in incrementsof 4 bytes.  Thus the minimum size of a cell is 16 bytes and up to63 cells can fit on a single page.  The size of a cell is always a multipleof 4 bytes.A cell can have up to 238 bytes of payload space.  Ifthe payload is more than 238 bytes, then an additional 4 byte pagenumber is appended to the cell which is the page number of the firstoverflow page containing the additional payload.  The maximum sizeof a cell is thus 254 bytes, meaning that a least 4 cells can fit intothe 1016 bytes of space available on a b-tree page.An average cell is usually around 52 to 100 bytes in size with about10 or 20 cells to a page.</p><p>The data layout of a cell looks like this:</p><blockquote><table border=1 cellspacing=0 cellpadding=5><tr><td align="center" width=20>0</td><td align="center" width=20>1</td><td align="center" width=20>2</td><td align="center" width=20>3</td><td align="center" width=20>4</td><td align="center" width=20>5</td><td align="center" width=20>6</td><td align="center" width=20>7</td><td align="center" width=20>8</td><td align="center" width=20>9</td><td align="center" width=20>10</td><td align="center" width=20>11</td><td align="center" width=100>12 ... 249</td><td align="center" width=20>250</td><td align="center" width=20>251</td><td align="center" width=20>252</td><td align="center" width=20>253</td></tr><tr><td align="center" colspan=4>Ptr</td><td align="center" colspan=2>Keysize<br>(low)</td>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费av成人在线| 麻豆精品在线播放| 日韩欧美一区二区久久婷婷| 国产宾馆实践打屁股91| 无吗不卡中文字幕| 国产精品成人免费在线| 欧美成人性福生活免费看| 色综合网站在线| 高清在线不卡av| 日韩电影免费在线观看网站| 亚洲激情综合网| 精品久久一区二区| 欧美日韩美少妇| 色综合中文综合网| 亚洲色图欧美偷拍| xf在线a精品一区二区视频网站| 91激情在线视频| 成人av电影免费在线播放| 国内精品视频666| 奇米影视在线99精品| 亚洲高清在线视频| 亚洲一区二区三区视频在线 | 91行情网站电视在线观看高清版| 成人丝袜高跟foot| 国产不卡高清在线观看视频| 国内外成人在线| 韩国毛片一区二区三区| 蜜臂av日日欢夜夜爽一区| 午夜久久福利影院| 亚洲国产sm捆绑调教视频| 亚洲精品国产一区二区精华液 | 国产精品国产三级国产普通话三级| 欧美va亚洲va在线观看蝴蝶网| 91精品在线麻豆| 在线播放一区二区三区| 欧美伦理电影网| 欧美精品乱码久久久久久| 欧美老肥妇做.爰bbww| 欧美久久久久久久久久| 欧美一区二区三区影视| 91精品国产91久久久久久最新毛片| 欧美网站大全在线观看| 欧美日韩一区二区三区不卡| 欧美性大战久久久久久久蜜臀| 91国偷自产一区二区开放时间 | 26uuu色噜噜精品一区| 精品国产乱码久久久久久1区2区 | 一区二区在线免费观看| 亚洲精品精品亚洲| 亚洲最大色网站| 午夜成人免费电影| 美女久久久精品| 国产盗摄一区二区| 91视视频在线观看入口直接观看www | 日韩高清不卡一区二区三区| 日韩av电影免费观看高清完整版| 奇米777欧美一区二区| 狠狠色综合播放一区二区| 国产成人亚洲综合a∨婷婷图片| 成人美女在线观看| 在线欧美日韩精品| 欧美肥胖老妇做爰| 久久先锋影音av鲁色资源网| 欧美国产精品劲爆| 亚洲欧美精品午睡沙发| 午夜电影网亚洲视频| 精品一区二区三区免费毛片爱| 国产91在线观看| 91国产成人在线| 91精品国产一区二区三区蜜臀| 精品久久久久久久久久久久久久久久久 | 国产精品一色哟哟哟| 成人av在线播放网址| 欧美在线一二三| 日韩欧美一区二区视频| 久久久精品人体av艺术| 综合激情网...| 日本欧美在线看| 成人美女视频在线观看18| 在线观看亚洲专区| 欧美成人三级在线| 亚洲美女视频在线观看| 久久99精品国产91久久来源| 暴力调教一区二区三区| 欧美男生操女生| 中文字幕一区在线| 日韩国产精品久久久| 丁香激情综合国产| 91精品国产综合久久久久久久久久 | 色综合天天做天天爱| 欧美高清视频不卡网| 亚洲国产高清在线观看视频| 亚洲国产一区二区三区| 国产91丝袜在线播放0| 欧美狂野另类xxxxoooo| 亚洲欧洲日韩一区二区三区| 日韩电影免费在线看| 91麻豆免费看| 26uuu精品一区二区在线观看| 亚洲在线视频网站| 国产经典欧美精品| 91麻豆精品国产综合久久久久久| 亚洲欧洲精品一区二区三区 | 美女一区二区三区在线观看| 99精品热视频| 久久欧美一区二区| 三级在线观看一区二区| 99国产欧美久久久精品| 国产色综合一区| 久久99精品国产91久久来源| 欧美日韩不卡一区二区| 一区二区三区资源| 国产成人综合亚洲网站| 精品久久久久久久一区二区蜜臀| 亚洲妇熟xx妇色黄| 欧美一a一片一级一片| 中文av字幕一区| 韩国欧美一区二区| 日韩丝袜美女视频| 日韩中文字幕亚洲一区二区va在线| av毛片久久久久**hd| 国产清纯在线一区二区www| 国内一区二区在线| 91精品国产高清一区二区三区 | 色先锋久久av资源部| 中文字幕精品—区二区四季| 精品夜夜嗨av一区二区三区| 欧美一区二区三区四区久久 | 五月婷婷激情综合| 91黄色免费网站| 一个色综合av| 欧美色偷偷大香| 伊人开心综合网| 欧美丝袜丝nylons| 亚洲大尺度视频在线观看| 日本高清无吗v一区| 一区二区三区小说| 色哟哟精品一区| 亚洲制服丝袜在线| 欧美图片一区二区三区| 天堂va蜜桃一区二区三区漫画版| 精品视频在线视频| 日韩在线一二三区| 欧美一区二区三区爱爱| 久色婷婷小香蕉久久| 精品国产免费人成电影在线观看四季 | 亚洲一线二线三线久久久| 日本韩国一区二区| 天天做天天摸天天爽国产一区 | 9人人澡人人爽人人精品| 中文字幕综合网| 色婷婷久久久综合中文字幕| 亚洲第一搞黄网站| 日韩欧美的一区| 国产99精品国产| 亚洲欧美另类图片小说| 欧美亚洲国产一区二区三区| 亚洲午夜在线电影| 日韩一区二区在线观看视频 | 欧美在线综合视频| 亚洲国产日日夜夜| 欧美成人欧美edvon| 成人在线综合网| 亚洲精品日韩专区silk| 欧美三级中文字| 日韩精品1区2区3区| 久久综合久久99| 一本色道久久综合亚洲aⅴ蜜桃 | 一区二区三区四区在线播放| 在线不卡a资源高清| 国产黄人亚洲片| 亚洲女性喷水在线观看一区| 欧美美女网站色| 国产精品一区二区不卡| 亚洲美女淫视频| 日韩欧美高清在线| youjizz久久| 日韩国产高清在线| 欧美激情综合网| 欧美日韩精品福利| 成人永久aaa| 日韩精品乱码av一区二区| 国产日韩欧美高清在线| 欧美日韩高清一区| 高清日韩电视剧大全免费| 日韩精品一级中文字幕精品视频免费观看| 精品理论电影在线观看| 91福利在线导航| 国产丶欧美丶日本不卡视频| 亚洲午夜影视影院在线观看| 国产欧美日韩麻豆91| 欧美一级久久久| 色综合视频在线观看| 国模冰冰炮一区二区| 亚洲成人自拍网| 国产精品乱码一区二三区小蝌蚪| 日韩视频一区二区三区在线播放| 白白色 亚洲乱淫| 经典三级一区二区| 天天色图综合网|