Documentation Source Text

Artifact [6fe081ae8f]
Login

Artifact 6fe081ae8f727bfe51af39455982d61aeb2492ea:

Ticket change [6fe081ae8f] - Ticket [9ed3b9626c] Fixing some typos in the documentation status still Open with 1 other change by drh 2009-03-18 13:35:00.
D 2009-03-18T13:35:00
J comment Hi,\r\n\r\nI\swas\sreading\sthrough\sa\slot\sof\sthe\sSQLite\sdocumentation\stoday,\sand\sI\snoticed\sa\sfew\stypos.\s\sI\stried\sto\smake\sa\spatch\susing\sFossil\sfor\sthe\sfirst\stime,\sbut\sI\sdon't\ssee\san\s"upload\sfile"\sbutton\sso\sI\swill\sjust\sinline\sthe\spatches\shere.\r\n\r\nMost\sare\sjust\sgrammar/spelling\sfixes,\sbut\sthe\sfix\sto\sfaq.in\sis\smore\sof\sa\sreadability\sfix\s--\sat\sleast\sfor\sme,\swhen\sI\ssee\sXXX\smust\shave\sYYY,\sI\sread\s"must"\sas\sa\srequirement,\snot\sas\sa\ssuggestion.\r\n\r\nThe\sauthor\sor\sauthors\sof\sthis\scode\sdedicate\sany\sand\sall\scopyright\sinterest\sin\sthis\scode\sto\sthe\spublic\sdomain.\sWe\smake\sthis\sdedication\sfor\sthe\sbenefit\sof\sthe\spublic\sat\slarge\sand\sto\sthe\sdetriment\sof\sour\sheirs\sand\ssuccessors.\sWe\sintend\sthis\sdedication\sto\sbe\san\sovert\sact\sof\srelinquishment\sin\sperpetuity\sof\sall\spresent\sand\sfuture\srights\sto\sthis\scode\sunder\scopyright\slaw.\r\n\r\n-\sMark\r\n\r\n\r\n----------\s\sbegin\spatches\r\n\r\n<verbatim>\r\npages/arch.in\r\n\r\n\s\s\s\s@@\s-163,11\s+163,11\s@@\r\n\s\s\s\s\scaching\sthese\schunks.\r\n\s\s\s\s\sThe\spage\scache\salso\sprovides\sthe\srollback\sand\satomic\scommit\sabstraction\r\n\s\s\s\s\sand\stakes\scare\sof\slocking\sof\sthe\sdatabase\sfile.\s\sThe\r\n\s\s\s\s\sB-tree\sdriver\srequests\sparticular\spages\sfrom\sthe\spage\scache\sand\snotifies\r\n\s\s\s\s\sthe\spage\scache\swhen\sit\swants\sto\smodify\spages\sor\scommit\sor\srollback\r\n\s\s\s\s-changes\sand\sthe\spage\scache\shandles\sall\sthe\smessy\sdetails\sof\smaking\ssure\r\n\s\s\s\s+changes,\sand\sthe\spage\scache\shandles\sall\sthe\smessy\sdetails\sof\smaking\ssure\r\n\s\s\s\s\sthe\srequests\sare\shandled\squickly,\ssafely,\sand\sefficiently.</p>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<p>The\scode\sto\simplement\sthe\spage\scache\sis\scontained\sin\sthe\ssingle\sC\r\n\s\s\s\s\ssource\sfile\s<b>pager.c</b>.\s\sThe\sinterface\sto\sthe\spage\scache\ssubsystem\r\n\s\s\s\s\sis\sdefined\sby\sthe\sheader\sfile\s<b>pager.h</b>.\r\n\r\n\r\npages/atomiccommit.in\r\n\r\n\s\s\s\s@@\s-462,11\s+462,11\s@@\r\n\s\s\s\s\sspace\scache\scan\sbe\sreused\sfor\sa\ssignificant\sperformance\ssavings.</p>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<br\sclear="both">\r\n\s\s\s\s\s<h2>4.0\sRollback</h2>\r\n\s\s\s\s\s\r\n\s\s\s\s-<p>An\satomic\scommit\sis\ssuppose\sto\shappen\sinstantaneously.\s\sBut\sthe\sprocessing\r\n\s\s\s\s+<p>An\satomic\scommit\sis\ssupposed\sto\shappen\sinstantaneously,\sbut\sthe\sprocessing\r\n\s\s\s\s\sdescribed\sabove\sclearly\stakes\sa\sfinite\samount\sof\stime.\r\n\s\s\s\s\sSuppose\sthe\spower\sto\sthe\scomputer\swere\scut\r\n\s\s\s\s\spart\sway\sthrough\sthe\scommit\soperation\sdescribed\sabove.\s\sIn\sorder\r\n\s\s\s\s\sto\smaintain\sthe\sillusion\sthat\sthe\schanges\swere\sinstantaneous,\swe\r\n\s\s\s\s\shave\sto\s"rollback"\sany\spartial\schanges\sand\srestore\sthe\sdatabase\sto\r\n\s\s\s\s@@\s-1095,11\s+1095,11\s@@\r\n\s\s\s\s\snot\sTRUNCATE\swill\sbe\ssynchronous\sand\satomic\son\syour\sfilesystem\sand\sit\sis\r\n\s\s\s\s\simportant\sto\syou\sthat\syour\sdatabase\ssurvive\sa\spower\sloss\sor\soperating\r\n\s\s\s\s\ssystem\scrash\sthat\soccurs\sduring\sthe\struncation\soperation,\sthen\syou\smight\r\n\s\s\s\s\sconsider\susing\sa\sdifferent\sjournaling\smode.</p>\r\n\s\s\s\s\s\r\n\s\s\s\s-<p>On\sembedded\ssystems\swith\ssynchronous\sfilesystems,\sTRUNCATE\sis\sresults\r\n\s\s\s\s+<p>On\sembedded\ssystems\swith\ssynchronous\sfilesystems,\sTRUNCATE\sresults\r\n\s\s\s\s\sin\sslower\sbehavior\sthan\sPERSIST.\s\sThe\scommit\soperation\sis\sthe\ssame\sspeed.\r\n\s\s\s\s\sBut\ssubsequent\stransactions\sare\sslower\sfollowing\sa\sTRUNCATE\sbecause\sit\sis\r\n\s\s\s\s\sfaster\sto\soverwrite\sexisting\scontent\sthan\sto\sappend\sto\sthe\send\sof\sa\sfile.\r\n\s\s\s\s\sNew\sjournal\sfile\sentries\swill\salways\sbe\sappended\sfollowing\sa\sTRUNCATE\sbut\r\n\s\s\s\s\swill\susually\soverwrite\swith\sPERSIST.</p>\r\n\r\npages/cintro.in\r\n\r\n\s\s\s\s@@\s-367,11\s+367,11\s@@\r\n\s\s\s\s\s</p>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<p>\r\n\s\s\s\s\s\s\sThe\s[sqlite3_create_function()]\sinterface\screates\snew\sSQL\sfunctions\s-\r\n\s\s\s\s\s\s\seither\sscalar\sor\saggregate.\s\sThe\snew\sfunction\simplementation\stypically\r\n\s\s\s\s-\s\smake\suse\sof\sthe\sfollowing\sadditional\sinterfaces:\r\n\s\s\s\s+\s\smakes\suse\sof\sthe\sfollowing\sadditional\sinterfaces:\r\n\s\s\s\s\s</p>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<p><ul>\r\n\s\s\s\s\s\s\s<li>\s[sqlite3_aggregate_context()]\s</li>\r\n\s\s\s\s\s\s\s<li>\s[sqlite3_result_int\s|\ssqlite3_result()]\s</li>\r\n\r\npages/datatype3.in\r\n\r\n\s\s\s\s@@\s-357,11\s+357,11\s@@\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sof\stext\sencoding.</LI>\r\n\s\s\s\s\s<LI><b>NOCASE</b>\s-\sThe\ssame\sas\sbinary,\sexcept\sthe\s26\supper\scase\r\n\s\s\s\s\s\s\s\s\s\scharacters\sof\sASCII\sare\r\n\s\s\s\s\s\s\s\s\s\sfolded\sto\stheir\slower\scase\sequivalents\sbefore\r\n\s\s\s\s\s\s\s\s\s\sthe\scomparison\sis\sperformed.\s\sNote\sthat\sonly\sASCII\scharacters\r\n\s\s\s\s-\s\s\s\s\sare\scase\sfolded.\s\sSQLite\sdoes\snot\sattempt\sto\sdue\sfull\r\n\s\s\s\s+\s\s\s\s\sare\scase\sfolded.\s\sSQLite\sdoes\snot\sattempt\sto\sdo\sfull\r\n\s\s\s\s\s\s\s\s\s\sUTF\scase\sfolding\sdue\sto\sthe\ssize\sof\sthe\stables\srequired.</li>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<LI><b>RTRIM</b>\s-\sThe\ssame\sas\sbinary,\sexcept\sthat\strailing\sspace\r\n\s\s\s\s\s\s\s\s\s\scharacters\sare\signored.</li>\r\n\s\s\s\s\s</ul>\r\n\r\npages/faq.in\r\n\r\n\s\s\s\s@@\s-90,12\s+90,12\s@@\r\n\s\s\s\s\s\r\n\s\s\s\s\sfaq\s{\r\n\s\s\s\s\s\s\sWhy\sdoesn't\sSQLite\sallow\sme\sto\suse\s'0'\sand\s'0.0'\sas\sthe\sprimary\r\n\s\s\s\s\s\s\skey\son\stwo\sdifferent\srows\sof\sthe\ssame\stable?\r\n\s\s\s\s\s}\s{\r\n\s\s\s\s-\s\s<p>Your\sprimary\skey\smust\shave\sa\snumeric\stype.\s\sChange\sthe\s[datatype]\sof\r\n\s\s\s\s-\s\syour\sprimary\skey\sto\sTEXT\sand\sit\sshould\swork.</p>\r\n\s\s\s\s+\s\s<p>This\sproblem\soccurs\swhen\syour\sprimary\skey\sis\sa\snumeric\stype.\s\sChange\sthe\r\n\s\s\s\s+\s\s[datatype]\sof\syour\sprimary\skey\sto\sTEXT\sand\sit\sshould\swork.</p>\r\n\s\s\s\s\s\r\n\s\s\s\s\s\s\s<p>Every\srow\smust\shave\sa\sunique\sprimary\skey.\s\sFor\sa\scolumn\swith\sa\r\n\s\s\s\s\s\s\snumeric\stype,\sSQLite\sthinks\sthat\s<b>'0'</b>\sand\s<b>'0.0'</b>\sare\sthe\r\n\s\s\s\s\s\s\ssame\svalue\sbecause\sthey\scompare\sequal\sto\sone\sanother\snumerically.\r\n\s\s\s\s\s\s\s(See\sthe\sprevious\squestion.)\s\sHence\sthe\svalues\sare\snot\sunique.</p>\r\n\r\npages/features.in\r\n\r\n\s\s\s\s@@\s-48,11\s+48,11\s@@\r\n\s\s\s\s\s<p><ul>\r\n\s\s\s\s\s<li><p><b>Application\sFile\sFormat.</b>\r\n\s\s\s\s\sRather\sthan\susing\sfopen()\sto\swrite\sXML\sor\ssome\sproprietary\sformat\sinto\r\n\s\s\s\s\sdisk\sfiles\sused\sby\syour\sapplication,\suse\san\sSQLite\sdatabase\sinstead.\r\n\s\s\s\s\sYou'll\savoid\shaving\sto\swrite\sand\stroubleshoot\sa\sparser,\syour\sdata\r\n\s\s\s\s-will\sbe\smore\seasily\saccessible\sand\scross-platform,\syour\supdates\r\n\s\s\s\s+will\sbe\smore\seasily\saccessible\sand\scross-platform,\sand\syour\supdates\r\n\s\s\s\s\swill\sbe\stransactional.</p></li>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<li><p><b>Database\sFor\sGadgets.</b>\r\n\s\s\s\s\sSQLite\sis\spopular\schoice\sfor\sthe\sdatabase\sengine\sin\scellphones,\r\n\s\s\s\s\sPDAs,\sMP3\splayers,\sset-top\sboxes,\sand\sother\selectronic\sgadgets.\r\n\r\n\r\npages/lockingv3.in\r\n\r\n\s\s\s\s@@\s-52,11\s+52,11\s@@\r\n\s\s\s\s\sConsistent,\sIsolated,\sand\sDurable).\s\sThe\spager\smodule\smakes\ssure\schanges\r\n\s\s\s\s\shappen\sall\sat\sonce,\sthat\seither\sall\schanges\soccur\sor\snone\sof\sthem\sdo,\r\n\s\s\s\s\sthat\stwo\sor\smore\sprocesses\sdo\snot\stry\sto\saccess\sthe\sdatabase\r\n\s\s\s\s\sin\sincompatible\sways\sat\sthe\ssame\stime,\sand\sthat\sonce\schanges\shave\sbeen\r\n\s\s\s\s\swritten\sthey\spersist\suntil\sexplicitly\sdeleted.\s\sThe\spager\salso\sprovides\r\n\s\s\s\s-an\smemory\scache\sof\ssome\sof\sthe\scontents\sof\sthe\sdisk\sfile.</p>\r\n\s\s\s\s+a\smemory\scache\sof\ssome\sof\sthe\scontents\sof\sthe\sdisk\sfile.</p>\r\n\s\s\s\s\s\r\n\s\s\s\s\s<p>The\spager\sis\sunconcerned\r\n\s\s\s\s\swith\sthe\sdetails\sof\sB-Trees,\stext\sencodings,\sindices,\sand\sso\sforth.\r\n\s\s\s\s\sFrom\sthe\spoint\sof\sview\sof\sthe\spager\sthe\sdatabase\sconsists\sof\r\n\s\s\s\s\sa\ssingle\sfile\sof\suniform-sized\sblocks.\s\sEach\sblock\sis\scalled\sa\r\n\s\s\s\s@@\s-206,11\s+206,11\s@@\r\n\s\s\s\s\s\r\n\s\s\s\s\s<ul>\r\n\s\s\s\s\s<li>A\sjournal\sis\shot\sif...\r\n\s\s\s\s\s\s\s\s\s<ul>\r\n\s\s\s\s\s\s\s\s\s<li>It\sexists,\sand</li>\r\n\s\s\s\s-\s\s\s\s<li>It's\smaster\sjournal\sexists\sor\sthe\smaster\sjournal\sname\sis\san\r\n\s\s\s\s+\s\s\s\s<li>Its\smaster\sjournal\sexists\sor\sthe\smaster\sjournal\sname\sis\san\r\n\s\s\s\s\s\s\s\s\s\s\s\s\sempty\sstring,\sand</li>\r\n\s\s\s\s\s\s\s\s\s<li>There\sis\sno\sRESERVED\slock\son\sthe\scorresponding\sdatabase\sfile.</li>\r\n\s\s\s\s\s\s\s\s\s</ul>\r\n\s\s\s\s\s</li>\r\n\s\s\s\s\s</ul>\r\n\r\npages/optoverview.in\r\n\r\n\s\s\s\s@@\s-239,11\s+239,11\s@@\r\n\s\s\s\s\s}\r\n\s\s\s\s\sCODE\s{\r\n\s\s\s\s\s\s\s'a'\sLIKE\s'A'\r\n\s\s\s\s\s}\r\n\s\s\s\s\sPARAGRAPH\s{\r\n\s\s\s\s-\s\sBy\sturned\son\sthe\scase_sensitive_like\spragma\sas\sfollows:\r\n\s\s\s\s+\s\sBy\sturning\son\sthe\scase_sensitive_like\spragma\sas\sfollows:\r\n\s\s\s\s\s}\r\n\s\s\s\s\sCODE\s{\r\n\s\s\s\s\s\s\sPRAGMA\scase_sensitive_like=ON;\r\n\s\s\s\s\s}\r\n\s\s\s\s\sPARAGRAPH\s{\r\n\s\s\s\s@@\s-251,11\s+251,11\s@@\r\n\s\s\s\s\s\s\sevaluate\sto\sfalse.\s\sNote\sthat\scase\sinsensitivity\sonly\sapplies\sto\r\n\s\s\s\s\s\s\slatin1\scharacters\s-\sbasically\sthe\supper\sand\slower\scase\sletters\sof\sEnglish\r\n\s\s\s\s\s\s\sin\sthe\slower\s127\sbyte\scodes\sof\sASCII.\s\sInternational\scharacter\ssets\r\n\s\s\s\s\s\s\sare\scase\ssensitive\sin\sSQLite\sunless\sa\suser-supplied\scollating\r\n\s\s\s\s\s\s\ssequence\sis\sused.\s\sBut\sif\syou\semploy\sa\suser-supplied\scollating\ssequence,\r\n\s\s\s\s-\s\sthe\sLIKE\soptimization\sdescribe\shere\swill\snever\sbe\staken.\r\n\s\s\s\s+\s\sthe\sLIKE\soptimization\sdescribed\shere\swill\snever\sbe\staken.\r\n\s\s\s\s\s}\r\n\s\s\s\s\sPARAGRAPH\s{\r\n\s\s\s\s\s\s\sThe\sLIKE\soperator\sis\scase\sinsensitive\sby\sdefault\sbecause\sthis\sis\swhat\r\n\s\s\s\s\s\s\sthe\sSQL\sstandard\srequires.\s\sYou\scan\schange\sthe\sdefault\sbehavior\sat\r\n\s\s\s\s\s\s\scompile\stime\sby\susing\sthe\s-DSQLITE_CASE_SENSITIVE_LIKE\scommand-line\soption\r\n\s\s\s\s@@\s-385,11\s+385,11\s@@\r\n\s\s\s\s\s\s\sthe\stotal\samount\sof\swork\sneeded\sto\sperform\sthe\squery\susing\seach\soption.\r\n\s\s\s\s\s\s\sIt\sthen\sselects\sthe\soption\sthat\sgives\sthe\sleast\sestimated\swork.\r\n\s\s\s\s\s}\r\n\s\s\s\s\sPARAGRAPH\s{\r\n\s\s\s\s\s\s\sTo\shelp\sthe\soptimizer\sget\sa\smore\saccurate\sestimate\sof\sthe\swork\sinvolved\r\n\s\s\s\s-\s\sin\susing\svarious\sindices,\sthe\suser\smay\soptional\srun\sthe\sANALYZE\scommand.\r\n\s\s\s\s+\s\sin\susing\svarious\sindices,\sthe\suser\smay\soptionally\srun\sthe\sANALYZE\scommand.\r\n\s\s\s\s\s\s\sThe\sANALYZE\scommand\sscans\sall\sindices\sof\sdatabase\swhere\sthere\smight\r\n\s\s\s\s\s\s\sbe\sa\schoice\sbetween\stwo\sor\smore\sindices\sand\sgathers\sstatistics\son\sthe\r\n\s\s\s\s\s\s\sselectiveness\sof\sthose\sindices.\s\sThe\sresults\sof\sthis\sscan\sare\sstored\r\n\s\s\s\s\s\s\sin\sthe\ssqlite_stat1\stable.\r\n\s\s\s\s\s\s\sThe\scontents\sof\sthe\ssqlite_stat1\stable\sare\snot\supdated\sas\sthe\sdatabase\r\n\r\n\r\npages/testing.in\r\n\r\n\s\s\s\s@@\s-177,11\s+177,11\s@@\r\n\s\s\s\s\s\r\n\s\s\s\s\s<p>OOM\stesting\sis\saccomplished\sby\ssimulating\sOOM\serrors.\r\n\s\s\s\s\sSQLite\sallows\san\sapplication\sto\ssubstitute\san\salternative\smalloc()\r\n\s\s\s\s\simplementation\susing\sthe\s[sqlite3_config]([SQLITE_CONFIG_MALLOC],...)\r\n\s\s\s\s\sinterface.\s\sThe\sTCL\sand\sTH3\stest\sharnesses\sare\sboth\scapable\sof\r\n\s\s\s\s-inserting\sa\smodified\sversion\sof\smalloc()\sthat\scan\sbe\srigged\sfail\r\n\s\s\s\s+inserting\sa\smodified\sversion\sof\smalloc()\sthat\scan\sbe\srigged\sto\sfail\r\n\s\s\s\s\safter\sa\scertain\snumber\sof\sallocations.\s\sThese\sinstrumented\smallocs\r\n\s\s\s\s\scan\sbe\sset\sto\sfail\sonly\sonce\sand\sthen\sstart\sworking\sagain,\sor\sto\r\n\s\s\s\s\scontinue\sfailing\safter\sthe\sfirst\sfailure.\s\sOOM\stests\sare\sdone\sin\sa\r\n\s\s\s\s\sloop.\s\sOn\sthe\sfirst\siteration\sof\sthe\sloop,\sthe\sinstrumented\smalloc\r\n\s\s\s\s\sis\srigged\sto\sfail\son\sthe\sfirst\sallocation.\s\sThen\ssome\sSQLite\soperation\r\n</verbatim>\r\n\r\n<hr><i>anonymous\sadded\son\s2009-03-12\s04:42:29:</i><br>\r\nI\ssee\sthat\sthe\spatches\sgot\skind\sof\smarked\sup,\sso\shere\sis\sa\slink\sto\ssome\splaintext\sof\sthe\spatch:\s\shttp://codepad.org/HCMZCZ3H\s\sand\suse\sthe\sRaw\sCode\slink\sat\sthe\stop\sif\snecessary.\r\n\r\n<hr><i>drh\sadded\son\s2009-03-18:</i><br>\r\nI\sput\s&lt;verbatim&gt;...&lt;/verbatim&gt;\smarkup\saround\syour\spatch\sto\smake\r\nit\sdisplay\scorrectly.\s\sThanks\sfor\sthe\spatch.
K 9ed3b9626c9462e11a557621152f3e2d4eead482
U drh
Z ba5ea27a0884f38aa2b443c0b274ad1a