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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? vdbe.tcl

?? 新版輕量級嵌入式數(shù)據(jù)庫
?? TCL
?? 第 1 頁 / 共 5 頁
字號:
## Run this Tcl script to generate the vdbe.html file.#set rcsid {$Id: vdbe.tcl,v 1.14 2005/03/12 15:55:11 drh Exp $}source common.tclheader {The Virtual Database Engine of SQLite}puts {<h2>The Virtual Database Engine of SQLite</h2><blockquote><b>This document describes the virtual machine used in SQLite version 2.8.0. The virtual machine in SQLite version 3.0 and 3.1 is very similar inconcept but many of the opcodes have changed and the algorithms aresomewhat different.  Use this document as a rough guide to the ideabehind the virtual machine in SQLite version 3, not as a reference onhow the virtual machine works.</b></blockquote>}puts {<p>If you want to know how the SQLite library works internally,you need to begin with a solid understanding of the Virtual DatabaseEngine or VDBE.  The VDBE occurs right in the middle of theprocessing stream (see the <a href="arch.html">architecture diagram</a>)and so it seems to touch most parts of the library.  Evenparts of the code that do not directly interact with the VDBEare usually in a supporting role.  The VDBE really is the heart ofSQLite.</p><p>This article is a brief introduction to how the VDBEworks and in particular how the various VDBE instructions(documented <a href="opcode.html">here</a>) work togetherto do useful things with the database.  The style is tutorial,beginning with simple tasks and working toward solving morecomplex problems.  Along the way we will visit mostsubmodules in the SQLite library.  After completeing this tutorial,you should have a pretty good understanding of how SQLite worksand will be ready to begin studying the actual source code.</p><h2>Preliminaries</h2><p>The VDBE implements a virtual computer that runs a program inits virtual machine language.  The goal of each program is to interrogate or change the database.  Toward this end, the machinelanguage that the VDBE implements is specifically designed tosearch, read, and modify databases.</p><p>Each instruction of the VDBE language contains an opcode andthree operands labeled P1, P2, and P3.  Operand P1 is an arbitraryinteger.   P2 is a non-negative integer.  P3 is a pointer to a data structure or null-terminated string, possibly null.  Only a few VDBEinstructions use all three operands.  Many instructions use onlyone or two operands.  A significant number of instructions useno operands at all but instead take their data and store their resultson the execution stack.  The details of what each instructiondoes and which operands it uses are described in the separate<a href="opcode.html">opcode description</a> document.</p><p>A VDBE program beginsexecution on instruction 0 and continues with successive instructionsuntil it either (1) encounters a fatal error, (2) executes aHalt instruction, or (3) advances the program counter past thelast instruction of the program.  When the VDBE completes execution,all open database cursors are closed, all memory is freed, and everything is popped from the stack.So there are never any worries about memory leaks or undeallocated resources.</p><p>If you have done any assembly language programming or haveworked with any kind of abstract machine before, all of thesedetails should be familiar to you.  So let's jump right in andstart looking as some code.</p><a name="insert1"><h2>Inserting Records Into The Database</h2><p>We begin with a problem that can be solved using a VDBE programthat is only a few instructions long.  Suppose we have an SQLtable that was created like this:</p><blockquote><pre>CREATE TABLE examp(one text, two int);</pre></blockquote><p>In words, we have a database table named "examp" that has twocolumns of data named "one" and "two".  Now suppose we want to insert a singlerecord into this table.  Like this:</p><blockquote><pre>INSERT INTO examp VALUES('Hello, World!',99);</pre></blockquote><p>We can see the VDBE program that SQLite uses to implement thisINSERT using the <b>sqlite</b> command-line utility.  First startup <b>sqlite</b> on a new, empty database, then create the table.Next change the output format of <b>sqlite</b> to a form thatis designed to work with VDBE program dumps by entering the".explain" command.Finally, enter the INSERT statement shown above, but precede theINSERT with the special keyword "EXPLAIN".  The EXPLAIN keywordwill cause <b>sqlite</b> to print the VDBE program rather than execute it.  We have:</p>}proc Code {body} {  puts {<blockquote><tt>}  regsub -all {&} [string trim $body] {\&amp;} body  regsub -all {>} $body {\&gt;} body  regsub -all {<} $body {\&lt;} body  regsub -all {\(\(\(} $body {<b>} body  regsub -all {\)\)\)} $body {</b>} body  regsub -all { } $body {\&nbsp;} body  regsub -all \n $body <br>\n body  puts $body  puts {</tt></blockquote>}}Code {$ (((sqlite test_database_1)))sqlite> (((CREATE TABLE examp(one text, two int);)))sqlite> (((.explain)))sqlite> (((EXPLAIN INSERT INTO examp VALUES('Hello, World!',99);)))addr  opcode        p1     p2     p3                                      ----  ------------  -----  -----  -----------------------------------0     Transaction   0      0                                         1     VerifyCookie  0      81                                        2     Transaction   1      0                                         3     Integer       0      0                                         4     OpenWrite     0      3      examp                              5     NewRecno      0      0                                         6     String        0      0      Hello, World!                      7     Integer       99     0      99                                 8     MakeRecord    2      0                                         9     PutIntKey     0      1                                         10    Close         0      0                                         11    Commit        0      0                                         12    Halt          0      0                                         }puts {<p>As you can see above, our simple insert statement isimplemented in 12 instructions.  The first 3 and last 2 instructions are a standard prologue and epilogue, so the real work is done in the middle 7 instructions.  There are no jumps, so the program executes once through from top to bottom.  Let's now look at each instruction in detail.<p>}Code {0     Transaction   0      0                                         1     VerifyCookie  0      81                                        2     Transaction   1      0                                         }puts {<p>The instruction <a href="opcode.html#Transaction">Transaction</a> begins a transaction.  The transaction ends when a Commit or Rollback opcode is encountered.  P1 is the index of the database file on which the transaction is started.  Index 0 is the main database file.  A write lock is obtained on the database file when a transaction is started.  No other process can read or write the file while the transaction is underway.  Starting a transaction also creates a rollback journal.  A transaction must be started before any changes can be made to the database.</p><p>The instruction <a href="opcode.html#VerifyCookie">VerifyCookie</a>checks cookie 0 (the database schema version) to make sure it is equal to P2 (the value obtained when the database schema was last read).  P1 is the database number (0 for the main database).  This is done to make sure the database schema hasn't been changed by another thread, in which case it has to be reread.</p><p> The second <a href="opcode.html#Transaction">Transaction</a> instruction begins a transaction and starts a rollback journal for database 1, the database used for temporary tables.</p>}proc stack args {  puts "<blockquote><table border=2>"  foreach elem $args {    puts "<tr><td align=left>$elem</td></tr>"  }  puts "</table></blockquote>"}Code {3     Integer       0      0                                    4     OpenWrite     0      3      examp                         }puts {<p> The instruction <a href="opcode.html#Integer">Integer</a> pushes the integer value P1 (0) onto the stack.  Here 0 is the number of the database to use in the following OpenWrite instruction.  If P3 is not NULL then it is a string representation of the same integer.  Afterwards the stack looks like this:</p>}stack {(integer) 0}puts {<p> The instruction <a href="opcode.html#OpenWrite">OpenWrite</a> opens a new read/write cursor with handle P1 (0 in this case) on table "examp", whose root page is P2 (3, in this database file).  Cursor handles can be any non-negative integer.  But the VDBE allocates cursors in an array with the size of the array being one more than the largest cursor.  So to conserve memory, it is best to use handles beginning with zero and working upward consecutively.  Here P3 ("examp") is the name of the table being opened, but this is unused, and only generated to make the code easier to read.  This instruction pops the database number to use (0, the main database) from the top of the stack, so afterwards the stack is empty again.</p>}Code {5     NewRecno      0      0                                    }puts {<p> The instruction <a href="opcode.html#NewRecno">NewRecno</a> creates a new integer record number for the table pointed to by cursor P1.  The record number is one not currently used as a key in the table.  The new record number is pushed onto the stack.  Afterwards the stack looks like this:</p>}stack {(integer) new record key}Code {6     String        0      0      Hello, World!                 }puts {<p> The instruction <a href="opcode.html#String">String</a> pushes its P3 operand onto the stack.  Afterwards the stack looks like this:</p>}stack {(string) "Hello, World!"} \ {(integer) new record key}Code {7     Integer       99     0      99                            }puts {<p> The instruction <a href="opcode.html#Integer">Integer</a> pushes its P1 operand (99) onto the stack.  Afterwards the stack looks like this:</p>}stack {(integer) 99} \ {(string) "Hello, World!"} \ {(integer) new record key}Code {8     MakeRecord    2      0                                    }puts {<p> The instruction <a href="opcode.html#MakeRecord">MakeRecord</a> pops the top P1 elements off the stack (2 in this case) and converts them into the binary format used for storing records in a database file.  (See the <a href="fileformat.html">file format</a> description for details.)  The new record generated by the MakeRecord instruction is pushed back onto the stack.  Afterwards the stack looks like this:</p></ul>}stack {(record) "Hello, World!", 99} \ {(integer) new record key}Code {9     PutIntKey     0      1                                    }puts {<p> The instruction <a href="opcode.html#PutIntKey">PutIntKey</a> uses the top 2 stack entries to write an entry into the table pointed to by cursor P1.  A new entry is created if it doesn't already exist or the data for an existing entry is overwritten.  The record data is the top stack entry, and the key is the next entry down.  The stack is popped twice by this instruction.  Because operand P2 is 1 the row change count is incremented and the rowid is stored for subsequent return by the sqlite_last_insert_rowid() function.  If P2 is 0 the row change count is unmodified.  This instruction is where the insert actually occurs.</p>}Code {10    Close         0      0                                         }puts {<p> The instruction <a href="opcode.html#Close">Close</a> closes a cursor previously opened as P1 (0, the only open cursor). If P1 is not currently open, this instruction is a no-op.</p>}Code {11    Commit        0      0                                         }puts {<p> The instruction <a href="opcode.html#Commit">Commit</a> causes all modifications to the database that have been made since the last Transaction to actually take effect.  No additional modifications are allowed until another transaction is started.  The Commit instruction deletes the journal file and releases the write lock on the database.  A read lock continues to be held if there are still cursors open.</p>}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产伦理网| 亚洲黄色av一区| 国产精品国产三级国产普通话蜜臀 | 91网站在线播放| 欧美一区日本一区韩国一区| ...xxx性欧美| 国产精品69久久久久水密桃| 欧美日韩国产中文| 亚洲欧美aⅴ...| 成人永久aaa| 精品91自产拍在线观看一区| 午夜精品aaa| 日本乱人伦aⅴ精品| 中文字幕一区二| 激情都市一区二区| 日韩欧美久久一区| 丝袜美腿成人在线| 欧美这里有精品| 国产精品不卡一区二区三区| 国产福利一区二区三区视频| 欧美刺激午夜性久久久久久久| 亚洲视频免费看| 成人aaaa免费全部观看| 国产精品区一区二区三区| 国产一区二区三区国产| 精品国产123| 久久99久久99小草精品免视看| 337p亚洲精品色噜噜噜| 日本在线不卡视频一二三区| 8x8x8国产精品| 日韩电影在线看| 日韩视频在线你懂得| 久久av老司机精品网站导航| 精品久久久久久最新网址| 久久精品国产久精国产| 精品久久一区二区| 国产一区久久久| 中文字幕国产一区| 成人网男人的天堂| 中文字幕一区二区三区精华液| 99久久er热在这里只有精品66| 一区视频在线播放| 在线看国产日韩| 午夜不卡在线视频| 欧美电视剧免费全集观看| 国产一区二区三区香蕉| 日本一区二区三区视频视频| 91小视频在线观看| 亚洲高清免费观看| 精品国产百合女同互慰| 国产高清视频一区| 亚洲精品视频一区| 在线播放91灌醉迷j高跟美女| 蜜桃在线一区二区三区| 26uuu亚洲| 99久久亚洲一区二区三区青草 | 亚洲激情在线激情| 欧美猛男超大videosgay| 六月丁香婷婷色狠狠久久| 2020国产精品| 色综合视频一区二区三区高清| 午夜欧美2019年伦理| 久久久久国产免费免费| 色综合久久中文字幕| 视频一区视频二区中文| 久久精品欧美一区二区三区不卡 | 国产精品一二三四区| 亚洲精品国产高清久久伦理二区| 91精品国产欧美日韩| 成人看片黄a免费看在线| 亚洲第一福利视频在线| 久久婷婷一区二区三区| 在线一区二区三区四区五区| 韩国三级中文字幕hd久久精品| 国产精品美女视频| 欧美一级在线观看| 色综合久久久久久久久| 久热成人在线视频| 亚洲午夜免费电影| 中文字幕第一区综合| 91麻豆精品国产91久久久久久久久 | 久久久久国产一区二区三区四区 | 日韩精品一卡二卡三卡四卡无卡| 国产欧美精品一区二区色综合| 欧美日本免费一区二区三区| 国产99久久久国产精品潘金网站| 午夜激情综合网| 亚洲欧美另类小说视频| 精品奇米国产一区二区三区| 欧美亚洲综合一区| 国模大尺度一区二区三区| 亚洲国产精品久久艾草纯爱| 中文字幕中文乱码欧美一区二区 | 蜜臀av一区二区| 亚洲综合无码一区二区| 国产精品久久久一本精品| 2024国产精品| 91精品综合久久久久久| 在线视频国内自拍亚洲视频| 国产激情视频一区二区在线观看| 视频一区中文字幕国产| 亚洲国产成人av| 亚洲欧美精品午睡沙发| 国产性天天综合网| 精品久久一二三区| 日韩一二三区视频| 9191国产精品| 911精品产国品一二三产区| 色综合久久中文字幕| 91丨九色丨黑人外教| 国产不卡一区视频| 国产成人av一区二区三区在线| 久久激情综合网| 免费成人在线观看视频| 日韩av电影免费观看高清完整版 | 国产精品国产三级国产| 日本一区二区成人在线| 国产日韩av一区二区| 国产农村妇女毛片精品久久麻豆 | 成人av在线看| www.欧美日韩| 99久久99久久精品免费看蜜桃| 粉嫩av一区二区三区| 国产激情一区二区三区桃花岛亚洲| 国内欧美视频一区二区| 国产在线精品不卡| 成人亚洲一区二区一| 99精品一区二区| 色爱区综合激月婷婷| 在线观看国产日韩| 欧美老肥妇做.爰bbww| 欧美一区二区精品久久911| 日韩一区二区在线看| 精品国产乱码久久久久久久久| 精品久久国产97色综合| 国产日产欧美一区| 亚洲精品国产精华液| 亚洲国产中文字幕| 久久激情五月激情| 国产成人欧美日韩在线电影| 99在线精品观看| 欧美亚一区二区| 日韩视频一区二区| 欧美激情一区二区三区不卡| 中文字幕五月欧美| 亚洲国产精品欧美一二99| 免费在线看一区| 国产成人av电影免费在线观看| 99久久国产免费看| 欧美一区二区三区四区五区| 久久久久久久久99精品| 亚洲精品视频在线观看免费| 青草av.久久免费一区| 成人免费av资源| 7777精品伊人久久久大香线蕉| 久久美女高清视频| 亚洲制服丝袜av| 国产一区二区三区四区五区入口 | 亚洲韩国一区二区三区| 国产一区二区91| 欧美影院一区二区三区| 久久这里只有精品首页| 亚洲综合av网| 国产精品一区二区久久不卡| 色哟哟欧美精品| 国产日韩欧美不卡在线| 视频一区视频二区中文字幕| proumb性欧美在线观看| 欧美一级爆毛片| 一区二区三区精品视频在线| 国产盗摄精品一区二区三区在线| 在线亚洲+欧美+日本专区| 久久日韩精品一区二区五区| 亚洲福利视频一区二区| 成人av资源网站| 久久精品夜夜夜夜久久| 视频一区视频二区中文| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 中文字幕日本不卡| 黑人巨大精品欧美黑白配亚洲| 欧美亚一区二区| 日韩久久一区二区| 成人天堂资源www在线| 久久综合九色综合欧美亚洲| 亚洲成av人片www| 色偷偷成人一区二区三区91| 国产女主播在线一区二区| 免费观看成人av| 欧美精三区欧美精三区| 一区二区三区精密机械公司| 成人久久18免费网站麻豆| 国产亚洲福利社区一区| 国产精品一区三区| 亚洲精品在线观| 久久99精品国产91久久来源| 51精品国自产在线| 午夜精品福利一区二区蜜股av | 成人免费视频免费观看| 久久久久国产精品厨房| 国产精品一区久久久久|