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

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

?? vdbe.tcl

?? sqlite庫
?? 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>}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精三区欧美精三区| 亚洲一区二区中文在线| 91 com成人网| 在线观看三级视频欧美| 99精品一区二区三区| 高清国产一区二区三区| 成人午夜电影小说| 9人人澡人人爽人人精品| gogo大胆日本视频一区| 92国产精品观看| 色狠狠av一区二区三区| 欧美日韩国产在线观看| 欧美一区二区三区在线视频| 日韩精品一区二区在线观看| 精品国产免费一区二区三区四区| 久久五月婷婷丁香社区| 国产精品私房写真福利视频| ...中文天堂在线一区| 亚洲男人天堂av网| 免费高清在线视频一区·| 蜜桃av噜噜一区二区三区小说| 黑人精品欧美一区二区蜜桃 | 亚洲色图视频网| 亚洲人成精品久久久久久| 亚洲一区精品在线| 激情综合色综合久久综合| 一区二区三区高清| 麻豆国产91在线播放| 国产精品一区二区三区网站| 成人毛片在线观看| 欧美日本乱大交xxxxx| 久久久久久一二三区| 亚洲柠檬福利资源导航| 久久99久久99精品免视看婷婷 | 福利一区在线观看| 91成人国产精品| 欧美精品一区二区三区在线 | 一区二区三区国产精华| 老司机一区二区| 91香蕉视频黄| 2欧美一区二区三区在线观看视频| 国产精品高潮呻吟| 看片网站欧美日韩| 91麻豆精品视频| 欧美国产综合一区二区| 日韩 欧美一区二区三区| 粉嫩av亚洲一区二区图片| 91精品在线观看入口| 亚洲视频精选在线| 国产精品一区二区久激情瑜伽| 欧美日韩精品专区| 最近中文字幕一区二区三区| 国产精品18久久久久久久久 | 秋霞成人午夜伦在线观看| 91在线国产福利| 久久久美女毛片| 免费三级欧美电影| 欧美日韩精品高清| 洋洋成人永久网站入口| 色丁香久综合在线久综合在线观看| 久久婷婷国产综合精品青草| 日韩二区在线观看| 91激情五月电影| 亚洲天堂2014| www.亚洲免费av| 国产精品卡一卡二| 国产成人丝袜美腿| 国产亚洲成av人在线观看导航| 蜜臀av一级做a爰片久久| 欧美亚洲尤物久久| 亚洲一区二区三区四区在线免费观看 | 欧美激情一区二区三区四区| 精品亚洲porn| 久久日韩粉嫩一区二区三区| 美日韩一区二区三区| 7777精品伊人久久久大香线蕉最新版| 一区二区三区欧美在线观看| 一本久久综合亚洲鲁鲁五月天| 国产精品青草久久| 99r国产精品| 亚洲综合色成人| 欧美电影一区二区| 九色综合狠狠综合久久| 欧美精品一区二区三区在线 | 亚洲h在线观看| 9191成人精品久久| 久久国产三级精品| 亚洲国产精品激情在线观看| 成人妖精视频yjsp地址| 亚洲女同ⅹxx女同tv| 91精品国产一区二区三区香蕉 | 亚洲啪啪综合av一区二区三区| 99视频在线精品| 亚洲一区二区三区中文字幕| 欧美人狂配大交3d怪物一区| 免费精品视频在线| 国产精品妹子av| 欧美在线色视频| 国产综合久久久久影院| 国产精品久久久久永久免费观看| 色噜噜狠狠色综合中国| 亚洲第一电影网| 久久精品夜色噜噜亚洲aⅴ| 99久久99久久精品免费看蜜桃| 亚洲另类春色国产| 精品国产污污免费网站入口| 成人黄页毛片网站| 日韩精品视频网站| 欧美激情自拍偷拍| 欧美日高清视频| 国产成人一区二区精品非洲| 亚洲一区二区黄色| 久久久久88色偷偷免费| 在线观看区一区二| 国产999精品久久| 日本在线播放一区二区三区| 国产欧美一区二区精品忘忧草 | 91精品国产综合久久久久久漫画| 国产成人夜色高潮福利影视| 亚洲图片你懂的| 欧美大胆人体bbbb| 欧美在线影院一区二区| 粉嫩欧美一区二区三区高清影视| 亚洲第一主播视频| 一区精品在线播放| 久久久久久电影| 日韩欧美精品在线| 欧美三级电影网| 91麻豆福利精品推荐| 国产精品综合av一区二区国产馆| 午夜欧美视频在线观看| 亚洲欧美激情小说另类| 亚洲国产精品av| 国产午夜亚洲精品不卡| 日韩一二三四区| 欧美精品久久天天躁| 色综合天天综合网国产成人综合天| 国产九色精品成人porny| 免费高清在线视频一区·| 亚洲成av人影院| 一区二区三区蜜桃| 亚洲欧美日韩综合aⅴ视频| 欧美精彩视频一区二区三区| 日韩区在线观看| 日韩一区二区三区视频| 51精品秘密在线观看| 欧美日韩一级片在线观看| 在线一区二区三区做爰视频网站| 成人v精品蜜桃久久一区| 粉嫩欧美一区二区三区高清影视| 韩国成人精品a∨在线观看| 精品一区二区三区不卡| 久久精品国产**网站演员| 久久成人免费日本黄色| 男女性色大片免费观看一区二区 | 欧美视频三区在线播放| 在线视频国内自拍亚洲视频| 91麻豆国产精品久久| 91国产视频在线观看| 欧美日韩一卡二卡| 日韩欧美成人午夜| 久久免费视频一区| 国产精品丝袜一区| 亚洲免费电影在线| 日韩成人精品在线观看| 裸体健美xxxx欧美裸体表演| 久久9热精品视频| 国产91丝袜在线播放| 色94色欧美sute亚洲线路二| 欧美丝袜丝交足nylons图片| 日韩一区国产二区欧美三区| 精品国产免费人成电影在线观看四季| 精品国产一区二区精华| 国产精品网友自拍| 亚洲电影一级黄| 国内一区二区在线| av在线这里只有精品| 制服丝袜激情欧洲亚洲| 精品国产乱码久久| 18欧美乱大交hd1984| 日韩成人免费电影| 成人午夜碰碰视频| 在线观看91精品国产麻豆| 26uuu欧美| 尤物av一区二区| 黄色日韩网站视频| 在线精品国精品国产尤物884a| 日韩免费观看高清完整版| 国产精品国产三级国产aⅴ中文| 性欧美大战久久久久久久久| 精品一区二区国语对白| 日本高清视频一区二区| 久久新电视剧免费观看| 亚洲国产中文字幕| 国产成人亚洲精品狼色在线| 欧美日韩在线观看一区二区 | 亚洲国产电影在线观看| 午夜精品福利一区二区蜜股av| 国产黄色成人av| 69av一区二区三区|