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\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.

\r\n\s\s\s\s\s\r\n\s\s\s\s\s

The\scode\sto\simplement\sthe\spage\scache\sis\scontained\sin\sthe\ssingle\sC\r\n\s\s\s\s\ssource\sfile\spager.c.\s\sThe\sinterface\sto\sthe\spage\scache\ssubsystem\r\n\s\s\s\s\sis\sdefined\sby\sthe\sheader\sfile\spager.h.\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.

\r\n\s\s\s\s\s\r\n\s\s\s\s\s\r\n\s\s\s\s\s

4.0\sRollback

\r\n\s\s\s\s\s\r\n\s\s\s\s-

An\satomic\scommit\sis\ssuppose\sto\shappen\sinstantaneously.\s\sBut\sthe\sprocessing\r\n\s\s\s\s+

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.

\r\n\s\s\s\s\s\r\n\s\s\s\s-

On\sembedded\ssystems\swith\ssynchronous\sfilesystems,\sTRUNCATE\sis\sresults\r\n\s\s\s\s+

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.

\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

\r\n\s\s\s\s\s\r\n\s\s\s\s\s

\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

\r\n\s\s\s\s\s\r\n\s\s\s\s\s

\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

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.

\r\n\s\s\s\s+\s\s

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.

\r\n\s\s\s\s\s\r\n\s\s\s\s\s\s\s

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'0'\sand\s'0.0'\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.

\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