/ Check-in [4e926efe]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Disclaimed copyright. Preparing for release 2.0. (CVS 250)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4e926efe2b59adfec4086eb1d2ba830238facb4c
User & Date: drh 2001-09-16 00:13:26
Context
2001-09-16
13:36
Version to 2.0.0 (CVS 251) check-in: c67f6db6 user: drh tags: trunk
00:13
Disclaimed copyright. Preparing for release 2.0. (CVS 250) check-in: 4e926efe user: drh tags: trunk
2001-09-15
14:43
Separate columns in keys using nulls instead of tabs. (CVS 249) check-in: 8e2f3f75 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Deleted COPYRIGHT.

     1         -		    GNU GENERAL PUBLIC LICENSE
     2         -		       Version 2, June 1991
     3         -
     4         - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     5         -                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     6         - Everyone is permitted to copy and distribute verbatim copies
     7         - of this license document, but changing it is not allowed.
     8         -
     9         -			    Preamble
    10         -
    11         -  The licenses for most software are designed to take away your
    12         -freedom to share and change it.  By contrast, the GNU General Public
    13         -License is intended to guarantee your freedom to share and change free
    14         -software--to make sure the software is free for all its users.  This
    15         -General Public License applies to most of the Free Software
    16         -Foundation's software and to any other program whose authors commit to
    17         -using it.  (Some other Free Software Foundation software is covered by
    18         -the GNU Library General Public License instead.)  You can apply it to
    19         -your programs, too.
    20         -
    21         -  When we speak of free software, we are referring to freedom, not
    22         -price.  Our General Public Licenses are designed to make sure that you
    23         -have the freedom to distribute copies of free software (and charge for
    24         -this service if you wish), that you receive source code or can get it
    25         -if you want it, that you can change the software or use pieces of it
    26         -in new free programs; and that you know you can do these things.
    27         -
    28         -  To protect your rights, we need to make restrictions that forbid
    29         -anyone to deny you these rights or to ask you to surrender the rights.
    30         -These restrictions translate to certain responsibilities for you if you
    31         -distribute copies of the software, or if you modify it.
    32         -
    33         -  For example, if you distribute copies of such a program, whether
    34         -gratis or for a fee, you must give the recipients all the rights that
    35         -you have.  You must make sure that they, too, receive or can get the
    36         -source code.  And you must show them these terms so they know their
    37         -rights.
    38         -
    39         -  We protect your rights with two steps: (1) copyright the software, and
    40         -(2) offer you this license which gives you legal permission to copy,
    41         -distribute and/or modify the software.
    42         -
    43         -  Also, for each author's protection and ours, we want to make certain
    44         -that everyone understands that there is no warranty for this free
    45         -software.  If the software is modified by someone else and passed on, we
    46         -want its recipients to know that what they have is not the original, so
    47         -that any problems introduced by others will not reflect on the original
    48         -authors' reputations.
    49         -
    50         -  Finally, any free program is threatened constantly by software
    51         -patents.  We wish to avoid the danger that redistributors of a free
    52         -program will individually obtain patent licenses, in effect making the
    53         -program proprietary.  To prevent this, we have made it clear that any
    54         -patent must be licensed for everyone's free use or not licensed at all.
    55         -
    56         -  The precise terms and conditions for copying, distribution and
    57         -modification follow.
    58         -
    59         -		    GNU GENERAL PUBLIC LICENSE
    60         -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    61         -
    62         -  0. This License applies to any program or other work which contains
    63         -a notice placed by the copyright holder saying it may be distributed
    64         -under the terms of this General Public License.  The "Program", below,
    65         -refers to any such program or work, and a "work based on the Program"
    66         -means either the Program or any derivative work under copyright law:
    67         -that is to say, a work containing the Program or a portion of it,
    68         -either verbatim or with modifications and/or translated into another
    69         -language.  (Hereinafter, translation is included without limitation in
    70         -the term "modification".)  Each licensee is addressed as "you".
    71         -
    72         -Activities other than copying, distribution and modification are not
    73         -covered by this License; they are outside its scope.  The act of
    74         -running the Program is not restricted, and the output from the Program
    75         -is covered only if its contents constitute a work based on the
    76         -Program (independent of having been made by running the Program).
    77         -Whether that is true depends on what the Program does.
    78         -
    79         -  1. You may copy and distribute verbatim copies of the Program's
    80         -source code as you receive it, in any medium, provided that you
    81         -conspicuously and appropriately publish on each copy an appropriate
    82         -copyright notice and disclaimer of warranty; keep intact all the
    83         -notices that refer to this License and to the absence of any warranty;
    84         -and give any other recipients of the Program a copy of this License
    85         -along with the Program.
    86         -
    87         -You may charge a fee for the physical act of transferring a copy, and
    88         -you may at your option offer warranty protection in exchange for a fee.
    89         -
    90         -  2. You may modify your copy or copies of the Program or any portion
    91         -of it, thus forming a work based on the Program, and copy and
    92         -distribute such modifications or work under the terms of Section 1
    93         -above, provided that you also meet all of these conditions:
    94         -
    95         -    a) You must cause the modified files to carry prominent notices
    96         -    stating that you changed the files and the date of any change.
    97         -
    98         -    b) You must cause any work that you distribute or publish, that in
    99         -    whole or in part contains or is derived from the Program or any
   100         -    part thereof, to be licensed as a whole at no charge to all third
   101         -    parties under the terms of this License.
   102         -
   103         -    c) If the modified program normally reads commands interactively
   104         -    when run, you must cause it, when started running for such
   105         -    interactive use in the most ordinary way, to print or display an
   106         -    announcement including an appropriate copyright notice and a
   107         -    notice that there is no warranty (or else, saying that you provide
   108         -    a warranty) and that users may redistribute the program under
   109         -    these conditions, and telling the user how to view a copy of this
   110         -    License.  (Exception: if the Program itself is interactive but
   111         -    does not normally print such an announcement, your work based on
   112         -    the Program is not required to print an announcement.)
   113         -
   114         -These requirements apply to the modified work as a whole.  If
   115         -identifiable sections of that work are not derived from the Program,
   116         -and can be reasonably considered independent and separate works in
   117         -themselves, then this License, and its terms, do not apply to those
   118         -sections when you distribute them as separate works.  But when you
   119         -distribute the same sections as part of a whole which is a work based
   120         -on the Program, the distribution of the whole must be on the terms of
   121         -this License, whose permissions for other licensees extend to the
   122         -entire whole, and thus to each and every part regardless of who wrote it.
   123         -
   124         -Thus, it is not the intent of this section to claim rights or contest
   125         -your rights to work written entirely by you; rather, the intent is to
   126         -exercise the right to control the distribution of derivative or
   127         -collective works based on the Program.
   128         -
   129         -In addition, mere aggregation of another work not based on the Program
   130         -with the Program (or with a work based on the Program) on a volume of
   131         -a storage or distribution medium does not bring the other work under
   132         -the scope of this License.
   133         -
   134         -  3. You may copy and distribute the Program (or a work based on it,
   135         -under Section 2) in object code or executable form under the terms of
   136         -Sections 1 and 2 above provided that you also do one of the following:
   137         -
   138         -    a) Accompany it with the complete corresponding machine-readable
   139         -    source code, which must be distributed under the terms of Sections
   140         -    1 and 2 above on a medium customarily used for software interchange; or,
   141         -
   142         -    b) Accompany it with a written offer, valid for at least three
   143         -    years, to give any third party, for a charge no more than your
   144         -    cost of physically performing source distribution, a complete
   145         -    machine-readable copy of the corresponding source code, to be
   146         -    distributed under the terms of Sections 1 and 2 above on a medium
   147         -    customarily used for software interchange; or,
   148         -
   149         -    c) Accompany it with the information you received as to the offer
   150         -    to distribute corresponding source code.  (This alternative is
   151         -    allowed only for noncommercial distribution and only if you
   152         -    received the program in object code or executable form with such
   153         -    an offer, in accord with Subsection b above.)
   154         -
   155         -The source code for a work means the preferred form of the work for
   156         -making modifications to it.  For an executable work, complete source
   157         -code means all the source code for all modules it contains, plus any
   158         -associated interface definition files, plus the scripts used to
   159         -control compilation and installation of the executable.  However, as a
   160         -special exception, the source code distributed need not include
   161         -anything that is normally distributed (in either source or binary
   162         -form) with the major components (compiler, kernel, and so on) of the
   163         -operating system on which the executable runs, unless that component
   164         -itself accompanies the executable.
   165         -
   166         -If distribution of executable or object code is made by offering
   167         -access to copy from a designated place, then offering equivalent
   168         -access to copy the source code from the same place counts as
   169         -distribution of the source code, even though third parties are not
   170         -compelled to copy the source along with the object code.
   171         -
   172         -  4. You may not copy, modify, sublicense, or distribute the Program
   173         -except as expressly provided under this License.  Any attempt
   174         -otherwise to copy, modify, sublicense or distribute the Program is
   175         -void, and will automatically terminate your rights under this License.
   176         -However, parties who have received copies, or rights, from you under
   177         -this License will not have their licenses terminated so long as such
   178         -parties remain in full compliance.
   179         -
   180         -  5. You are not required to accept this License, since you have not
   181         -signed it.  However, nothing else grants you permission to modify or
   182         -distribute the Program or its derivative works.  These actions are
   183         -prohibited by law if you do not accept this License.  Therefore, by
   184         -modifying or distributing the Program (or any work based on the
   185         -Program), you indicate your acceptance of this License to do so, and
   186         -all its terms and conditions for copying, distributing or modifying
   187         -the Program or works based on it.
   188         -
   189         -  6. Each time you redistribute the Program (or any work based on the
   190         -Program), the recipient automatically receives a license from the
   191         -original licensor to copy, distribute or modify the Program subject to
   192         -these terms and conditions.  You may not impose any further
   193         -restrictions on the recipients' exercise of the rights granted herein.
   194         -You are not responsible for enforcing compliance by third parties to
   195         -this License.
   196         -
   197         -  7. If, as a consequence of a court judgment or allegation of patent
   198         -infringement or for any other reason (not limited to patent issues),
   199         -conditions are imposed on you (whether by court order, agreement or
   200         -otherwise) that contradict the conditions of this License, they do not
   201         -excuse you from the conditions of this License.  If you cannot
   202         -distribute so as to satisfy simultaneously your obligations under this
   203         -License and any other pertinent obligations, then as a consequence you
   204         -may not distribute the Program at all.  For example, if a patent
   205         -license would not permit royalty-free redistribution of the Program by
   206         -all those who receive copies directly or indirectly through you, then
   207         -the only way you could satisfy both it and this License would be to
   208         -refrain entirely from distribution of the Program.
   209         -
   210         -If any portion of this section is held invalid or unenforceable under
   211         -any particular circumstance, the balance of the section is intended to
   212         -apply and the section as a whole is intended to apply in other
   213         -circumstances.
   214         -
   215         -It is not the purpose of this section to induce you to infringe any
   216         -patents or other property right claims or to contest validity of any
   217         -such claims; this section has the sole purpose of protecting the
   218         -integrity of the free software distribution system, which is
   219         -implemented by public license practices.  Many people have made
   220         -generous contributions to the wide range of software distributed
   221         -through that system in reliance on consistent application of that
   222         -system; it is up to the author/donor to decide if he or she is willing
   223         -to distribute software through any other system and a licensee cannot
   224         -impose that choice.
   225         -
   226         -This section is intended to make thoroughly clear what is believed to
   227         -be a consequence of the rest of this License.
   228         -
   229         -  8. If the distribution and/or use of the Program is restricted in
   230         -certain countries either by patents or by copyrighted interfaces, the
   231         -original copyright holder who places the Program under this License
   232         -may add an explicit geographical distribution limitation excluding
   233         -those countries, so that distribution is permitted only in or among
   234         -countries not thus excluded.  In such case, this License incorporates
   235         -the limitation as if written in the body of this License.
   236         -
   237         -  9. The Free Software Foundation may publish revised and/or new versions
   238         -of the General Public License from time to time.  Such new versions will
   239         -be similar in spirit to the present version, but may differ in detail to
   240         -address new problems or concerns.
   241         -
   242         -Each version is given a distinguishing version number.  If the Program
   243         -specifies a version number of this License which applies to it and "any
   244         -later version", you have the option of following the terms and conditions
   245         -either of that version or of any later version published by the Free
   246         -Software Foundation.  If the Program does not specify a version number of
   247         -this License, you may choose any version ever published by the Free Software
   248         -Foundation.
   249         -
   250         -  10. If you wish to incorporate parts of the Program into other free
   251         -programs whose distribution conditions are different, write to the author
   252         -to ask for permission.  For software which is copyrighted by the Free
   253         -Software Foundation, write to the Free Software Foundation; we sometimes
   254         -make exceptions for this.  Our decision will be guided by the two goals
   255         -of preserving the free status of all derivatives of our free software and
   256         -of promoting the sharing and reuse of software generally.
   257         -
   258         -			    NO WARRANTY
   259         -
   260         -  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
   261         -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
   262         -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
   263         -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
   264         -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   265         -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
   266         -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
   267         -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
   268         -REPAIR OR CORRECTION.
   269         -
   270         -  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
   271         -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
   272         -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
   273         -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
   274         -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
   275         -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
   276         -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
   277         -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
   278         -POSSIBILITY OF SUCH DAMAGES.
   279         -
   280         -		     END OF TERMS AND CONDITIONS
   281         -
   282         -	    How to Apply These Terms to Your New Programs
   283         -
   284         -  If you develop a new program, and you want it to be of the greatest
   285         -possible use to the public, the best way to achieve this is to make it
   286         -free software which everyone can redistribute and change under these terms.
   287         -
   288         -  To do so, attach the following notices to the program.  It is safest
   289         -to attach them to the start of each source file to most effectively
   290         -convey the exclusion of warranty; and each file should have at least
   291         -the "copyright" line and a pointer to where the full notice is found.
   292         -
   293         -    <one line to give the program's name and a brief idea of what it does.>
   294         -    Copyright (C) 19yy  <name of author>
   295         -
   296         -    This program is free software; you can redistribute it and/or modify
   297         -    it under the terms of the GNU General Public License as published by
   298         -    the Free Software Foundation; either version 2 of the License, or
   299         -    (at your option) any later version.
   300         -
   301         -    This program is distributed in the hope that it will be useful,
   302         -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   303         -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   304         -    GNU General Public License for more details.
   305         -
   306         -    You should have received a copy of the GNU General Public License
   307         -    along with this program; if not, write to the Free Software
   308         -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   309         -
   310         -
   311         -Also add information on how to contact you by electronic and paper mail.
   312         -
   313         -If the program is interactive, make it output a short notice like this
   314         -when it starts in an interactive mode:
   315         -
   316         -    Gnomovision version 69, Copyright (C) 19yy name of author
   317         -    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
   318         -    This is free software, and you are welcome to redistribute it
   319         -    under certain conditions; type `show c' for details.
   320         -
   321         -The hypothetical commands `show w' and `show c' should show the appropriate
   322         -parts of the General Public License.  Of course, the commands you use may
   323         -be called something other than `show w' and `show c'; they could even be
   324         -mouse-clicks or menu items--whatever suits your program.
   325         -
   326         -You should also get your employer (if you work as a programmer) or your
   327         -school, if any, to sign a "copyright disclaimer" for the program, if
   328         -necessary.  Here is a sample; alter the names:
   329         -
   330         -  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
   331         -  `Gnomovision' (which makes passes at compilers) written by James Hacker.
   332         -
   333         -  <signature of Ty Coon>, 1 April 1989
   334         -  Ty Coon, President of Vice
   335         -
   336         -This General Public License does not permit incorporating your program into
   337         -proprietary programs.  If your program is a subroutine library, you may
   338         -consider it more useful to permit linking proprietary applications with the
   339         -library.  If this is what you want to do, use the GNU Library General
   340         -Public License instead of this License.

Changes to Makefile.in.

   207    207   		$(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL)
   208    208   
   209    209   testfixture:	$(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC)
   210    210   	$(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture \
   211    211   		$(TESTSRC) $(TOP)/src/tclsqlite.c \
   212    212   		libsqlite.a $(LIBTCL)
   213    213   
   214         -test:	testfixture sqlite
          214  +fulltest:	testfixture sqlite
   215    215   	./testfixture $(TOP)/test/all.test
   216    216   
          217  +test:	testfixture sqlite
          218  +	./testfixture $(TOP)/test/quick.test
          219  +
   217    220   sqlite.tar.gz:	
   218    221   	pwd=`pwd`; cd $(TOP)/..; tar czf $$pwd/sqlite.tar.gz sqlite
   219    222   
   220    223   index.html:	$(TOP)/www/index.tcl sqlite.tar.gz last_change
   221    224   	tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html
   222    225   
   223    226   sqlite.html:	$(TOP)/www/sqlite.tcl

Changes to doc/lemon.html.

    99     99   Using ``-s'' causes a brief summary of parser statistics to be
   100    100   printed.  Like this:
   101    101   <pre>
   102    102      Parser statistics: 74 terminals, 70 nonterminals, 179 rules
   103    103                         340 states, 2026 parser table entries, 0 conflicts
   104    104   </pre>
   105    105   Finally, the ``-x'' option causes Lemon to print its version number
   106         -and copyright information
   107         -and then stop without attempting to read the grammar or generate a parser.</p>
          106  +and then stops without attempting to read the grammar or generate a parser.</p>
   108    107   
   109    108   <h3>The Parser Interface</h3>
   110    109   
   111    110   <p>Lemon doesn't generate a complete, working program.  It only generates
   112    111   a few subroutines that implement a parser.  This section describes
   113    112   the interface to those subroutines.  It is up to the programmer to
   114    113   call these subroutines in an appropriate way in order to produce a

Changes to doc/report1.txt.

     1         -The SQL database used for ACD contains 105 tables and indices implemented
     2         -in GDBM.  The following are statistics on the sizes of keys and data
     3         -within these tables and indices.
            1  +An SQLite (version 1.0) database was used in a large military application
            2  +where the database contained 105 tables and indices.  The following is
            3  +a breakdown on the sizes of keys and data within these tables and indices:
     4      4   
     5      5   Entries:      967089
     6      6   Size:         45896104
     7      7   Avg Size:     48
     8      8   Key Size:     11112265
     9      9   Avg Key Size: 12
    10     10   Max Key Size: 99

Deleted notes/notes1.txt.

     1         -unlocked -> read
     2         -
     3         -   1.  If the journal file exists
     4         -          A.  Open the journal file for exclusive access
     5         -                 i) return SQLITE_BUSY
     6         -          B.  Get a write lock on the database
     7         -                 i) close the journal file
     8         -                ii) return SQLITE_PROTOCOL_ERROR
     9         -          C.  playback the journal
    10         -          D.  close and delete the journal file
    11         -          E.  drop the write lock on the database
    12         -   2.  Get a read lock on the database file.
    13         -          A.  return SQLITE_BUSY
    14         -   3.  return SQLITE_OK
    15         -
    16         -read -> unlocked
    17         -
    18         -   1.  Drop the read lock on the database file
    19         -   2.  Invalidate all pages in the cache
    20         -   3.  return SQLITE_OK
    21         -
    22         -read -> write
    23         -
    24         -   1.  Create the journal file and open for exclusive access
    25         -          A.  return SQLITE_BUSY
    26         -   2.  Drop the read lock on the database
    27         -   3.  Get a write lock on the database 
    28         -          A.  Get a read lock on the database
    29         -                 i) return SQLITE_PROTOCOL_ERROR
    30         -          B.  Delete the journal
    31         -          C.  return SQLITE_BUSY
    32         -   4.  return SQLITE_OK
    33         -
    34         -write -> read  (commit)
    35         -
    36         -   1.  Sync the journal
    37         -   2.  Write all dirty pages
    38         -          A.  playback journal
    39         -          B.  Reload or invalidate all pages in cache
    40         -   3.  Sync the database
    41         -   4.  Drop the write lock on the database
    42         -   5.  Get a read lock on the database
    43         -          A.  return SQLITE_PROTOCOL_ERROR
    44         -   6.  Delete the journal
    45         -   7.  return SQLITE_OK
    46         -
    47         -write -> read  (rollback)
    48         -
    49         -   1.  Playback the journal
    50         -   2.  Drop the write lock on the database
    51         -   3.  Get a read lock on the database
    52         -          A.  return SQLITE_PROTOCOL_ERROR
    53         -   4.  Delete the journal
    54         -   5.  Reload or invalidate all pages in cache
    55         -   6.  SQLITE_FULL

Deleted notes/notes2.txt.

     1         -How to do a B-Tree insert:
     2         -
     3         -  insert(data){
     4         -    create a new cursor
     5         -    move cursor to the entry nearest data
     6         -    if( cursor.key == keyof(data) ){
     7         -      replace cursor.data with dataof(data)
     8         -      return
     9         -    }
    10         -    childpg = NULL
    11         -    add_to_page(cursor, data+childpg)
    12         -    delete the cursor
    13         -  }
    14         -
    15         -  add_to_page(cursor, data+childpg ){
    16         -    childpg->parent = cursor.page
    17         -    if( data+childpg fits on cursor.page ){
    18         -      insert data+childpg at cursor
    19         -      return
    20         -    }
    21         -    if( page==root ){
    22         -      split page+(data+childpg) into newpage1, center, newpage2
    23         -      cursor.page = &newpage1 + center + &newpage2;
    24         -      newpage1->parent = cursor.page
    25         -      newpage2->parent = cursor.page
    26         -      return
    27         -    }
    28         -    if( move_some_data_left || move_some_data_right ){
    29         -      insert data+childpg at cursor
    30         -      return
    31         -    }
    32         -    split page+(data+childpg) into page, center, newpage
    33         -    newpage->parent = page->parent
    34         -    move cursor to insertion point of center in parent page.
    35         -    add_to_page(cursor, center, (newpage));
    36         -  }
    37         -
    38         -How to do a B-Tree delete:
    39         -
    40         -  delete(entry){
    41         -    if( entry is not a leaf ){
    42         -      p = predecessor of entry
    43         -      // note: if entry is not a leaf then p must
    44         -      // exist and must be a leaf
    45         -      free(entry.overflowptr)
    46         -      resize entry so that is is big enough to hold p.payload
    47         -      entry.payload = p.payload
    48         -      entry.overflowptr = p.overflowptr
    49         -      p.overflowptr = NULL
    50         -      delete(p)
    51         -      return
    52         -    }
    53         -    unlink entry from its page
    54         -    refill(page containing entry)
    55         -  }
    56         -
    57         -  refill(page){
    58         -    if( page is more than half full ) return
    59         -    if( page is the root and contains no entries ){
    60         -      copy the one child page into this page thus reducing
    61         -      the height of the tree by one.
    62         -      return
    63         -    }
    64         -    if( able to merge page with neighbors ){
    65         -      do the merge
    66         -      refill(parent page)
    67         -      return
    68         -    }
    69         -    borrow entrys from neighbors
    70         -  }

Deleted notes/notes2b.txt.

     1         -
     2         -
     3         -add_to_page(cursor, payload, child){
     4         -  if( fits-on-current-page ){
     5         -    insert (child,payload) into cursor
     6         -    return
     7         -  }
     8         -  if( cursor is root page ){
     9         -    split cursor+(child,payload) into page1, center, page2
    10         -    set cursor page to page1,center,page2
    11         -    return
    12         -  }
    13         -  if( move_some_data_left || move_some_data_right ){
    14         -    add (child,payload) to cursor
    15         -    return
    16         -  }
    17         -  split cursor+(child,payload) into self, center, page2
    18         -  move_up(cursor)
    19         -  add_to_page(cursor, center, page2)
    20         -}
    21         -
    22         -
    23         -split(in_page, payload, child_pgno, out_page1, center_payload, out_page2){
    24         -  // It might be that in_page==out_page1
    25         -
    26         -}

Deleted notes/notes3.txt.

     1         -The Proposed New SQLite 2.0 Interface design.  (April 16, 2001)
     2         -
     3         -Primary access routines:
     4         -  Control functions:
     5         -      sqlite *sqlite_open(const char *zFilename);
     6         -      int sqlite_compile(sqlite*, const char *zSql);
     7         -      int sqlite_next(sqlite*);
     8         -      int sqlite_abort(sqlite*);
     9         -      int sqlite_finish(sqlite*);
    10         -      sqlite *sqlite_dup(sqlite*);
    11         -      int sqlite_close(sqlite*);
    12         -  Access functions:
    13         -      int sqlite_status(sqlite*);
    14         -      char *sqlite_error_text(sqlite*);
    15         -      int sqlite_column_count(sqlite*);
    16         -      char **sqlite_column_names(sqlite*);
    17         -      char **sqlite_values(sqlite*);
    18         -      const char sqlite_version[];
    19         -      const char sqlite_encoding[];
    20         -
    21         -Secondary access routines:
    22         -  Control functions:
    23         -      int sqlite_complete(const char *);
    24         -      char *sqlite_mprintf(const char *zFormat, ...)
    25         -      char *sqlite_vmprintf(const char *zFormat, va_list ap);
    26         -      int sqlite_compile_printf(sqlite*, const char *zFormat, ...);
    27         -      int sqlite_compile_vprintf(sqlite*, const char *zFormat, va_list ap);
    28         -      int sqlite_eval(sqlite*, const char *zSql);
    29         -      int sqlite_retry(sqlite*);
    30         -      int sqlite_eval_printf(sqlite*, const char *zFormat, ...);
    31         -      int sqlite_eval_vprintf(sqlite*, const char *zFormat, va_list ap);
    32         -      int sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*);
    33         -      int sqlite_busy_timeout(sqlite*, int ms);
    34         -  Access functions:
    35         -      int sqlite_row_count(sqlite*);
    36         -      char ***sqlite_rows(sqlite*, int iRow);
    37         -
    38         -Usage examples:
    39         -  Getting an entire result table in one go:
    40         -      sqlite *p = sqlite_open("ex.db");
    41         -      sqlite_eval(p, "SELECT * FROM table_one");
    42         -      for(i=0; i<sqlite_row_count(p); i++){
    43         -        if( i>0 ) printf("\n");
    44         -        for(j=0; j<sqlite_column_count(p); j++){
    45         -          printf("%s = %s\n", sqlite_column_names(p)[j], sqlite_row(p,i)[j]);
    46         -        }
    47         -      }
    48         -      sqlite_close(p);
    49         -      
    50         -  Getting one row at a time:
    51         -      sqlite *p = sqlite_open("ex.db");
    52         -      sqlite_compile(p, "SELECT * FROM table_one");
    53         -      for(i=0; sqlite_next(p)==SQLITE_OK; i++ ){ 
    54         -        if( i>0 ) printf("\n");
    55         -        for(j=0; j<sqlite_column_count(p); j++){
    56         -          printf("%s = %s\n", sqlite_column_names(p)[j], sqlite_values(p)[j];
    57         -        }
    58         -      }
    59         -      sqlite_close(p);
    60         -
    61         -  Getting an entire result table with error and lock detection:
    62         -      sqlite *p = sqlite_open("ex.db");
    63         -      if( p==0 ){
    64         -        fprintf(stderr,"out of memory");
    65         -        return;
    66         -      }
    67         -      if( sqlite_status(p)!=SQLITE_OK ){
    68         -        fprintf(stderr,"Error opening database: %s", sqlite_error_text(p));
    69         -        sqlite_close(p);
    70         -        return;
    71         -      }
    72         -      sqlite_busy_timeout(p, 5000);
    73         -      sqlite_eval(p, "SELECT * FROM table_one");
    74         -      if( sqlite_status(p)!=SQLITE_OK ){
    75         -        fprintf(stderr,"Query error: %s\n", sqlite_error_text(p));
    76         -        sqlite_close(p);
    77         -        return;
    78         -      }
    79         -      for(i=0; i<sqlite_row_count(p); i++){
    80         -        if( i>0 ) printf("\n");
    81         -        for(j=0; j<sqlite_column_count(p); j++){
    82         -          printf("%s = %s\n", sqlite_column_names(p)[j], sqlite_row(p,i)[j]);
    83         -        }
    84         -      }
    85         -      sqlite_close(p);
    86         -      
    87         -  Getting one row at a time with manual control of lock conflicts:
    88         -      sqlite *p = sqlite_open("ex.db");
    89         -      if( p==0 ){
    90         -        fprintf(stderr,"out of memory");
    91         -        return;
    92         -      }
    93         -      if( sqlite_status(p)!=SQLITE_OK ){
    94         -        fprintf(stderr,"Error opening database: %s", sqlite_error_text(p));
    95         -        sqlite_close(p);
    96         -        return;
    97         -      }
    98         -      sqlite_compile(p, "SELECT * FROM table_one");
    99         -      if( sqlite_status(p)!=SQLITE_OK ){
   100         -        fprintf(stderr,"Query error: %s\n", sqlite_error_text(p));
   101         -        sqlite_close(p);
   102         -        return;
   103         -      }
   104         -      for(i=0; sqlite_status(p)==SQLITE_OK; i++ ){ 
   105         -        for(j=0; j<50 && sqlite_next(p)==SQLITE_BUSY; j++){
   106         -          usleep(100000);
   107         -        }
   108         -        if( sqlite_status(p)!=SQLITE_OK ) break;
   109         -        if( i>0 ) printf("\n");
   110         -        for(j=0; j<sqlite_column_count(p); j++){
   111         -          printf("%s = %s\n", sqlite_column_names(p)[j], sqlite_values(p)[j];
   112         -        }
   113         -      }
   114         -      sqlite_close(p);
   115         -
   116         -TCL Interface
   117         -
   118         -  sqlite DB FILENAME ?MODE?
   119         -  DB compile SQL
   120         -  DB next
   121         -  DB status
   122         -  DB errortext
   123         -  DB row VAR
   124         -  DB argc
   125         -  DB argv ?N?
   126         -  DB table ?VAR?
   127         -  DB columns ?N?
   128         -  DB finish
   129         -  DB abort
   130         -  DB eval SQL ?VAR SCRIPT?
   131         -  DB close
   132         -  DB complete
   133         -  DB timeout MS
   134         -  DB busy SCRIPT
   135         -  DB dup NEWDB
   136         -
   137         -Primary access pattern:
   138         -
   139         -  sqlite *db = sqlite_open("testdb", 0644);
   140         -  sqlite_compile(db, "SELECT * FROM sqlite_master");
   141         -  while( sqlite_row(db, &argc, &argv)==SQLITE_OK ){
   142         -    /* Do something with the row data in argc, argv */
   143         -  }
   144         -  sqlite_finish(db);
   145         -  sqlite_close(db);
   146         -
   147         -Alternative access pattern 1:
   148         -
   149         -  sqlite *db = sqlite_open("testdb", 0644);
   150         -  sqlite_compile(db, "SELECT * FROM sqlite_master");
   151         -  sqlite_table(db, &nrow, &ncolumn, &argv);
   152         -  /* Do something with the matrix data in argv */
   153         -  sqlite_finish(db);
   154         -  sqlite_close(db);
   155         -
   156         -Issues:
   157         -
   158         -  *  If one query is in progress and we do sqlite_compile(), does
   159         -     that abort the current query or return an error code?
   160         -
   161         -  *  What happens here:
   162         -        sqlite_compile(db, "SELECT a FROM t1; SELECT b,c FROM t2;");
   163         -        sqlite_table(db, &nrow, &ncolumn, &argv);
   164         -     What value is returned for nrow and ncolumn?  Or is this an error?
   165         -     Or maybe only the first table is returned?

Changes to src/btree.c.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24         -** $Id: btree.c,v 1.28 2001/09/15 13:15:13 drh Exp $
           12  +** $Id: btree.c,v 1.29 2001/09/16 00:13:26 drh Exp $
    25     13   **
    26     14   ** This file implements a external (disk-based) database using BTrees.
    27     15   ** For a detailed discussion of BTrees, refer to
    28     16   **
    29     17   **     Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
    30     18   **     "Sorting And Searching", pages 473-480. Addison-Wesley
    31     19   **     Publishing Company, Reading, Massachusetts.
................................................................................
    49     37   ** In this implementation, a single file can hold one or more separate 
    50     38   ** BTrees.  Each BTree is identified by the index of its root page.  The
    51     39   ** key and data for any entry are combined to form the "payload".  Up to
    52     40   ** MX_LOCAL_PAYLOAD bytes of payload can be carried directly on the
    53     41   ** database page.  If the payload is larger than MX_LOCAL_PAYLOAD bytes
    54     42   ** then surplus bytes are stored on overflow pages.  The payload for an
    55     43   ** entry and the preceding pointer are combined to form a "Cell".  Each 
    56         -** page has a smaller header which contains the Ptr(N+1) pointer.
           44  +** page has a small header which contains the Ptr(N+1) pointer.
    57     45   **
    58     46   ** The first page of the file contains a magic string used to verify that
    59     47   ** the file really is a valid BTree database, a pointer to a list of unused
    60     48   ** pages in the file, and some meta information.  The root of the first
    61     49   ** BTree begins on page 2 of the file.  (Pages are numbered beginning with
    62     50   ** 1, not 0.)  Thus a minimum database contains 2 pages.
    63     51   */
................................................................................
    70     58   /*
    71     59   ** Primitive data types.  u32 must be 4 bytes and u16 must be 2 bytes.
    72     60   ** The uptr type must be big enough to hold a pointer.
    73     61   ** Change these typedefs when porting to new architectures.
    74     62   */
    75     63   typedef unsigned int uptr;
    76     64   
    77         -/* There are already definedin sqliteInt.h...
           65  +/* There are already defined in sqliteInt.h...
    78     66   ** typedef unsigned int u32;
    79     67   ** typedef unsigned short int u16;
    80     68   ** typedef unsigned char u8;
    81     69   */
    82     70   
    83     71   /*
    84     72   ** This macro casts a pointer to an integer.  Useful for doing
................................................................................
   118    106   ** This is a magic integer also used to test the integrity of the database
   119    107   ** file.  This integer is used in addition to the string above so that
   120    108   ** if the file is written on a little-endian architecture and read
   121    109   ** on a big-endian architectures (or vice versa) we can detect the
   122    110   ** problem.
   123    111   **
   124    112   ** The number used was obtained at random and has no special
   125         -** significance.
          113  +** significance other than the fact that it represents a different
          114  +** integer on little-endian and big-endian machines.
   126    115   */
   127    116   #define MAGIC 0xdae37528
   128    117   
   129    118   /*
   130    119   ** The first page of the database file contains a magic header string
   131    120   ** to identify the file as an SQLite database file.  It also contains
   132    121   ** a pointer to the first free page of the file.  Page 2 contains the

Changes to src/btree.h.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This header file defines the interface that the sqlite B-Tree file
    25     13   ** subsystem.
    26     14   **
    27         -** @(#) $Id: btree.h,v 1.13 2001/09/14 18:54:08 drh Exp $
           15  +** @(#) $Id: btree.h,v 1.14 2001/09/16 00:13:26 drh Exp $
    28     16   */
    29     17   #ifndef _BTREE_H_
    30     18   #define _BTREE_H_
    31     19   
    32     20   typedef struct Btree Btree;
    33     21   typedef struct BtCursor BtCursor;
    34     22   

Changes to src/build.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24         -** This file contains C code routines that are called by the parser
    25         -** when syntax rules are reduced.  The routines in this file handle
    26         -** the following kinds of syntax:
           12  +** This file contains C code routines that are called by the SQLite parser
           13  +** when syntax rules are reduced.  The routines in this file handle the
           14  +** following kinds of SQL syntax:
    27     15   **
    28     16   **     CREATE TABLE
    29     17   **     DROP TABLE
    30     18   **     CREATE INDEX
    31     19   **     DROP INDEX
    32     20   **     creating expressions and ID lists
    33     21   **     COPY
    34     22   **     VACUUM
           23  +**     BEGIN TRANSACTION
           24  +**     COMMIT
           25  +**     ROLLBACK
           26  +**     PRAGMA
    35     27   **
    36         -** $Id: build.c,v 1.35 2001/09/15 00:57:28 drh Exp $
           28  +** $Id: build.c,v 1.36 2001/09/16 00:13:26 drh Exp $
    37     29   */
    38     30   #include "sqliteInt.h"
    39     31   #include <ctype.h>
    40     32   
    41     33   /*
    42     34   ** This routine is called after a single SQL statement has been
    43     35   ** parsed and we want to execute the VDBE code to implement 

Changes to src/delete.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains C code routines that are called by the parser
    25     13   ** to handle DELETE FROM statements.
    26     14   **
    27         -** $Id: delete.c,v 1.13 2001/09/15 00:57:29 drh Exp $
           15  +** $Id: delete.c,v 1.14 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #include "sqliteInt.h"
    30     18   
    31     19   /*
    32     20   ** Process a DELETE FROM statement.
    33     21   */
    34     22   void sqliteDeleteFrom(

Changes to src/expr.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains routines used for analyzing expressions and
    25         -** for generating VDBE code that evaluates expressions.
           13  +** for generating VDBE code that evaluates expressions in SQLite.
    26     14   **
    27         -** $Id: expr.c,v 1.27 2001/09/14 03:24:25 drh Exp $
           15  +** $Id: expr.c,v 1.28 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #include "sqliteInt.h"
    30     18   
    31     19   /*
    32     20   ** Walk an expression tree.  Return 1 if the expression is constant
    33     21   ** and 0 if it involves variables.
    34     22   */

Changes to src/insert.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains C code routines that are called by the parser
    25         -** to handle INSERT statements.
           13  +** to handle INSERT statements in SQLite.
    26     14   **
    27         -** $Id: insert.c,v 1.17 2001/09/15 00:57:29 drh Exp $
           15  +** $Id: insert.c,v 1.18 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #include "sqliteInt.h"
    30     18   
    31     19   /*
    32     20   ** This routine is call to handle SQL of the following forms:
    33     21   **
    34     22   **    insert into TABLE (IDLIST) values(EXPRLIST)

Changes to src/main.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Main file for the SQLite library.  The routines in this file
    25     13   ** implement the programmer interface to the library.  Routines in
    26     14   ** other files are for internal use by SQLite and should not be
    27     15   ** accessed by users of the library.
    28     16   **
    29         -** $Id: main.c,v 1.36 2001/09/15 00:57:29 drh Exp $
           17  +** $Id: main.c,v 1.37 2001/09/16 00:13:27 drh Exp $
    30     18   */
    31     19   #include "sqliteInt.h"
    32     20   #if defined(HAVE_USLEEP) && HAVE_USLEEP
    33     21   #include <unistd.h>
    34     22   #endif
    35     23   
    36     24   /*

Changes to src/pager.c.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24         -** This is the implementation of the page cache subsystem.
           12  +** This is the implementation of the page cache subsystem or "pager".
    25     13   ** 
    26         -** The page cache is used to access a database file.  The pager journals
    27         -** all writes in order to support rollback.  Locking is used to limit
    28         -** access to one or more reader or to one writer.
           14  +** The pager is used to access a database disk file.  It implements
           15  +** atomic commit and rollback through the use of a journal file that
           16  +** is separate from the database file.  The pager also implements file
           17  +** locking to prevent two processes from writing the same database
           18  +** file simultaneously, or one process from reading the database while
           19  +** another is writing.
    29     20   **
    30         -** @(#) $Id: pager.c,v 1.19 2001/09/15 00:57:29 drh Exp $
           21  +** @(#) $Id: pager.c,v 1.20 2001/09/16 00:13:27 drh Exp $
    31     22   */
    32     23   #include "sqliteInt.h"
    33     24   #include "pager.h"
    34     25   #include <fcntl.h>
    35     26   #include <sys/stat.h>
    36     27   #include <unistd.h>
    37     28   #include <assert.h>
................................................................................
    99     90   #define DATA_TO_PGHDR(D)  (&((PgHdr*)(D))[-1])
   100     91   #define PGHDR_TO_EXTRA(P) ((void*)&((char*)(&(P)[1]))[SQLITE_PAGE_SIZE])
   101     92   
   102     93   /*
   103     94   ** How big to make the hash table used for locating in-memory pages
   104     95   ** by page number.  Knuth says this should be a prime number.
   105     96   */
   106         -#define N_PG_HASH 907
           97  +#define N_PG_HASH 373
   107     98   
   108     99   /*
   109    100   ** A open page cache is an instance of the following structure.
   110    101   */
   111    102   struct Pager {
   112    103     char *zFilename;            /* Name of the database file */
   113    104     char *zJournal;             /* Name of the journal file */
................................................................................
   680    671   int sqlitepager_ref(void *pData){
   681    672     PgHdr *pPg = DATA_TO_PGHDR(pData);
   682    673     page_ref(pPg);
   683    674     return SQLITE_OK;
   684    675   }
   685    676   
   686    677   /*
   687         -** Sync the journal and write all free dirty pages to the database file.
          678  +** Sync the journal and then write all free dirty pages to the database
          679  +** file.
          680  +**
          681  +** Writing all free dirty pages to the database after the sync is a
          682  +** non-obvious optimization.  fsync() is an expensive operation so we
          683  +** want to minimize the number that occur.  So after an fsync() is forced
          684  +** and we are free to write dirty pages back to the database, it is best
          685  +** to go ahead and do as much of that as possible to minimize the chance
          686  +** of having to do another fsync() later on.  Writing dirty free pages
          687  +** in this way make database operations go up to 10 times faster.
   688    688   */
   689    689   static int syncAllPages(Pager *pPager){
   690    690     PgHdr *pPg;
   691    691     int rc = SQLITE_OK;
   692    692     if( pPager->needSync ){
   693    693       rc = fsync(pPager->jfd);
   694    694       if( rc!=0 ) return rc;
................................................................................
   814    814         ** Try to find one that is not dirty and is near the head of
   815    815         ** of the free list */
   816    816         int cnt = pPager->mxPage/2;
   817    817         pPg = pPager->pFirst;
   818    818         while( pPg->dirty && 0<cnt-- && pPg->pNextFree ){
   819    819           pPg = pPg->pNextFree;
   820    820         }
          821  +
          822  +      /* If we could not find a page that has not been used recently
          823  +      ** and which is not dirty, then sync the journal and write all
          824  +      ** dirty free pages into the database file, thus making them
          825  +      ** clean pages and available for recycling.
          826  +      **
          827  +      ** We have to sync the journal before writing a page to the main
          828  +      ** database.  But syncing is a very slow operation.  So after a
          829  +      ** sync, it is best to write everything we can back to the main
          830  +      ** database to minimize the risk of having to sync again in the
          831  +      ** near future.  That is way we write all dirty pages after a
          832  +      ** sync.
          833  +      */
   821    834         if( pPg==0 || pPg->dirty ){
   822    835           int rc = syncAllPages(pPager);
   823    836           if( rc!=0 ){
   824    837             sqlitepager_rollback(pPager);
   825    838             *ppPage = 0;
   826    839             return SQLITE_IOERR;
   827    840           }
   828    841           pPg = pPager->pFirst;
   829    842         }
   830    843         assert( pPg->nRef==0 );
   831         -
   832         -
   833         -#if 0
   834         -      /****  Since putting in the call to syncAllPages() above, this code
   835         -      ** is no longer used.  I've kept it here for historical reference
   836         -      ** only.
   837         -      */
   838         -      /* If the page to be recycled is dirty, sync the journal and write 
   839         -      ** the old page into the database. */
   840         -      if( pPg->dirty ){
   841         -        int rc;
   842         -        assert( pPg->inJournal==1 );
   843         -        assert( pPager->state==SQLITE_WRITELOCK );
   844         -        if( pPager->needSync ){
   845         -          rc = fsync(pPager->jfd);
   846         -          if( rc!=0 ){
   847         -            rc = sqlitepager_rollback(pPager);
   848         -            *ppPage = 0;
   849         -            if( rc==SQLITE_OK ) rc = SQLITE_IOERR;
   850         -            return rc;
   851         -          }
   852         -          pPager->needSync = 0;
   853         -        }
   854         -        pager_seek(pPager->fd, (pPg->pgno-1)*SQLITE_PAGE_SIZE);
   855         -        rc = pager_write(pPager->fd, PGHDR_TO_DATA(pPg), SQLITE_PAGE_SIZE);
   856         -        if( rc!=SQLITE_OK ){
   857         -          rc = sqlitepager_rollback(pPager);
   858         -          *ppPage = 0;
   859         -          if( rc==SQLITE_OK ) rc = SQLITE_FULL;
   860         -          return rc;
   861         -        }
   862         -      }
   863         -#endif
   864    844         assert( pPg->dirty==0 );
   865    845   
   866    846         /* Unlink the old page from the free list and the hash table
   867    847         */
   868    848         if( pPg->pPrevFree ){
   869    849           pPg->pPrevFree->pNextFree = pPg->pNextFree;
   870    850         }else{

Changes to src/pager.h.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This header file defines the interface that the sqlite page cache
    25     13   ** subsystem.  The page cache subsystem reads and writes a file a page
    26     14   ** at a time and provides a journal for rollback.
    27     15   **
    28         -** @(#) $Id: pager.h,v 1.10 2001/09/15 13:15:13 drh Exp $
           16  +** @(#) $Id: pager.h,v 1.11 2001/09/16 00:13:27 drh Exp $
    29     17   */
    30     18   
    31     19   /*
    32     20   ** The size of one page
    33     21   */
    34     22   #define SQLITE_PAGE_SIZE 1024
    35     23   

Changes to src/parse.y.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains SQLite's grammar for SQL.  Process this file
    25     13   ** using the lemon parser generator to generate C code that runs
    26     14   ** the parser.  Lemon will also generate a header file containing
    27     15   ** numeric codes for all of the tokens.
    28     16   **
    29         -** @(#) $Id: parse.y,v 1.29 2001/09/14 18:54:09 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.30 2001/09/16 00:13:27 drh Exp $
    30     18   */
    31     19   %token_prefix TK_
    32     20   %token_type {Token}
    33     21   %default_type {Token}
    34     22   %extra_argument {Parse *pParse}
    35     23   %syntax_error {
    36     24     sqliteSetString(&pParse->zErrMsg,"syntax error",0);

Changes to src/random.c.

     1      1   /*
     2         -** Copyright (c) 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains code to implement a pseudo-random number
    25     13   ** generator (PRNG) for SQLite.
    26     14   **
    27     15   ** Random numbers are used by some of the database backends in order
    28     16   ** to generate random integer keys for tables or random filenames.
    29     17   **
    30         -** $Id: random.c,v 1.4 2001/09/14 03:24:25 drh Exp $
           18  +** $Id: random.c,v 1.5 2001/09/16 00:13:27 drh Exp $
    31     19   */
    32     20   #include "sqliteInt.h"
    33     21   #include <time.h>
    34     22   
    35     23   /*
    36     24   ** Get a single 8-bit random value from the RC4 PRNG.
    37     25   */

Changes to src/select.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains C code routines that are called by the parser
    25         -** to handle SELECT statements.
           13  +** to handle SELECT statements in SQLite.
    26     14   **
    27         -** $Id: select.c,v 1.36 2001/09/14 03:24:25 drh Exp $
           15  +** $Id: select.c,v 1.37 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #include "sqliteInt.h"
    30     18   
    31     19   /*
    32     20   ** Allocate a new Select structure and return a pointer to that
    33     21   ** structure.
    34     22   */

Changes to src/shell.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains code to implement the "sqlite" command line
    25     13   ** utility for accessing SQLite databases.
    26     14   **
    27         -** $Id: shell.c,v 1.32 2001/09/13 13:46:57 drh Exp $
           15  +** $Id: shell.c,v 1.33 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #include <stdlib.h>
    30     18   #include <string.h>
    31     19   #include <stdio.h>
    32     20   #include "sqlite.h"
    33     21   #include <unistd.h>
    34     22   #include <ctype.h>

Changes to src/sqlite.h.in.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24         -** This header file defines the interface that the sqlite library
           12  +** This header file defines the interface that the SQLite library
    25     13   ** presents to client programs.
    26     14   **
    27         -** @(#) $Id: sqlite.h.in,v 1.16 2001/09/15 13:15:13 drh Exp $
           15  +** @(#) $Id: sqlite.h.in,v 1.17 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #ifndef _SQLITE_H_
    30     18   #define _SQLITE_H_
    31     19   #include <stdarg.h>     /* Needed for the definition of va_list */
    32     20   
    33     21   /*
    34     22   ** The version of the SQLite library.
................................................................................
   105     93   ** value then the query is aborted, all subsequent SQL statements
   106     94   ** are skipped and the sqlite_exec() function returns the SQLITE_ABORT.
   107     95   **
   108     96   ** The 4th parameter is an arbitrary pointer that is passed
   109     97   ** to the callback function as its first parameter.
   110     98   **
   111     99   ** The 2nd parameter to the callback function is the number of
   112         -** columns in the query result.  The 3rd parameter is an array
   113         -** of string holding the values for each column.  The 4th parameter
   114         -** is an array of strings holding the names of each column.
          100  +** columns in the query result.  The 3rd parameter to the callback
          101  +** is an array of strings holding the values for each column.
          102  +** The 4th parameter to the callback is an array of strings holding
          103  +** the names of each column.
   115    104   **
   116    105   ** The callback function may be NULL, even for queries.  A NULL
   117    106   ** callback is not an error.  It just means that no callback
   118    107   ** will be invoked.
   119    108   **
   120    109   ** If an error occurs while parsing or evaluating the SQL (but
   121    110   ** not while executing the callback) then an appropriate error
   122    111   ** message is written into memory obtained from malloc() and
   123         -** *errmsg is made to point to that message.  If errmsg==NULL,
   124         -** then no error message is ever written.  The return value is
   125         -** SQLITE_ERROR if an error occurs.  The calling function is
   126         -** responsible for freeing the memory that holds the error
   127         -** message.
          112  +** *errmsg is made to point to that message.  The calling function
          113  +** is responsible for freeing the memory that holds the error
          114  +** message.  If errmsg==NULL, then no error message is ever written.
          115  +**
          116  +** The return value is is SQLITE_OK if there are no errors and
          117  +** some other return code if there is an error.  The particular
          118  +** return value depends on the type of error. 
   128    119   **
   129    120   ** If the query could not be executed because a database file is
   130    121   ** locked or busy, then this function returns SQLITE_BUSY.  (This
   131    122   ** behavior can be modified somewhat using the sqlite_busy_handler()
   132         -** and sqlite_busy_timeout() functions below.) If the query could 
   133         -** not be executed because a file is missing or has incorrect 
   134         -** permissions, this function returns SQLITE_ERROR.
          123  +** and sqlite_busy_timeout() functions below.)
   135    124   */
   136    125   int sqlite_exec(
   137    126     sqlite*,                      /* An open database */
   138    127     char *sql,                    /* SQL to be executed */
   139    128     sqlite_callback,              /* Callback function */
   140    129     void *,                       /* 1st argument to callback function */
   141    130     char **errmsg                 /* Error msg written here */
................................................................................
   149    138   #define SQLITE_INTERNAL  2    /* An internal logic error in SQLite */
   150    139   #define SQLITE_PERM      3    /* Access permission denied */
   151    140   #define SQLITE_ABORT     4    /* Callback routine requested an abort */
   152    141   #define SQLITE_BUSY      5    /* One or more database files are locked */
   153    142   #define SQLITE_NOMEM     6    /* A malloc() failed */
   154    143   #define SQLITE_READONLY  7    /* Attempt to write a readonly database */
   155    144   #define SQLITE_INTERRUPT 8    /* Operation terminated by sqlite_interrupt() */
   156         -#define SQLITE_IOERR     9    /* Disk full or other I/O error */
          145  +#define SQLITE_IOERR     9    /* Some kind of disk I/O error occurred */
   157    146   #define SQLITE_CORRUPT   10   /* The database disk image is malformed */
   158    147   #define SQLITE_NOTFOUND  11   /* Table or record not found */
   159    148   #define SQLITE_FULL      12   /* Insertion failed because database is full */
   160    149   #define SQLITE_CANTOPEN  13   /* Unable to open the database file */
   161    150   #define SQLITE_PROTOCOL  14   /* Database lock protocol error */
   162    151   #define SQLITE_EMPTY     15   /* Database table is empty */
   163    152   #define SQLITE_SCHEMA    16   /* The database schema changed */

Changes to src/sqliteInt.h.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Internal interface definitions for SQLite.
    25     13   **
    26         -** @(#) $Id: sqliteInt.h,v 1.50 2001/09/15 14:43:39 drh Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.51 2001/09/16 00:13:27 drh Exp $
    27     15   */
    28     16   #include "sqlite.h"
    29     17   #include "vdbe.h"
    30     18   #include "parse.h"
    31     19   #include "btree.h"
    32     20   #include <stdio.h>
    33     21   #include <stdlib.h>

Changes to src/table.c.

     1      1   /*
     2         -** Copyright (c) 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains the sqlite_get_table() and sqlite_free_table()
    25     13   ** interface routines.  These are just wrappers around the main
    26     14   ** interface routine of sqlite_exec().
    27     15   **
    28     16   ** These routines are in a separate files so that they will not be linked

Changes to src/tclsqlite.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** A TCL Interface to SQLite
    25     13   **
    26         -** $Id: tclsqlite.c,v 1.22 2001/08/20 00:33:58 drh Exp $
           14  +** $Id: tclsqlite.c,v 1.23 2001/09/16 00:13:27 drh Exp $
    27     15   */
    28     16   #ifndef NO_TCL     /* Omit this whole file if TCL is unavailable */
    29     17   
    30     18   #include "sqlite.h"
    31     19   #include "tcl.h"
    32     20   #include <stdlib.h>
    33     21   #include <string.h>

Changes to src/test1.c.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Code for testing the printf() interface to SQLite.  This code
    25     13   ** is not included in the SQLite library.  It is used for automated
    26     14   ** testing of the SQLite library.
    27     15   **
    28         -** $Id: test1.c,v 1.2 2001/04/11 14:28:43 drh Exp $
           16  +** $Id: test1.c,v 1.3 2001/09/16 00:13:27 drh Exp $
    29     17   */
    30     18   #include "sqliteInt.h"
    31     19   #include "tcl.h"
    32     20   #include <stdlib.h>
    33     21   #include <string.h>
    34     22   
    35     23   /*

Changes to src/test2.c.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Code for testing the pager.c module in SQLite.  This code
    25     13   ** is not included in the SQLite library.  It is used for automated
    26     14   ** testing of the SQLite library.
    27     15   **
    28         -** $Id: test2.c,v 1.4 2001/08/20 00:33:58 drh Exp $
           16  +** $Id: test2.c,v 1.5 2001/09/16 00:13:27 drh Exp $
    29     17   */
    30     18   #include "sqliteInt.h"
    31     19   #include "pager.h"
    32     20   #include "tcl.h"
    33     21   #include <stdlib.h>
    34     22   #include <string.h>
    35     23   

Changes to src/test3.c.

     1      1   /*
     2         -** Copyright (c) 2001 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Code for testing the btree.c module in SQLite.  This code
    25     13   ** is not included in the SQLite library.  It is used for automated
    26     14   ** testing of the SQLite library.
    27     15   **
    28         -** $Id: test3.c,v 1.10 2001/09/13 21:53:10 drh Exp $
           16  +** $Id: test3.c,v 1.11 2001/09/16 00:13:27 drh Exp $
    29     17   */
    30     18   #include "sqliteInt.h"
    31     19   #include "pager.h"
    32     20   #include "btree.h"
    33     21   #include "tcl.h"
    34     22   #include <stdlib.h>
    35     23   #include <string.h>

Changes to src/tokenize.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** An tokenizer for SQL
    25     13   **
    26     14   ** This file contains C code that splits an SQL input string up into
    27     15   ** individual tokens and sends those tokens one-by-one over to the
    28     16   ** parser for analysis.
    29     17   **
    30         -** $Id: tokenize.c,v 1.21 2001/09/14 18:54:09 drh Exp $
           18  +** $Id: tokenize.c,v 1.22 2001/09/16 00:13:27 drh Exp $
    31     19   */
    32     20   #include "sqliteInt.h"
    33     21   #include <ctype.h>
    34     22   #include <stdlib.h>
    35     23   
    36     24   /*
    37     25   ** All the keywords of the SQL language are stored as in a hash
................................................................................
   301    289     }
   302    290     *tokenType = TK_ILLEGAL;
   303    291     return 1;
   304    292   }
   305    293   
   306    294   /*
   307    295   ** Run the parser on the given SQL string.  The parser structure is
   308         -** passed in.  An SQLITE_ status code.
          296  +** passed in.  An SQLITE_ status code is returned.  If an error occurs
          297  +** and pzErrMsg!=NULL then an error message might be written into 
          298  +** memory obtained from malloc() and *pzErrMsg made to point to that
          299  +** error message.  Or maybe not.
   309    300   */
   310    301   int sqliteRunParser(Parse *pParse, char *zSql, char **pzErrMsg){
   311    302     int nErr = 0;
   312    303     int i;
   313    304     void *pEngine;
   314    305     int once = 1;
   315    306     extern void *sqliteParserAlloc(void*(*)(int));

Changes to src/update.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This file contains C code routines that are called by the parser
    25     13   ** to handle UPDATE statements.
    26     14   **
    27         -** $Id: update.c,v 1.13 2001/09/15 00:57:29 drh Exp $
           15  +** $Id: update.c,v 1.14 2001/09/16 00:13:27 drh Exp $
    28     16   */
    29     17   #include "sqliteInt.h"
    30     18   
    31     19   /*
    32     20   ** Process an UPDATE statement.
    33     21   */
    34     22   void sqliteUpdate(

Changes to src/util.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Utility functions used throughout sqlite.
    25     13   **
    26     14   ** This file contains functions for allocating memory, comparing
    27     15   ** strings, and stuff like that.
    28     16   **
    29         -** $Id: util.c,v 1.24 2001/09/15 13:15:13 drh Exp $
           17  +** $Id: util.c,v 1.25 2001/09/16 00:13:27 drh Exp $
    30     18   */
    31     19   #include "sqliteInt.h"
    32     20   #include <stdarg.h>
    33     21   #include <ctype.h>
    34     22   
    35     23   /*
    36     24   ** If malloc() ever fails, this global variable gets set to 1.

Changes to src/vdbe.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** The code in this file implements the Virtual Database Engine (VDBE)
    25     13   **
    26     14   ** The SQL parser generates a program which is then executed by
    27     15   ** the VDBE to do the work of the SQL statement.  VDBE programs are 
    28     16   ** similar in form to assembly language.  The program consists of
................................................................................
    29     17   ** a linear sequence of operations.  Each operation has an opcode 
    30     18   ** and 3 operands.  Operands P1 and P2 are integers.  Operand P3 
    31     19   ** is a null-terminated string.   The P2 operand must be non-negative.
    32     20   ** Opcodes will typically ignore one or more operands.  Many opcodes
    33     21   ** ignore all three operands.
    34     22   **
    35     23   ** Computation results are stored on a stack.  Each entry on the
    36         -** stack is either an integer or a null-terminated string.  An
    37         -** inplicit conversion from one type to the other occurs as necessary.
           24  +** stack is either an integer, a null-terminated string, a floating point
           25  +** number, or the SQL "NULL" value.  An inplicit conversion from one
           26  +** type to the other occurs as necessary.
    38     27   ** 
    39     28   ** Most of the code in this file is taken up by the sqliteVdbeExec()
    40     29   ** function which does the work of interpreting a VDBE program.
    41     30   ** But other routines are also provided to help in building up
    42     31   ** a program instruction by instruction.
    43     32   **
    44         -** $Id: vdbe.c,v 1.69 2001/09/15 14:43:39 drh Exp $
           33  +** $Id: vdbe.c,v 1.70 2001/09/16 00:13:27 drh Exp $
    45     34   */
    46     35   #include "sqliteInt.h"
    47     36   #include <ctype.h>
    48     37   #include <unistd.h>
    49     38   
    50     39   /*
    51     40   ** SQL is translated into a sequence of instructions to be
................................................................................
  1117   1106   case OP_Goto: {
  1118   1107     pc = pOp->p2 - 1;
  1119   1108     break;
  1120   1109   }
  1121   1110   
  1122   1111   /* Opcode:  Halt * * *
  1123   1112   **
  1124         -** Exit immediately.  All open DBs, Lists, Sorts, etc are closed
         1113  +** Exit immediately.  All open cursors, Lists, Sorts, etc are closed
  1125   1114   ** automatically.
         1115  +**
         1116  +** There is an implied Halt instruction inserted at the very end of
         1117  +** every program.  So a jump past the last instruction of the program
         1118  +** is the same as executing Halt.
  1126   1119   */
  1127   1120   case OP_Halt: {
  1128   1121     pc = p->nOp-1;
  1129   1122     break;
  1130   1123   }
  1131   1124   
  1132   1125   /* Opcode: Integer P1 * *
................................................................................
  1181   1174   /* Opcode: Dup P1 * *
  1182   1175   **
  1183   1176   ** A copy of the P1-th element of the stack 
  1184   1177   ** is made and pushed onto the top of the stack.
  1185   1178   ** The top of the stack is element 0.  So the
  1186   1179   ** instruction "Dup 0 0 0" will make a copy of the
  1187   1180   ** top of the stack.
         1181  +**
         1182  +** Also see the Pull instruction.
  1188   1183   */
  1189   1184   case OP_Dup: {
  1190   1185     int i = p->tos - pOp->p1;
  1191   1186     int j = ++p->tos;
  1192   1187     VERIFY( if( i<0 ) goto not_enough_stack; )
  1193   1188     VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; )
  1194   1189     aStack[j] = aStack[i];
................................................................................
  1203   1198   }
  1204   1199   
  1205   1200   /* Opcode: Pull P1 * *
  1206   1201   **
  1207   1202   ** The P1-th element is removed from its current location on 
  1208   1203   ** the stack and pushed back on top of the stack.  The
  1209   1204   ** top of the stack is element 0, so "Pull 0 0 0" is
  1210         -** a no-op.
         1205  +** a no-op.  "Pull 1 0 0" swaps the top two elements of
         1206  +** the stack.
         1207  +**
         1208  +** See also the Dup instruction.
  1211   1209   */
  1212   1210   case OP_Pull: {
  1213   1211     int from = p->tos - pOp->p1;
  1214   1212     int to = p->tos;
  1215   1213     int i;
  1216   1214     Stack ts;
  1217   1215     char *tz;
................................................................................
  1779   1777   ** The lowest entry
  1780   1778   ** on the stack is the first in the concatenation and the top of
  1781   1779   ** the stack is the last.  After all columns are concatenated, an
  1782   1780   ** index header is added.  The index header consists of P1 16-bit integers
  1783   1781   ** which hold the offset of the beginning of each column data from the
  1784   1782   ** beginning of the completed record including the header.
  1785   1783   **
  1786         -** The OP_Column opcode is used to unpack a record manufactured with
         1784  +** The Column opcode is used to unpack a record manufactured with
  1787   1785   ** the opcode.
  1788   1786   */
  1789   1787   case OP_MakeRecord: {
  1790   1788     char *zNewRecord;
  1791   1789     int nByte;
  1792   1790     int nField;
  1793   1791     int i, j;
................................................................................
  1832   1830     zStack[p->tos] = zNewRecord;
  1833   1831     break;
  1834   1832   }
  1835   1833   
  1836   1834   /* Opcode: MakeKey P1 P2 *
  1837   1835   **
  1838   1836   ** Convert the top P1 entries of the stack into a single entry suitable
  1839         -** for use as the key in an index or a sort.  The top P1 records are
  1840         -** converted to strings and merged.  The null-terminator on each string
  1841         -** is retained and used as a separator.  The entire string is also
  1842         -** null-terminated.
         1837  +** for use as the key in an index.  The top P1 records are
         1838  +** converted to strings and merged.  The null-terminators 
         1839  +** are retained and used as separators.
  1843   1840   ** The lowest entry in the stack is the first field and the top of the
  1844   1841   ** stack becomes the last.
  1845   1842   **
  1846   1843   ** If P2 is not zero, then the original entries remain on the stack
  1847   1844   ** and the new key is pushed on top.  If P2 is zero, the original
  1848   1845   ** data is popped off the stack first then the new key is pushed
  1849   1846   ** back in its place.
................................................................................
  1952   1949     break;
  1953   1950   }
  1954   1951   
  1955   1952   /* Opcode: Transaction * * *
  1956   1953   **
  1957   1954   ** Begin a transaction.  The transaction ends when a Commit or Rollback
  1958   1955   ** opcode is encountered or whenever there is an execution error that causes
  1959         -** a script to abort.  
         1956  +** a script to abort.  A transaction is not ended by a Halt.
  1960   1957   **
         1958  +** A write lock is obtained on the database file when a transaction is
         1959  +** started.  No other process can read or write the file while the
         1960  +** transaction is underway.  Starting a transaction also creates a
         1961  +** rollback journal.
  1961   1962   ** A transaction must be started before any changes can be made to the
  1962   1963   ** database.
  1963   1964   */
  1964   1965   case OP_Transaction: {
  1965   1966     rc = sqliteBtreeBeginTrans(pBt);
  1966   1967     break;
  1967   1968   }
  1968   1969   
  1969   1970   /* Opcode: Commit * * *
  1970   1971   **
  1971   1972   ** Cause all modifications to the database that have been made since the
  1972   1973   ** last Transaction to actually take effect.  No additional modifications
  1973         -** are allowed until another transaction is started.
         1974  +** are allowed until another transaction is started.  The Commit instruction
         1975  +** deletes the journal file and releases the write lock on the database.
         1976  +** A read lock continues to be held if there are still cursors open.
  1974   1977   */
  1975   1978   case OP_Commit: {
  1976   1979     rc = sqliteBtreeCommit(pBt);
  1977   1980     if( rc==SQLITE_OK ){
  1978   1981       sqliteCommitInternalChanges(db);
  1979   1982     }else{
  1980   1983       sqliteRollbackInternalChanges(db);
................................................................................
  1984   1987   
  1985   1988   /* Opcode: Rollback * * *
  1986   1989   **
  1987   1990   ** Cause all modifications to the database that have been made since the
  1988   1991   ** last Transaction to be undone. The database is restored to its state
  1989   1992   ** before the Transaction opcode was executed.  No additional modifications
  1990   1993   ** are allowed until another transaction is started.
         1994  +**
         1995  +** This instruction automatically closes all cursors and releases both
         1996  +** the read and write locks on the database.
  1991   1997   */
  1992   1998   case OP_Rollback: {
  1993   1999     rc = sqliteBtreeRollback(pBt);
  1994   2000     sqliteRollbackInternalChanges(db);
  1995   2001     break;
  1996   2002   }
  1997   2003   
  1998   2004   /* Opcode: ReadCookie * * *
  1999   2005   **
  2000         -** Read the magic cookie from the database file and push it onto the
  2001         -** stack.  The magic cookie is an integer that is used like a version
         2006  +** Read the schema cookie from the database file and push it onto the
         2007  +** stack.  The schema cookie is an integer that is used like a version
  2002   2008   ** number for the database schema.  Everytime the schema changes, the
  2003   2009   ** cookie changes to a new random value.  This opcode is used during
  2004   2010   ** initialization to read the initial cookie value so that subsequent
  2005   2011   ** database accesses can verify that the cookie has not changed.
  2006   2012   **
  2007   2013   ** There must be a read-lock on the database (either a transaction
  2008         -** must be started or there must be a prior OP_Open opcode) before
         2014  +** must be started or there must be an open cursor) before
  2009   2015   ** executing this instruction.
  2010   2016   */
  2011   2017   case OP_ReadCookie: {
  2012   2018     int i = ++p->tos;
  2013   2019     int aMeta[SQLITE_N_BTREE_META];
  2014   2020     VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; )
  2015   2021     rc = sqliteBtreeGetMeta(pBt, aMeta);
................................................................................
  2016   2022     aStack[i].i = aMeta[1];
  2017   2023     aStack[i].flags = STK_Int;
  2018   2024     break;
  2019   2025   }
  2020   2026   
  2021   2027   /* Opcode: SetCookie P1 * *
  2022   2028   **
  2023         -** This operation changes the value of the cookie on the database.
         2029  +** This operation changes the value of the schema cookie on the database.
  2024   2030   ** The new value is P1.
  2025   2031   **
  2026         -** The cookie changes its value whenever the database schema changes.
         2032  +** The schema cookie changes its value whenever the database schema changes.
  2027   2033   ** That way, other processes can recognize when the schema has changed
  2028   2034   ** and reread it.
  2029   2035   **
  2030   2036   ** A transaction must be started before executing this opcode.
  2031   2037   */
  2032   2038   case OP_SetCookie: {
  2033   2039     int aMeta[SQLITE_N_BTREE_META];
................................................................................
  2037   2043       rc = sqliteBtreeUpdateMeta(pBt, aMeta);
  2038   2044     }
  2039   2045     break;
  2040   2046   }
  2041   2047   
  2042   2048   /* Opcode: VerifyCookie P1 * *
  2043   2049   **
  2044         -** Check the current value of the database cookie and make sure it is
         2050  +** Check the current value of the schema cookie and make sure it is
  2045   2051   ** equal to P1.  If it is not, abort with an SQLITE_SCHEMA error.
  2046   2052   **
  2047   2053   ** The cookie changes its value whenever the database schema changes.
  2048         -** This operation is used to detech when that the cookie has changed
         2054  +** This operation is used to detect when that the cookie has changed
  2049   2055   ** and that the current process needs to reread the schema.
  2050   2056   **
  2051   2057   ** Either a transaction needs to have been started or an OP_Open needs
  2052   2058   ** to be executed (to establish a read lock) before this opcode is
  2053   2059   ** invoked.
  2054   2060   */
  2055   2061   case OP_VerifyCookie: {
................................................................................
  2066   2072   **
  2067   2073   ** Open a new cursor for the database table whose root page is
  2068   2074   ** P2 in the main database file.  Give the new cursor an identifier
  2069   2075   ** of P1.  The P1 values need not be contiguous but all P1 values
  2070   2076   ** should be small integers.  It is an error for P1 to be negative.
  2071   2077   **
  2072   2078   ** If P2==0 then take the root page number from the top of the stack.
         2079  +**
         2080  +** There will be a read lock on the database whenever there is an
         2081  +** open cursor.  If the database was unlocked prior to this instruction
         2082  +** then a read lock is acquired as part of this instruction.  A read
         2083  +** lock allows other processes to read the database but prohibits
         2084  +** any other process from modifying the database.  The read lock is
         2085  +** released when all cursors are closed.  If this instruction attempts
         2086  +** to get a read lock but fails, the script terminates with an
         2087  +** SQLITE_BUSY error code.
  2073   2088   **
  2074   2089   ** The P3 value is the name of the table or index being opened.
  2075   2090   ** The P3 value is not actually used by this opcode and may be
  2076   2091   ** omitted.  But the code generator usually inserts the index or
  2077   2092   ** table name into P3 to make the code easier to read.
  2078   2093   */
  2079   2094   case OP_Open: {
................................................................................
  2125   2140     }while( busy );
  2126   2141     break;
  2127   2142   }
  2128   2143   
  2129   2144   /* Opcode: OpenTemp P1 * *
  2130   2145   **
  2131   2146   ** Open a new cursor that points to a table in a temporary database
  2132         -** file.  The temporary file is opened read/write event if the main
         2147  +** file.  The temporary file is opened read/write even if the main
  2133   2148   ** database is read-only.  The temporary file is deleted when the
  2134   2149   ** cursor is closed.
  2135   2150   */
  2136   2151   case OP_OpenTemp: {
  2137   2152     int i = pOp->p1;
  2138   2153     Cursor *pCx;
  2139   2154     VERIFY( if( i<0 ) goto bad_instruction; )
................................................................................
  2174   2189   
  2175   2190   /* Opcode: MoveTo P1 * *
  2176   2191   **
  2177   2192   ** Pop the top of the stack and use its value as a key.  Reposition
  2178   2193   ** cursor P1 so that it points to an entry with a matching key.  If
  2179   2194   ** the table contains no record with a matching key, then the cursor
  2180   2195   ** is left pointing at a nearby record.
         2196  +**
         2197  +** See also: Found, NotFound, Distinct
  2181   2198   */
  2182   2199   case OP_MoveTo: {
  2183   2200     int i = pOp->p1;
  2184   2201     int tos = p->tos;
  2185   2202     VERIFY( if( tos<0 ) goto not_enough_stack; )
  2186   2203     if( i>=0 && i<p->nCursor && p->aCsr[i].pCursor ){
  2187   2204       int res;
................................................................................
  2200   2217     POPSTACK;
  2201   2218     break;
  2202   2219   }
  2203   2220   
  2204   2221   /* Opcode: Fcnt * * *
  2205   2222   **
  2206   2223   ** Push an integer onto the stack which is the total number of
  2207         -** OP_Fetch opcodes that have been executed by this virtual machine.
         2224  +** MoveTo opcodes that have been executed by this virtual machine.
  2208   2225   **
  2209   2226   ** This instruction is used to implement the special fcnt() function
  2210   2227   ** in the SQL dialect that SQLite understands.  fcnt() is used for
  2211   2228   ** testing purposes.
  2212   2229   */
  2213   2230   case OP_Fcnt: {
  2214   2231     int i = ++p->tos;
................................................................................
  2216   2233     aStack[i].i = p->nFetch;
  2217   2234     aStack[i].flags = STK_Int;
  2218   2235     break;
  2219   2236   }
  2220   2237   
  2221   2238   /* Opcode: Distinct P1 P2 *
  2222   2239   **
  2223         -** Use the top of the stack as a key.  If a record with that key
  2224         -** does not exist in file P1, then jump to P2.  If the record
         2240  +** Use the top of the stack as a key.  If a record with that key does
         2241  +** not exist in the table of cursor P1, then jump to P2.  If the record
  2225   2242   ** does already exist, then fall thru.  The cursor is left pointing
  2226   2243   ** at the record if it exists. The key is not popped from the stack.
  2227   2244   **
  2228   2245   ** This operation is similar to NotFound except that this operation
  2229   2246   ** does not pop the key from the stack.
         2247  +**
         2248  +** See also: Found, NotFound, MoveTo
  2230   2249   */
  2231   2250   /* Opcode: Found P1 P2 *
  2232   2251   **
  2233   2252   ** Use the top of the stack as a key.  If a record with that key
  2234         -** does exist in file P1, then jump to P2.  If the record
         2253  +** does exist in table of P1, then jump to P2.  If the record
  2235   2254   ** does not exist, then fall thru.  The cursor is left pointing
  2236   2255   ** to the record if it exists.  The key is popped from the stack.
         2256  +**
         2257  +** See also: Distinct, NotFound, MoveTo
  2237   2258   */
  2238   2259   /* Opcode: NotFound P1 P2 *
  2239   2260   **
  2240   2261   ** Use the top of the stack as a key.  If a record with that key
  2241         -** does not exist in file P1, then jump to P2.  If the record
         2262  +** does not exist in table of P1, then jump to P2.  If the record
  2242   2263   ** does exist, then fall thru.  The cursor is left pointing to the
  2243   2264   ** record if it exists.  The key is popped from the stack.
  2244   2265   **
  2245   2266   ** The difference between this operation and Distinct is that
  2246   2267   ** Distinct does not pop the key from the stack.
         2268  +**
         2269  +** See also: Distinct, Found, MoveTo
  2247   2270   */
  2248   2271   case OP_Distinct:
  2249   2272   case OP_NotFound:
  2250   2273   case OP_Found: {
  2251   2274     int i = pOp->p1;
  2252   2275     int tos = p->tos;
  2253   2276     int alreadyExists = 0;
................................................................................
  2274   2297     }
  2275   2298     break;
  2276   2299   }
  2277   2300   
  2278   2301   /* Opcode: NewRecno P1 * *
  2279   2302   **
  2280   2303   ** Get a new integer record number used as the key to a table.
  2281         -** The record number is not previous used by the database file
  2282         -** associated with cursor P1.  The new record number pushed 
         2304  +** The record number is not previously used as a key in the database
         2305  +** table that cursor P1 points to.  The new record number pushed 
  2283   2306   ** onto the stack.
  2284   2307   */
  2285   2308   case OP_NewRecno: {
  2286   2309     int i = pOp->p1;
  2287   2310     int v = 0;
  2288   2311     if( VERIFY( i<0 || i>=p->nCursor || ) p->aCsr[i].pCursor==0 ){
  2289   2312       v = 0;
................................................................................
  2317   2340     aStack[p->tos].flags = STK_Int;
  2318   2341     break;
  2319   2342   }
  2320   2343   
  2321   2344   /* Opcode: Put P1 * *
  2322   2345   **
  2323   2346   ** Write an entry into the database file P1.  A new entry is
  2324         -** created if it doesn't already exist, or the data for an existing
         2347  +** created if it doesn't already exist or the data for an existing
  2325   2348   ** entry is overwritten.  The data is the value on the top of the
  2326   2349   ** stack.  The key is the next value down on the stack.  The stack
  2327   2350   ** is popped twice by this instruction.
  2328   2351   */
  2329   2352   case OP_Put: {
  2330   2353     int tos = p->tos;
  2331   2354     int nos = p->tos-1;
................................................................................
  2352   2375   
  2353   2376   /* Opcode: Delete P1 * *
  2354   2377   **
  2355   2378   ** Delete the record at which the P1 cursor is currently pointing.
  2356   2379   **
  2357   2380   ** The cursor will be left pointing at either the next or the previous
  2358   2381   ** record in the table. If it is left pointing at the next record, then
  2359         -** the next OP_Next will be a no-op.  Hence it is OK to delete a record
  2360         -** from within an OP_Next loop.
         2382  +** the next Next instruction will be a no-op.  Hence it is OK to delete
         2383  +** a record from within an Next loop.
  2361   2384   */
  2362   2385   case OP_Delete: {
  2363   2386     int i = pOp->p1;
  2364   2387     if( VERIFY( i>=0 && i<p->nCursor && ) p->aCsr[i].pCursor!=0 ){
  2365   2388       rc = sqliteBtreeDelete(p->aCsr[i].pCursor);
  2366   2389     }
  2367   2390     break;
  2368   2391   }
  2369   2392   
  2370   2393   /* Opcode: KeyAsData P1 P2 *
  2371   2394   **
  2372   2395   ** Turn the key-as-data mode for cursor P1 either on (if P2==1) or
  2373         -** off (if P2==0).  In key-as-data mode, the OP_Field opcode pulls
         2396  +** off (if P2==0).  In key-as-data mode, the Field opcode pulls
  2374   2397   ** data off of the key rather than the data.  This is useful for
  2375   2398   ** processing compound selects.
  2376   2399   */
  2377   2400   case OP_KeyAsData: {
  2378   2401     int i = pOp->p1;
  2379   2402     if( VERIFY( i>=0 && i<p->nCursor && ) p->aCsr[i].pCursor!=0 ){
  2380   2403       p->aCsr[i].keyAsData = pOp->p2;
................................................................................
  2503   2526       aStack[tos].flags = STK_Int;
  2504   2527     }
  2505   2528     break;
  2506   2529   }
  2507   2530   
  2508   2531   /* Opcode: FullKey P1 * *
  2509   2532   **
  2510         -** Push a string onto the stack which is the full text key associated
  2511         -** with the last Next operation on file P1.  Compare this with the
  2512         -** Key operator which pushs an integer key.
         2533  +** Extract the complete key from the record that cursor P1 is currently
         2534  +** pointing to and push the key onto the stack as a string.
         2535  +**
         2536  +** Compare this opcode to Recno.  The Recno opcode extracts the first
         2537  +** 4 bytes of the key and pushes those bytes onto the stack as an
         2538  +** integer.  This instruction pushes the entire key as a string.
  2513   2539   */
  2514   2540   case OP_FullKey: {
  2515   2541     int i = pOp->p1;
  2516   2542     int tos = ++p->tos;
  2517   2543     BtCursor *pCrsr;
  2518   2544   
  2519   2545     VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; )
................................................................................
  2618   2644     break;
  2619   2645   }
  2620   2646   
  2621   2647   /* Opcode: NextIdx P1 P2 *
  2622   2648   **
  2623   2649   ** The P1 cursor points to an SQL index for which a BeginIdx operation
  2624   2650   ** has been issued.  This operation retrieves the next record from that
  2625         -** cursor and verifies that the key on the record matches the key that
  2626         -** was pulled from the stack by the BeginIdx instruction.  If they do
  2627         -** match, then the last 4 bytes of the key on the record hold a record
         2651  +** cursor and verifies that the key on the record minus the last 4 bytes
         2652  +** matches the key that was pulled from the stack by the BeginIdx instruction.
         2653  +** If they match, then the last 4 bytes of the key on the record hold a record
  2628   2654   ** number and that record number is extracted and pushed on the stack.
  2629   2655   ** If the keys do not match, there is an immediate jump to instruction P2.
  2630   2656   */
  2631   2657   case OP_NextIdx: {
  2632   2658     int i = pOp->p1;
  2633   2659     int tos = ++p->tos;
  2634   2660     Cursor *pCrsr;
................................................................................
  2703   2729     break;
  2704   2730   }
  2705   2731   
  2706   2732   /* Opcode: Destroy P1 * *
  2707   2733   **
  2708   2734   ** Delete an entire database table or index whose root page in the database
  2709   2735   ** file is given by P1.
         2736  +**
         2737  +** See also: Clear
  2710   2738   */
  2711   2739   case OP_Destroy: {
  2712   2740     sqliteBtreeDropTable(pBt, pOp->p1);
  2713   2741     break;
  2714   2742   }
  2715   2743   
  2716   2744   /* Opcode: Clear P1 * *
  2717   2745   **
  2718   2746   ** Delete all contents of the database table or index whose root page
  2719         -** in the database file is given by P1.  But, unlike OP_Destroy, do not
         2747  +** in the database file is given by P1.  But, unlike Destroy, do not
  2720   2748   ** remove the table or index from the database file.
         2749  +**
         2750  +** See also: Destroy
  2721   2751   */
  2722   2752   case OP_Clear: {
  2723   2753     sqliteBtreeClearTable(pBt, pOp->p1);
  2724   2754     break;
  2725   2755   }
  2726   2756   
  2727   2757   /* Opcode: CreateTable * * *
................................................................................
  2731   2761   **
  2732   2762   ** The root page number is also written to a memory location which has
  2733   2763   ** be set up by the parser.  The difference between CreateTable and
  2734   2764   ** CreateIndex is that each writes its root page number into a different
  2735   2765   ** memory location.  This writing of the page number into a memory location
  2736   2766   ** is used by the SQL parser to record the page number in its internal
  2737   2767   ** data structures.
         2768  +**
         2769  +** See also: CreateIndex
  2738   2770   */
  2739   2771   case OP_CreateTable: {
  2740   2772     int i = ++p->tos;
  2741   2773     int pgno;
  2742   2774     VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; )
  2743   2775     if( p->pTableRoot==0 ){
  2744   2776       rc = SQLITE_INTERNAL;
................................................................................
  2750   2782       aStack[i].flags = STK_Int;
  2751   2783       *p->pTableRoot = pgno;
  2752   2784       p->pTableRoot = 0;
  2753   2785     }
  2754   2786     break;
  2755   2787   }
  2756   2788   
  2757         -/* Opcode: CreateIndex * * *
         2789  +/* Opcode: CreateIndex P1 * *
  2758   2790   **
  2759   2791   ** Allocate a new Index in the main database file.  Push the page number
  2760   2792   ** for the root page of the new table onto the stack.
  2761   2793   **
  2762         -** If P1>=0 then open a cursor named P1 on the newly created index.
  2763         -**
  2764   2794   ** The root page number is also written to a memory location which has
  2765   2795   ** be set up by the parser.  The difference between CreateTable and
  2766   2796   ** CreateIndex is that each writes its root page number into a different
  2767   2797   ** memory location.  This writing of the page number into a memory location
  2768   2798   ** is used by the SQL parser to record the page number in its internal
  2769   2799   ** data structures.
         2800  +**
         2801  +** See also: CreateTable
  2770   2802   */
  2771   2803   case OP_CreateIndex: {
  2772   2804     int i = ++p->tos;
  2773   2805     int pgno;
  2774   2806     VERIFY( if( NeedStack(p, p->tos) ) goto no_mem; )
  2775   2807     if( p->pIndexRoot==0 ){
  2776   2808       rc = SQLITE_INTERNAL;
................................................................................
  2786   2818     break;
  2787   2819   }
  2788   2820   
  2789   2821   /* Opcode: Reorganize P1 * *
  2790   2822   **
  2791   2823   ** Compress, optimize, and tidy up table or index whose root page in the
  2792   2824   ** database file is P1.
         2825  +**
         2826  +** In the current implementation, this is a no-op.
  2793   2827   */
  2794   2828   case OP_Reorganize: {
  2795   2829     /* This is currently a no-op */
  2796   2830     break;
  2797   2831   }
  2798   2832   
  2799   2833   /* Opcode: ListOpen P1 * *
  2800   2834   **
  2801   2835   ** Open a "List" structure used for temporary storage of integer 
  2802         -** table keys.  P1
  2803         -** will server as a handle to this list for future
         2836  +** record numbers.  P1 will server as a handle to this list for future
  2804   2837   ** interactions.  If another list with the P1 handle is
  2805   2838   ** already opened, the prior list is closed and a new one opened
  2806   2839   ** in its place.
  2807   2840   */
  2808   2841   case OP_ListOpen: {
  2809   2842     int i = pOp->p1;
  2810   2843     VERIFY( if( i<0 ) goto bad_instruction; )
................................................................................
  3000   3033   ** the string P3.  One character from P3 is prepended to each entry.
  3001   3034   ** The first character of P3 is prepended to the element lowest in
  3002   3035   ** the stack and the last character of P3 is appended to the top of
  3003   3036   ** the stack.  All stack entries are separated by a \000 character
  3004   3037   ** in the result.  The whole key is terminated by two \000 characters
  3005   3038   ** in a row.
  3006   3039   **
  3007         -** See also the MakeKey opcode.
         3040  +** See also the MakeKey and MakeIdxKey opcodes.
  3008   3041   */
  3009   3042   case OP_SortMakeKey: {
  3010   3043     char *zNewKey;
  3011   3044     int nByte;
  3012   3045     int nField;
  3013   3046     int i, j, k;
  3014   3047   
................................................................................
  3213   3246   **
  3214   3247   ** Read a single line of input from the open file (the file opened using
  3215   3248   ** FileOpen).  If we reach end-of-file, jump immediately to P2.  If
  3216   3249   ** we are able to get another line, split the line apart using P3 as
  3217   3250   ** a delimiter.  There should be P1 fields.  If the input line contains
  3218   3251   ** more than P1 fields, ignore the excess.  If the input line contains
  3219   3252   ** fewer than P1 fields, assume the remaining fields contain an
  3220         -** empty string.
         3253  +** empty strings.
  3221   3254   */
  3222   3255   case OP_FileRead: {
  3223   3256     int n, eol, nField, i, c, nDelim;
  3224   3257     char *zDelim, *z;
  3225   3258     if( p->pFile==0 ) goto fileread_jump;
  3226   3259     nField = pOp->p1;
  3227   3260     if( nField<=0 ) goto fileread_jump;
................................................................................
  3297   3330   fileread_jump:
  3298   3331     pc = pOp->p2 - 1;
  3299   3332     break;
  3300   3333   }
  3301   3334   
  3302   3335   /* Opcode: FileColumn P1 * *
  3303   3336   **
  3304         -** Push onto the stack the P1-th field of the most recently read line
         3337  +** Push onto the stack the P1-th column of the most recently read line
  3305   3338   ** from the input file.
  3306   3339   */
  3307   3340   case OP_FileColumn: {
  3308   3341     int i = pOp->p1;
  3309   3342     char *z;
  3310   3343     VERIFY( if( NeedStack(p, p->tos+1) ) goto no_mem; )
  3311   3344     if( VERIFY( i>=0 && i<p->nField && ) p->azField ){

Changes to src/vdbe.h.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** Header file for the Virtual DataBase Engine (VDBE)
    25     13   **
    26     14   ** This header defines the interface to the virtual database engine
    27     15   ** or VDBE.  The VDBE implements an abstract machine that runs a
    28     16   ** simple program to access and modify the underlying database.
    29     17   **
    30         -** $Id: vdbe.h,v 1.22 2001/09/15 00:57:29 drh Exp $
           18  +** $Id: vdbe.h,v 1.23 2001/09/16 00:13:27 drh Exp $
    31     19   */
    32     20   #ifndef _SQLITE_VDBE_H_
    33     21   #define _SQLITE_VDBE_H_
    34     22   #include <stdio.h>
    35     23   
    36     24   /*
    37     25   ** A single VDBE is an opaque structure named "Vdbe".  Only routines

Changes to src/where.c.

     1      1   /*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
            2  +** 2001 September 15
     3      3   **
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
            4  +** The author disclaims copyright to this source code.  In place of
            5  +** a legal notice, here is a blessing:
     8      6   **
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
            7  +**    May you do good and not evil.
            8  +**    May you find forgiveness for yourself and forgive others.
            9  +**    May you share freely, never taking more than you give.
    22     10   **
    23     11   *************************************************************************
    24     12   ** This module contains C code that generates VDBE code used to process
    25     13   ** the WHERE clause of SQL statements.  Also found here are subroutines
    26     14   ** to generate VDBE code to evaluate expressions.
    27     15   **
    28         -** $Id: where.c,v 1.19 2001/09/15 00:57:29 drh Exp $
           16  +** $Id: where.c,v 1.20 2001/09/16 00:13:27 drh Exp $
    29     17   */
    30     18   #include "sqliteInt.h"
    31     19   
    32     20   /*
    33     21   ** The query generator uses an array of instances of this structure to
    34     22   ** help it analyze the subexpressions of the WHERE clause.  Each WHERE
    35     23   ** clause subexpression is separated from the others by an AND operator.

Changes to test/all.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file runs all tests.
    24     12   #
    25         -# $Id: all.test,v 1.9 2001/09/14 16:42:13 drh Exp $
           13  +# $Id: all.test,v 1.10 2001/09/16 00:13:28 drh Exp $
    26     14   
    27     15   set testdir [file dirname $argv0]
    28     16   source $testdir/tester.tcl
    29     17   rename finish_test really_finish_test
    30     18   proc finish_test {} {memleak_check}
    31     19   
    32     20   if {[file exists ./sqlite_test_count]} {
................................................................................
    37     25   
    38     26   # LeakList will hold a list of the number of unfreed mallocs after
    39     27   # each round of the test.  This number should be constant.  If it
    40     28   # grows, it may mean there is a memory leak in the library.
    41     29   #
    42     30   set LeakList {}
    43     31   
           32  +set EXCLUDE {
           33  +  all.test
           34  +  quick.test
           35  +  malloc.test
           36  +}
    44     37   
    45     38   for {set Counter 0} {$Counter<$COUNT && $nErr==0} {incr Counter} {
    46     39     foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
    47         -    if {[file tail $testfile]=="all.test"} continue
    48         -    if {[file tail $testfile]=="malloc.test"} continue
           40  +    set tail [file tail $testfile]
           41  +    if {[lsearch -exact $EXCLUDE $tail]>=0} continue
    49     42       source $testfile
    50     43     }
    51     44     if {[info exists Leak]} {
    52     45       lappend LeakList $Leak
    53     46     }
    54     47   }
    55     48   

Changes to test/btree.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this script is btree database backend
    25     13   #
    26         -# $Id: btree.test,v 1.8 2001/08/20 00:33:58 drh Exp $
           14  +# $Id: btree.test,v 1.9 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   if {[info commands btree_open]!=""} {
    33     21   

Changes to test/btree2.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this script is btree database backend
    25     13   #
    26         -# $Id: btree2.test,v 1.6 2001/09/14 16:42:13 drh Exp $
           14  +# $Id: btree2.test,v 1.7 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   if {[info commands btree_open]!=""} {
    33     21   
................................................................................
   284    272   # Repeat this test sequence on database of various sizes
   285    273   #
   286    274   set testno 2
   287    275   foreach {N L} {
   288    276     10 2
   289    277     50 2
   290    278     200 3
          279  +  2000 5
   291    280   } {
   292         -  # 2000 5
   293    281     puts "**** N=$N L=$L ****"
   294    282     set hash [md5file test2.bt]
   295    283     do_test btree2-$testno.1 [subst -nocommands {
   296    284       set ::c2 [btree_cursor $::b 2]
   297    285       set ::c3 [btree_cursor $::b 3]
   298    286       set ::c4 [btree_cursor $::b 4]
   299    287       set ::c5 [btree_cursor $::b 5]

Changes to test/copy.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the COPY statement.
    25     13   #
    26         -# $Id: copy.test,v 1.5 2000/06/07 01:27:49 drh Exp $
           14  +# $Id: copy.test,v 1.6 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a file of data from which to copy.
    32     20   #
    33     21   set f [open data1.txt w]

Changes to test/delete.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the DELETE FROM statement.
    25     13   #
    26         -# $Id: delete.test,v 1.8 2001/03/20 22:05:00 drh Exp $
           14  +# $Id: delete.test,v 1.9 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Try to delete from a non-existant table.
    32     20   #
    33     21   do_test delete-1.1 {

Changes to test/expr.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing expressions.
    25     13   #
    26         -# $Id: expr.test,v 1.14 2001/04/28 16:52:42 drh Exp $
           14  +# $Id: expr.test,v 1.15 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a table to work with.
    32     20   #
    33     21   execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)}

Changes to test/func.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing built-in functions.
    25     13   #
    26         -# $Id: func.test,v 1.3 2001/04/06 16:13:43 drh Exp $
           14  +# $Id: func.test,v 1.4 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a table to work with.
    32     20   #
    33     21   do_test func-0.0 {

Changes to test/in.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the IN and BETWEEN operator.
    25     13   #
    26         -# $Id: in.test,v 1.4 2001/04/04 11:48:58 drh Exp $
           14  +# $Id: in.test,v 1.5 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Generate the test data we will need for the first squences of tests.
    32     20   #
    33     21   do_test in-1.0 {

Changes to test/index.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the CREATE INDEX statement.
    25     13   #
    26         -# $Id: index.test,v 1.11 2001/09/13 21:53:10 drh Exp $
           14  +# $Id: index.test,v 1.12 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a basic index and verify it is added to sqlite_master
    32     20   #
    33     21   do_test index-1.1 {

Changes to test/insert.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the INSERT statement.
    25     13   #
    26         -# $Id: insert.test,v 1.5 2001/04/04 11:48:58 drh Exp $
           14  +# $Id: insert.test,v 1.6 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Try to insert into a non-existant table.
    32     20   #
    33     21   do_test insert-1.1 {

Changes to test/insert2.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the INSERT statement that takes is
    25     13   # result from a SELECT.
    26     14   #
    27         -# $Id: insert2.test,v 1.3 2001/09/14 03:24:25 drh Exp $
           15  +# $Id: insert2.test,v 1.4 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Create some tables with data that we can select against
    33     21   #
    34     22   do_test insert2-1.0 {

Changes to test/lock.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this script is database locks.
    25     13   #
    26         -# $Id: lock.test,v 1.9 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: lock.test,v 1.10 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   if {0} {
    29     17   
    30     18   set testdir [file dirname $argv0]
    31     19   source $testdir/tester.tcl
    32     20   
    33     21   # Create a largish table

Changes to test/main.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is exercising the code in main.c.
    25     13   #
    26         -# $Id: main.test,v 1.7 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: main.test,v 1.8 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Tests of the sqlite_complete() function.
    32     20   #
    33     21   do_test main-1.1 {

Changes to test/malloc.test.

     1         -# Copyright (c) 2001 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file attempts to check the library in an out-of-memory situation.
    24     12   # When compiled with -DMEMORY_DEBUG=1, the SQLite library accepts a special
    25     13   # command (--malloc-fail=N) which causes the N-th malloc to fail.  This
    26     14   # special feature is used to see what happens in the library if a malloc
    27     15   # were to really fail due to an out-of-memory situation.
    28     16   #
    29         -# $Id: malloc.test,v 1.2 2001/04/12 23:21:59 drh Exp $
           17  +# $Id: malloc.test,v 1.3 2001/09/16 00:13:28 drh Exp $
    30     18   
    31     19   set testdir [file dirname $argv0]
    32     20   source $testdir/tester.tcl
    33     21   
    34     22   # Only run these tests if memory debugging is turned on.
    35     23   #
    36     24   if {[info command sqlite_malloc_fail]==""} {

Changes to test/pager.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this script is page cache subsystem.
    25     13   #
    26         -# $Id: pager.test,v 1.9 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: pager.test,v 1.10 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   if {[info commands pager_open]!=""} {
    33     21   

Changes to test/printf.test.

     1         -# Copyright (c) 2001 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the sqlite_*_printf() interface.
    25     13   #
    26         -# $Id: printf.test,v 1.2 2001/04/11 14:28:43 drh Exp $
           14  +# $Id: printf.test,v 1.3 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   set n 1
    32     20   foreach v {1 2 5 10 99 100 1000000 999999999 0 -1 -2 -5 -10 -99 -100 -9999999} {
    33     21     do_test printf-1.$n.1 [subst {

Added test/quick.test.

            1  +# 2001 September 15
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file runs all tests.
           12  +#
           13  +# $Id: quick.test,v 1.1 2001/09/16 00:13:28 drh Exp $
           14  +
           15  +set testdir [file dirname $argv0]
           16  +source $testdir/tester.tcl
           17  +rename finish_test really_finish_test
           18  +proc finish_test {} {}
           19  +
           20  +set EXCLUDE {
           21  +  all.test
           22  +  quick.test
           23  +  btree2.test
           24  +}
           25  +
           26  +foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
           27  +  set tail [file tail $testfile]
           28  +  if {[lsearch -exact $EXCLUDE $tail]>=0} continue
           29  +  source $testfile
           30  +}
           31  +
           32  +really_finish_test

Changes to test/quote.test.

     1         -# Copyright (c) 2001 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is the ability to specify table and column names
    25     13   # as quoted strings.
    26     14   #
    27         -# $Id: quote.test,v 1.1 2001/07/23 14:33:04 drh Exp $
           15  +# $Id: quote.test,v 1.2 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Create a table with a strange name and with strange column names.
    33     21   #
    34     22   do_test quote-1.0 {

Changes to test/rowid.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the magic ROWID column that is
    25     13   # found on all tables.
    26     14   #
    27         -# $Id: rowid.test,v 1.3 2001/09/15 00:58:01 drh Exp $
           15  +# $Id: rowid.test,v 1.4 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Basic ROWID functionality tests.
    33     21   #
    34     22   do_test rowid-1.1 {

Changes to test/select1.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the SELECT statement.
    25     13   #
    26         -# $Id: select1.test,v 1.9 2001/04/12 23:21:59 drh Exp $
           14  +# $Id: select1.test,v 1.10 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Try to select on a non-existant table.
    32     20   #
    33     21   do_test select1-1.1 {

Changes to test/select2.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the SELECT statement.
    25     13   #
    26         -# $Id: select2.test,v 1.13 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: select2.test,v 1.14 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a table with some data
    32     20   #
    33     21   execsql {CREATE TABLE tbl1(f1 int, f2 int)}

Changes to test/select3.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing aggregate functions and the
    25     13   # GROUP BY and HAVING clauses of SELECT statements.
    26     14   #
    27         -# $Id: select3.test,v 1.2 2000/06/08 15:10:48 drh Exp $
           15  +# $Id: select3.test,v 1.3 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Build some test data
    33     21   #
    34     22   do_test select3-1.0 {

Changes to test/select4.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing UNION, INTERSECT and EXCEPT operators
    25     13   # in SELECT statements.
    26     14   #
    27         -# $Id: select4.test,v 1.3 2000/06/08 15:10:48 drh Exp $
           15  +# $Id: select4.test,v 1.4 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Build some test data
    33     21   #
    34     22   set fd [open data1.txt w]

Changes to test/select5.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing aggregate functions and the
    25     13   # GROUP BY and HAVING clauses of SELECT statements.
    26     14   #
    27         -# $Id: select5.test,v 1.4 2000/06/21 13:59:13 drh Exp $
           15  +# $Id: select5.test,v 1.5 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Build some test data
    33     21   #
    34     22   set fd [open data1.txt w]

Changes to test/sort.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the CREATE TABLE statement.
    25     13   #
    26         -# $Id: sort.test,v 1.2 2001/04/04 11:48:58 drh Exp $
           14  +# $Id: sort.test,v 1.3 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a bunch of data to sort against
    32     20   #
    33     21   do_test sort-1.0 {

Changes to test/subselect.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing SELECT statements that are part of
    25     13   # expressions.
    26     14   #
    27         -# $Id: subselect.test,v 1.3 2000/06/05 21:39:49 drh Exp $
           15  +# $Id: subselect.test,v 1.4 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   # Basic sanity checking.  Try a simple subselect.
    33     21   #
    34     22   do_test subselect-1.1 {

Changes to test/table.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the CREATE TABLE statement.
    25     13   #
    26         -# $Id: table.test,v 1.11 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: table.test,v 1.12 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Create a basic table and verify it is added to sqlite_master
    32     20   #
    33     21   do_test table-1.1 {

Changes to test/tableapi.test.

     1         -# Copyright (c) 2001 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the sqlite_exec_printf() and
    25     13   # sqlite_get_table_printf() APIs.
    26     14   #
    27         -# $Id: tableapi.test,v 1.2 2001/04/11 14:28:43 drh Exp $
           15  +# $Id: tableapi.test,v 1.3 2001/09/16 00:13:28 drh Exp $
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   do_test tableapi-1.0 {
    33     21     set ::dbx [sqlite_open testdb]
    34     22     catch {sqlite_exec_printf $::dbx {DROP TABLE xyz} {}}

Changes to test/tclsqlite.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for TCL interface to the
    24     12   # SQLite library. 
    25     13   #
    26     14   # Actually, all tests are based on the TCL interface, so the main
    27     15   # interface is pretty well tested.  This file contains some addition
    28     16   # tests for fringe issues that the main test suite does not cover.
    29     17   #
    30         -# $Id: tclsqlite.test,v 1.1 2001/04/03 16:53:22 drh Exp $
           18  +# $Id: tclsqlite.test,v 1.2 2001/09/16 00:13:28 drh Exp $
    31     19   
    32     20   set testdir [file dirname $argv0]
    33     21   source $testdir/tester.tcl
    34     22   
    35     23   # Check the error messages generated by tclsqlite
    36     24   #
    37     25   do_test tcl-1.1 {

Changes to test/tester.tcl.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements some common TCL routines used for regression
    24     12   # testing the SQLite library
    25     13   #
    26         -# $Id: tester.tcl,v 1.17 2001/09/14 16:42:13 drh Exp $
           14  +# $Id: tester.tcl,v 1.18 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   # Make sure tclsqlite was compiled correctly.  Abort now with an
    29     17   # error message if not.
    30     18   #
    31     19   if {[sqlite -tcl-uses-utf]} {
    32     20     if {"\u1234"=="u1234"} {
    33     21       puts stderr "***** BUILD PROBLEM *****"

Changes to test/trans.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this script is database locks.
    25     13   #
    26         -# $Id: trans.test,v 1.3 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: trans.test,v 1.4 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   
    29     17   set testdir [file dirname $argv0]
    30     18   source $testdir/tester.tcl
    31     19   
    32     20   if {0} {
    33     21   

Changes to test/update.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the UPDATE statement.
    25     13   #
    26         -# $Id: update.test,v 1.5 2001/02/19 18:24:22 drh Exp $
           14  +# $Id: update.test,v 1.6 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Try to update an non-existent table
    32     20   #
    33     21   do_test update-1.1 {

Changes to test/vacuum.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the VACUUM statement.
    25     13   #
    26         -# $Id: vacuum.test,v 1.5 2001/09/14 03:24:25 drh Exp $
           14  +# $Id: vacuum.test,v 1.6 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   if {0} {
    32     20   
    33     21   # Try to vacuum a non-existant table.

Changes to test/where.test.

     1         -# Copyright (c) 1999, 2000 D. Richard Hipp
            1  +# 2001 September 15
     2      2   #
     3         -# This program is free software; you can redistribute it and/or
     4         -# modify it under the terms of the GNU General Public
     5         -# License as published by the Free Software Foundation; either
     6         -# version 2 of the License, or (at your option) any later version.
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
     7      5   #
     8         -# This program is distributed in the hope that it will be useful,
     9         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    10         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    11         -# General Public License for more details.
    12         -# 
    13         -# You should have received a copy of the GNU General Public
    14         -# License along with this library; if not, write to the
    15         -# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    16         -# Boston, MA  02111-1307, USA.
    17         -#
    18         -# Author contact information:
    19         -#   drh@hwaci.com
    20         -#   http://www.hwaci.com/drh/
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
    21      9   #
    22     10   #***********************************************************************
    23     11   # This file implements regression tests for SQLite library.  The
    24     12   # focus of this file is testing the use of indices in WHERE clases.
    25     13   #
    26         -# $Id: where.test,v 1.2 2001/08/19 18:19:46 drh Exp $
           14  +# $Id: where.test,v 1.3 2001/09/16 00:13:28 drh Exp $
    27     15   
    28     16   set testdir [file dirname $argv0]
    29     17   source $testdir/tester.tcl
    30     18   
    31     19   # Build some test data
    32     20   #
    33     21   do_test where-1.0 {

Changes to tool/lemon.c.

     1      1   /*
     2         -** Copyright (c) 1991, 1994, 1997, 1998 D. Richard Hipp
     3         -**
     4      2   ** This file contains all sources (including headers) to the LEMON
     5      3   ** LALR(1) parser generator.  The sources have been combined into a
     6      4   ** single file to make it easy to include LEMON in the source tree
     7      5   ** and Makefile of another program.
     8      6   **
     9         -** This program is free software; you can redistribute it and/or
    10         -** modify it under the terms of the GNU General Public
    11         -** License as published by the Free Software Foundation; either
    12         -** version 2 of the License, or (at your option) any later version.
    13         -**
    14         -** This program is distributed in the hope that it will be useful,
    15         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    16         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    17         -** General Public License for more details.
    18         -** 
    19         -** You should have received a copy of the GNU General Public
    20         -** License along with this library; if not, write to the
    21         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    22         -** Boston, MA  02111-1307, USA.
    23         -**
    24         -** Author contact information:
    25         -**   drh@acm.org
    26         -**   http://www.hwaci.com/drh/
            7  +** The author of this program disclaims copyright.
    27      8   */
    28      9   #include <stdio.h>
    29     10   #include <varargs.h>
    30     11   #include <string.h>
    31     12   #include <ctype.h>
    32     13   
    33     14   extern void qsort();
................................................................................
  1194   1175       {OPT_FLAG,0,0,0}
  1195   1176     };
  1196   1177     int i;
  1197   1178     struct lemon lem;
  1198   1179   
  1199   1180     OptInit(argv,options,stderr);
  1200   1181     if( version ){
  1201         -     printf("Lemon version 1.0\n"
  1202         -       "Copyright 1991-1997 by D. Richard Hipp\n"
  1203         -       "Freely distributable under the GNU Public License.\n"
  1204         -     );
         1182  +     printf("Lemon version 1.0\n");
  1205   1183        exit(0); 
  1206   1184     }
  1207   1185     if( OptNArgs()!=1 ){
  1208   1186       fprintf(stderr,"Exactly one filename argument is required.\n");
  1209   1187       exit(1);
  1210   1188     }
  1211   1189     lem.errorcnt = 0;

Changes to tool/lempar.c.

     1      1   /* Driver template for the LEMON parser generator.
     2         -** Copyright 1991-1995 by D. Richard Hipp.
     3         -**
     4         -** This library is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU Library General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
     8         -** 
     9         -** This library is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** Library General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU Library General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Modified 1997 to make it suitable for use with makeheaders.
            2  +** The author disclaims copyright to this source code.
    20      3   */
    21      4   /* First off, code is include which follows the "include" declaration
    22      5   ** in the input file. */
    23      6   #include <stdio.h>
    24      7   %%
    25      8   /* Next is all token values, in a form suitable for use by makeheaders.
    26      9   ** This section will be null unless lemon is run with the -m switch.

Changes to www/arch.fig.

     1      1   #FIG 3.2
     2         -Landscape
            2  +Portrait
     3      3   Center
     4      4   Inches
     5      5   Letter  
     6      6   100.00
     7      7   Single
     8      8   -2
     9      9   1200 2
    10     10   2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
    11         -	 2550 2250 4875 2250 4875 3525 2550 3525 2550 2250
           11  +	 2550 450 4875 450 4875 1275 2550 1275 2550 450
           12  +2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
           13  +	1 1 3.00 75.00 135.00
           14  +	 3675 8550 3675 9075
           15  +2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
           16  +	 2550 9075 4875 9075 4875 9900 2550 9900 2550 9075
           17  +2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
           18  +	1 1 3.00 75.00 135.00
           19  +	 3675 7200 3675 7725
    12     20   2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
    13         -	 2550 4050 4875 4050 4875 5325 2550 5325 2550 4050
           21  +	 2550 7725 4875 7725 4875 8550 2550 8550 2550 7725
           22  +2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
           23  +	1 1 3.00 75.00 135.00
           24  +	 3675 5775 3675 6300
    14     25   2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
    15         -	 2550 5850 4875 5850 4875 7125 2550 7125 2550 5850
           26  +	 2550 6300 4875 6300 4875 7200 2550 7200 2550 6300
    16     27   2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
    17         -	 2550 7650 4875 7650 4875 8925 2550 8925 2550 7650
    18         -2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
    19         -	 2550 450 4875 450 4875 1725 2550 1725 2550 450
    20         -2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
    21         -	 2550 9450 4875 9450 4875 10725 2550 10725 2550 9450
           28  +	 2550 4500 4875 4500 4875 5775 2550 5775 2550 4500
           29  +2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
           30  +	1 1 3.00 75.00 135.00
           31  +	 3675 3975 3675 4500
    22     32   2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    23     33   	1 1 3.00 75.00 135.00
    24         -	 3675 1725 3675 2250
    25         -2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    26         -	1 1 3.00 75.00 135.00
    27         -	 3675 3525 3675 4050
    28         -2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    29         -	1 1 3.00 75.00 135.00
    30         -	 3675 5325 3675 5850
           34  +	 3675 2625 3675 3150
           35  +2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
           36  +	 2550 3150 4875 3150 4875 3975 2550 3975 2550 3150
    31     37   2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    32     38   	1 1 3.00 75.00 135.00
    33         -	 3675 7125 3675 7650
    34         -2 1 0 3 0 7 100 0 -1 0.000 0 0 -1 1 0 2
    35         -	1 1 3.00 75.00 135.00
    36         -	 3675 8925 3675 9450
    37         -4 1 0 100 0 0 20 0.0000 4 195 1920 3675 8025 Virtual Machine\001
    38         -4 1 0 100 0 0 20 0.0000 4 195 1830 3675 6225 Code Generator\001
    39         -4 1 0 100 0 0 20 0.0000 4 195 735 3675 4350 Parser\001
    40         -4 1 0 100 0 0 20 0.0000 4 195 1140 3675 2550 Tokenizer\001
           39  +	 3675 1275 3675 1800
           40  +2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
           41  +	 2550 1800 4875 1800 4875 2625 2550 2625 2550 1800
    41     42   4 1 0 100 0 0 20 0.0000 4 195 1020 3675 750 Interface\001
    42         -4 1 0 100 0 0 20 0.0000 4 195 990 3675 9825 Backend\001
    43         -4 1 0 100 0 0 14 0.0000 4 195 1860 3675 6525 build.c delete.c expr.c\001
    44         -4 1 0 100 0 0 14 0.0000 4 195 2115 3675 6750 insert.c select.c update.c\001
    45         -4 1 0 100 0 0 14 0.0000 4 150 705 3675 6975 where.c\001
    46         -4 1 0 100 0 0 14 0.0000 4 150 630 3675 5175 parse.y\001
    47         -4 1 0 100 0 0 14 0.0000 4 150 870 3675 3375 tokenize.c\001
    48         -4 1 0 100 0 0 14 0.0000 4 150 570 3675 8775 vdbe.c\001
    49         -4 1 0 100 0 0 14 0.0000 4 150 570 3675 10500 dbbe.c\001
    50         -4 1 0 100 0 0 14 0.0000 4 195 2040 3675 1575 main.c table.c tclsqlite.c\001
           43  +4 1 0 100 0 0 14 0.0000 4 195 2040 3675 1125 main.c table.c tclsqlite.c\001
           44  +4 1 0 100 0 0 20 0.0000 4 195 1920 3675 6675 Virtual Machine\001
           45  +4 1 0 100 0 0 14 0.0000 4 150 570 3675 7050 vdbe.c\001
           46  +4 1 0 100 0 0 20 0.0000 4 195 1830 3675 4875 Code Generator\001
           47  +4 1 0 100 0 0 14 0.0000 4 195 1860 3675 5175 build.c delete.c expr.c\001
           48  +4 1 0 100 0 0 14 0.0000 4 195 2115 3675 5400 insert.c select.c update.c\001
           49  +4 1 0 100 0 0 14 0.0000 4 150 705 3675 5625 where.c\001
           50  +4 1 0 100 0 0 20 0.0000 4 195 735 3675 3450 Parser\001
           51  +4 1 0 100 0 0 20 0.0000 4 195 1140 3675 2100 Tokenizer\001
           52  +4 1 0 100 0 0 14 0.0000 4 150 870 3675 2475 tokenize.c\001
           53  +4 1 0 100 0 0 20 0.0000 4 255 1350 3675 9375 Page Cache\001
           54  +4 1 0 100 0 0 14 0.0000 4 150 630 3675 3825 parse.y\001
           55  +4 1 0 100 0 0 14 0.0000 4 150 600 3675 8400 btree.c\001
           56  +4 1 0 100 0 0 14 0.0000 4 150 645 3675 9750 pager.c\001
           57  +4 1 0 100 0 0 20 0.0000 4 195 1620 3675 8025 B-tree Driver\001

Changes to www/arch.png.

cannot compute difference between binary files

Changes to www/arch.tcl.

     1      1   #
     2      2   # Run this Tcl script to generate the sqlite.html file.
     3      3   #
     4         -set rcsid {$Id: arch.tcl,v 1.3 2000/09/29 13:30:55 drh Exp $}
            4  +set rcsid {$Id: arch.tcl,v 1.4 2001/09/16 00:13:29 drh Exp $}
     5      5   
     6      6   puts {<html>
     7      7   <head>
     8      8     <title>Architecture of SQLite</title>
     9      9   </head>
    10     10   <body bgcolor=white>
    11     11   <h1 align=center>
................................................................................
   108    108   up to three additional operands.</p>
   109    109   
   110    110   <p>The virtual machine is entirely contained in a single
   111    111   source file <b>vdbe.c</b>.  The virtual machine also has
   112    112   its own header file <b>vdbe.h</b> that defines an interface
   113    113   between the virtual machine and the rest of the SQLite library.</p>
   114    114   
   115         -<h2>Backend</h2>
          115  +<h2>B-tree Driver</h2>
          116  +
          117  +<p>An SQLite database is maintained on disk using a B-tree implementation
          118  +found in the <b>btree.c</b> source file.  A separate B-tree is used for
          119  +each table and index in the database but all B-trees are stored in the
          120  +same disk file.  Each page of a B-tree is 1024 bytes in size.  The data
          121  +is stored with the key in an area called "payload".  Up to 236 bytes of
          122  +payload can be stored with each B-tree entry.  Any additional payload
          123  +is stored in a chain of overflow pages.</p>
   116    124   
   117         -<p>The last layer in the design of SQLite is the backend.  The
   118         -backend implements an interface between the virtual machine and
   119         -the underlying data file library -- GDBM in this case.  The interface
   120         -is designed to make it easy to substitute a different database
   121         -library, such as the Berkeley DB.  
   122         -The backend abstracts many of the low-level details to help
   123         -reduce the complexity of the virtual machine.</p>
          125  +<h2>Page Cache</h2>
   124    126   
   125         -<p>The backend is contained in the single source file <b>dbbe.c</b>.
   126         -The backend also has a header file <b>dbbe.h</b> that defines the
   127         -interface between the backend and the rest of the SQLite library.</p>
          127  +<p>The page cache provides the rollback and atomic commit abstraction
          128  +and takes care of reader/writer locking of the database file.  The
          129  +B-tree driver requests particular pages from the page cache and notifies
          130  +the page cache when it wants to modify pages and commit or rollback its
          131  +changes and the page cache handles all the messy details of making sure
          132  +the requests are handled quickly, safely, and efficiently.</p>
   128    133   }
   129    134   
   130    135   puts {
   131    136   <br clear="both" />
   132    137   <p><hr /></p>
   133    138   <p><a href="index.html"><img src="/goback.jpg" border=0 />
   134    139   Back to the SQLite Home Page</a>
   135    140   </p>
   136    141   
   137    142   </body></html>}

Changes to www/changes.tcl.

    12     12   }
    13     13   
    14     14   
    15     15   proc chng {date desc} {
    16     16     puts "<DT><B>$date</B></DT>"
    17     17     puts "<DD><P><UL>$desc</UL></P></DD>"
    18     18   }
           19  +
           20  +chng {2001 Sep 15 (2.0.0)} {
           21  +<li>Initial release of version 2.0.  The idea of renaming the library
           22  +    to "SQLus" was abandoned in favor of keeping the "SQLite" name and
           23  +    bumping the major version number.</li>
           24  +<li>The pager and btree subsystems added back. They are now the only
           25  +    available backend.</li>
           26  +<li>The Dbbe abstraction and the GDBM and memory drivers were removed.</li>
           27  +<li>Copyright on all code was disclaimed.  The library is now in the
           28  +    public domain.</li>
           29  +}
    19     30   
    20     31   chng {2001 Jul 23 (1.0.32)} {
    21     32   <li>Pager and btree subsystems removed.  These will be used in a follow-on
    22     33       SQL server library named "SQLus".</li>
    23     34   <li>Add the ability to use quoted strings as table and column names in
    24     35       expressions.</li>
    25     36   }

Changes to www/index.tcl.

     1      1   #
     2      2   # Run this TCL script to generate HTML for the index.html file.
     3      3   #
     4         -set rcsid {$Id: index.tcl,v 1.37 2001/05/21 13:45:10 drh Exp $}
            4  +set rcsid {$Id: index.tcl,v 1.38 2001/09/16 00:13:29 drh Exp $}
     5      5   
     6      6   puts {<html>
     7      7   <head><title>SQLite: An SQL Database Library Built Atop GDBM</title></head>
     8      8   <body bgcolor=white>
     9      9   <h1 align=center>SQLite: An SQL Database Library Built Atop
    10     10   <a href="http://www.gnu.org/software/gdbm/gdbm.html">GDBM</a></h1>
    11     11   <p align=center>}
................................................................................
    13     13   set vers [lindex $argv 0]
    14     14   puts "The latest SQLite version is <b>$vers</b>"
    15     15   puts " created on [exec cat last_change] GMT"
    16     16   puts {</p>}
    17     17   
    18     18   puts {<h2>Introduction</h2>
    19     19   
    20         -<p>SQLite is an SQL database library
    21         -(<a href="c_interface.html">libsqlite.a</a>) that uses
    22         -<a href="http://www.gnu.org/software/gdbm/gdbm.html">GDBM</a>
    23         -as its underlying file storage mechanism.
    24         -Programs that link the SQLite library can have SQL database
           20  +<p>SQLite is a C library that implements an SQL database engine.
           21  +Programs that link with the SQLite library can have SQL database
    25     22   access without running a separate RDBMS process.
    26     23   The distribution comes with a standalone command-line
    27     24   access program (<a href="sqlite.html">sqlite</a>) that can
    28     25   be used to administer an SQLite database and which serves as
    29     26   an example of how to use the SQLite library.</p>
    30     27   
    31     28   
    32     29   <h2>Features</h2>
    33     30   
    34     31   <p><ul>
    35         -<li>Implements most of SQL92.</li>
    36         -<li>A database is just a directory of GDBM files.</li>
    37         -<li>Unlimited length records.</li>
    38         -<li>Import and export data from 
    39         -<a href="http://www.postgresql.org/">PostgreSQL</a>.</li>
           32  +<li>Implements a large subset of SQL92.</li>
           33  +<li>A complete SQL database (with multiple tables and indices) is
           34  +    stored in a single disk file.</li>
           35  +<li>Atomic commit and rollback protect data integrity.</li>
           36  +<li>Small memory footprint: about 12000 lines of C code.</li>
    40     37   <li>Very simple 
    41     38   <a href="c_interface.html">C/C++ interface</a> requires the use of only
    42     39   three functions and one opaque structure.</li>
    43         -<li>A <a href="tclsqlite.html">Tcl</a> interface is
    44         -included.</li>
    45         -<li>Command-line access program <a href="sqlite.html">sqlite</a> uses
    46         -the <a href="http://www.google.com/search?q=gnu+readline+library">GNU
    47         -Readline library</a></li>
    48         -<li>A Tcl-based test suite provides near 100% code coverage</li>
    49         -<li>Approximately 9500 lines of C code.  No external dependencies other 
    50         -than GDBM.</li>
           40  +<li>A TCL interface to the library is included.</li>
           41  +<li>A TCL-based test suite provides near 100% code coverage.</li>
           42  +<li>Self-contained: no external dependencies.</li>
    51     43   <li>Built and tested under Linux, HPUX, and WinNT.</li>
    52     44   </ul>
    53     45   </p>
    54     46   
    55     47   <h2>Current Status</h2>
    56     48   
    57     49   <p>A <a href="changes.html">change history</a> is available online.
................................................................................
    69     61     But it only ignores case for 7-bit Latin characters.
    70     62     The case of 8-bit iso8859 characters or UTF-8 characters is
    71     63     signification.  Hence, <b>'a'&nbsp;LIKE&nbsp;'A'</b> returns
    72     64     TRUE but <b>'&aelig;'&nbsp;LIKE&nbsp;'&AElig;'</b> returns FALSE.
    73     65   </p></li>
    74     66   </ul>
    75     67   
    76         -<p><b>Important Note:</b>  Serious bugs have been found in versions
    77         -1.0.22 on Unix and 1.0.26 on Windows.  Users of these or earlier
    78         -versions of SQLite should upgrade.</p>
    79         -
    80     68   <h2>Documentation</h2>
    81     69   
    82     70   <p>The following documentation is currently available:</p>
    83     71   
    84     72   <p><ul>
    85     73   <li>Information on the <a href="sqlite.html">sqlite</a>
    86     74       command-line utility.</li>