gss.texi
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:55k
- input texinfo
- @ifinfo
- @c The edition number appears in several places in this file
- This corresponds to the first edition of the @cite{GNU SQL Server Manual},
- for GNU SQL Server version 0.7.
- @c Please REMEMBER to update edition number in *three* places in this file.
- Copyright (C) 1996 Free Software Foundation, Inc.
- Permission is granted to make and distribute verbatim copies of
- this manual provided the copyright notice and this permission notice
- are preserved on all copies.
- @ignore
- Permission is granted to process this file through TeX and print the
- results, provided the printed document carries copying permission
- notice identical to this one except for the removal of this paragraph
- (this paragraph not being relevant to the printed manual).
- @end ignore
- Permission is granted to copy and distribute modified versions of this
- manual under the conditions for verbatim copying, provided also that the
- sections entitled ``The GNU Manifesto'', ``Distribution'' and ``GNU
- General Public License'' are included exactly as in the original, and
- provided that the entire resulting derived work is distributed under the
- terms of a permission notice identical to this one.
- Permission is granted to copy and distribute translations of this manual
- into another language, under the above conditions for modified versions,
- except that the sections entitled ``The GNU Manifesto'',
- ``Distribution'' and ``GNU General Public License'' may be included in a
- translation approved by the Free Software Foundation instead of in the
- original English.
- @end ifinfo
- @c
- @c comment out this line if you do NOT want to have an indication that
- @c an index entry appears in the texinfo file near this line of text.
- @c this line should definitely be commented out for printing a master
- @c and for making the version to go on the floppy disk.
- @c
- @c @include /gd/gnu/doc/margins-comment-format.texi
- @c
- @setchapternewpage odd
- @settitle GNU SQL Server Manual
- @setfilename gss
- @synindex pg cp
- @c
- @c in general, keep the following line commented out, unless doing a
- @c copy of this manual that will be published. the manual should go
- @c onto the distribution in the full, 8.5 x 11" size.
- @c
- @smallbook
- @c
- @iftex
- @shorttitlepage GNU SQL Server Manual
- @end iftex
- @titlepage
- @sp 6
- @center @titlefont{GNU SQL Server Manual}
- @sp 4
- @center Preliminary Edition, Created for GNU SQL Server Version 0.7
- @sp 5
- @center Michael Kimelman
- @page
- @vskip 0pt plus 1filll
- Copyright @copyright{} 1996 Free Software Foundation Inc.
- @sp 2
- Preliminary Edition @*
- Created for GNU SQL Server Version 0.7, @*
- October 1996
- @sp 1
- Permission is granted to make and distribute verbatim copies of
- this manual provided the copyright notice and this permission notice
- are preserved on all copies.
- Permission is granted to copy and distribute modified versions of this
- manual under the conditions for verbatim copying, provided also that the
- sections entitled ``The GNU Manifesto'', ``Distribution'' and ``GNU
- General Public License'' are included exactly as in the original, and
- provided that the entire resulting derived work is distributed under the
- terms of a permission notice identical to this one.
- Permission is granted to copy and distribute translations of this manual
- into another language, under the above conditions for modified versions,
- except that the sections entitled ``The GNU Manifesto'',
- ``Distribution'' and ``GNU General Public License'' may be included in a
- translation approved by the Free Software Foundation instead of in the
- original English.
- @sp 2
- @end titlepage
- @page
- @ifinfo
- @node Top, Distrib, (dir), (dir)
- @top The GNU SQL Server
- GNU SQL Server is a relational database system. This Info file describes
- how to use and program a database with the GNU SQL Server. It corresponds
- to GNU SQL Server version 0.7
- @end ifinfo
- @ignore
- @end ignore
- @menu
- Common questions
- * Distrib:: How to get the latest GNU SQL Server distribution.
- * Copying:: The GNU General Public License gives you permission
- to redistribute GNU SQL Server on certain terms;
- it also explains that there is no warranty.
- * Manifesto:: What's GNU? Gnu's Not Unix!
- * Acknowledgments:: Major contributors to GNU SQL Server.
- SQL server topics
- * Intro:: An introduction to current revision
- * Architecture:: Overview of server architecture
- * Dialect:: Dialect notes
- * Server:: Running Server
- * Client:: Compiling and running DB applications
- * Bugs:: How and when to report a bug.
- * Key Index::
- * Command Index::
- * Variable Index::
- * Concept Index::
- Reporting Bugs
- * Criteria: Bug Criteria. Have you really found a bug?
- * Understanding Bug Reporting:: How to report a bug effectively.
- * Checklist:: Steps to follow for a good bug report.
- * Sending Patches:: How to send a patch for GNU SQL Server.
- @end menu
- @iftex
- @unnumbered Preface
- This manual documents the use and programming with the GNU SQL server.
- The reader is not expected to be familiar with other public domain or
- commercial systems but some knowledge of C, SQL and database theory are
- expected. [<<-- list the references that would enable the reader to
- obtain this knowledge. ]
- This manual is available as an Info file. The Info file is for
- on-line perusal with the GNU Info program, which will be the principal
- way of viewing documentation on-line in the GNU system.
- This edition of the manual is intended for use with the GNU SQL Server
- installed on GNU and Unix systems.
- @end iftex
- @node Distrib, Copying, Top, Top
- @unnumbered Distribution
- GNU SQL Server is @dfn{free software}; this means that everyone is free to
- use it and free to redistribute it on certain conditions. GNU SQL Server is
- not in the public domain; it is copyrighted and there are restrictions
- on its distribution, but these restrictions are designed to permit
- everything that a good cooperating citizen would want to do. What is
- not allowed is to try to prevent others from further sharing any version
- of GNU SQL Server that they might get from you. The precise conditions are
- found in the GNU General Public License that comes with GNU SQL Server and also
- appears following this section.
- One way to get a copy of GNU SQL Server is from someone else who has it. You
- need not ask for our permission to do so, or tell any one else; just
- copy it. If you have access to the Internet, you can get the latest
- distribution version of GNU SQL Server by anonymous FTP; see the file
- @file{etc/FTP} in the GNU SQL Server distribution for more information.
- You may also receive GNU SQL Server when you buy a computer. Computer
- manufacturers are free to distribute copies on the same terms that apply to
- everyone else. These terms require them to give you the full sources,
- including whatever changes they may have made, and to permit you to
- redistribute the GNU SQL Server received from them under the usual terms of the
- General Public License. In other words, the program must be free for you
- when you get it, not just free for the manufacturer.
- @display
- Free Software Foundation
- 59 Temple Place, Suite 330
- Boston, MA 02111-1307 USA
- USA
- @end display
- The income from distribution fees goes to support the foundation's
- purpose: the development of new free software, and improvements to our
- existing programs including GNU SQL Server.
- If you find GNU SQL Server useful, please @strong{send a donation} to the
- Free Software Foundation to support our work. Donations to the Free
- Software Foundation are tax deductible. If you use GNU SQL Server at your
- workplace, suggest that the company make a donation. If company policy
- is unsympathetic to the idea of donating to charity, you might instead
- suggest ordering a CD-ROM from the Foundation occasionally, or
- subscribing to periodic updates.
- @iftex
- Contributors to GNU SQL Server include Sergei Kuznetsov,
- Michael Kimelman, Vera Ponomarenko, Konstantin Dyshlevoy,
- Andrey Yachin, Eugene Voinov.
- @end iftex
- @node Copying, Manifesto, Distrib, Top
- @unnumbered GNU GENERAL PUBLIC LICENSE
- @center Version 2, June 1991
- @display
- Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
- @end display
- @unnumberedsec Preamble
- The licenses for most software are designed to take away your
- freedom to share and change it. By contrast, the GNU General Public
- License is intended to guarantee your freedom to share and change free
- software---to make sure the software is free for all its users. This
- General Public License applies to most of the Free Software
- Foundation's software and to any other program whose authors commit to
- using it. (Some other Free Software Foundation software is covered by
- the GNU Library General Public License instead.) You can apply it to
- your programs, too.
- When we speak of free software, we are referring to freedom, not
- price. Our General Public Licenses are designed to make sure that you
- have the freedom to distribute copies of free software (and charge for
- this service if you wish), that you receive source code or can get it
- if you want it, that you can change the software or use pieces of it
- in new free programs; and that you know you can do these things.
- To protect your rights, we need to make restrictions that forbid
- anyone to deny you these rights or to ask you to surrender the rights.
- These restrictions translate to certain responsibilities for you if you
- distribute copies of the software, or if you modify it.
- For example, if you distribute copies of such a program, whether
- gratis or for a fee, you must give the recipients all the rights that
- you have. You must make sure that they, too, receive or can get the
- source code. And you must show them these terms so they know their
- rights.
- We protect your rights with two steps: (1) copyright the software, and
- (2) offer you this license which gives you legal permission to copy,
- distribute and/or modify the software.
- Also, for each author's protection and ours, we want to make certain
- that everyone understands that there is no warranty for this free
- software. If the software is modified by someone else and passed on, we
- want its recipients to know that what they have is not the original, so
- that any problems introduced by others will not reflect on the original
- authors' reputations.
- Finally, any free program is threatened constantly by software
- patents. We wish to avoid the danger that redistributors of a free
- program will individually obtain patent licenses, in effect making the
- program proprietary. To prevent this, we have made it clear that any
- patent must be licensed for everyone's free use or not licensed at all.
- The precise terms and conditions for copying, distribution and
- modification follow.
- @iftex
- @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- @end iftex
- @ifinfo
- @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- @end ifinfo
- @enumerate 0
- @item
- This License applies to any program or other work which contains
- a notice placed by the copyright holder saying it may be distributed
- under the terms of this General Public License. The ``Program'', below,
- refers to any such program or work, and a ``work based on the Program''
- means either the Program or any derivative work under copyright law:
- that is to say, a work containing the Program or a portion of it,
- either verbatim or with modifications and/or translated into another
- language. (Hereinafter, translation is included without limitation in
- the term ``modification''.) Each licensee is addressed as ``you''.
- Activities other than copying, distribution and modification are not
- covered by this License; they are outside its scope. The act of
- running the Program is not restricted, and the output from the Program
- is covered only if its contents constitute a work based on the
- Program (independent of having been made by running the Program).
- Whether that is true depends on what the Program does.
- @item
- You may copy and distribute verbatim copies of the Program's
- source code as you receive it, in any medium, provided that you
- conspicuously and appropriately publish on each copy an appropriate
- copyright notice and disclaimer of warranty; keep intact all the
- notices that refer to this License and to the absence of any warranty;
- and give any other recipients of the Program a copy of this License
- along with the Program.
- You may charge a fee for the physical act of transferring a copy, and
- you may at your option offer warranty protection in exchange for a fee.
- @item
- You may modify your copy or copies of the Program or any portion
- of it, thus forming a work based on the Program, and copy and
- distribute such modifications or work under the terms of Section 1
- above, provided that you also meet all of these conditions:
- @enumerate a
- @item
- You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
- @item
- You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
- @item
- If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
- @end enumerate
- These requirements apply to the modified work as a whole. If
- identifiable sections of that work are not derived from the Program,
- and can be reasonably considered independent and separate works in
- themselves, then this License, and its terms, do not apply to those
- sections when you distribute them as separate works. But when you
- distribute the same sections as part of a whole which is a work based
- on the Program, the distribution of the whole must be on the terms of
- this License, whose permissions for other licensees extend to the
- entire whole, and thus to each and every part regardless of who wrote it.
- Thus, it is not the intent of this section to claim rights or contest
- your rights to work written entirely by you; rather, the intent is to
- exercise the right to control the distribution of derivative or
- collective works based on the Program.
- In addition, mere aggregation of another work not based on the Program
- with the Program (or with a work based on the Program) on a volume of
- a storage or distribution medium does not bring the other work under
- the scope of this License.
- @item
- You may copy and distribute the Program (or a work based on it,
- under Section 2) in object code or executable form under the terms of
- Sections 1 and 2 above provided that you also do one of the following:
- @enumerate a
- @item
- Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
- @item
- Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
- @item
- Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
- @end enumerate
- The source code for a work means the preferred form of the work for
- making modifications to it. For an executable work, complete source
- code means all the source code for all modules it contains, plus any
- associated interface definition files, plus the scripts used to
- control compilation and installation of the executable. However, as a
- special exception, the source code distributed need not include
- anything that is normally distributed (in either source or binary
- form) with the major components (compiler, kernel, and so on) of the
- operating system on which the executable runs, unless that component
- itself accompanies the executable.
- If distribution of executable or object code is made by offering
- access to copy from a designated place, then offering equivalent
- access to copy the source code from the same place counts as
- distribution of the source code, even though third parties are not
- compelled to copy the source along with the object code.
- @item
- You may not copy, modify, sublicense, or distribute the Program
- except as expressly provided under this License. Any attempt
- otherwise to copy, modify, sublicense or distribute the Program is
- void, and will automatically terminate your rights under this License.
- However, parties who have received copies, or rights, from you under
- this License will not have their licenses terminated so long as such
- parties remain in full compliance.
- @item
- You are not required to accept this License, since you have not
- signed it. However, nothing else grants you permission to modify or
- distribute the Program or its derivative works. These actions are
- prohibited by law if you do not accept this License. Therefore, by
- modifying or distributing the Program (or any work based on the
- Program), you indicate your acceptance of this License to do so, and
- all its terms and conditions for copying, distributing or modifying
- the Program or works based on it.
- @item
- Each time you redistribute the Program (or any work based on the
- Program), the recipient automatically receives a license from the
- original licensor to copy, distribute or modify the Program subject to
- these terms and conditions. You may not impose any further
- restrictions on the recipients' exercise of the rights granted herein.
- You are not responsible for enforcing compliance by third parties to
- this License.
- @item
- If, as a consequence of a court judgment or allegation of patent
- infringement or for any other reason (not limited to patent issues),
- conditions are imposed on you (whether by court order, agreement or
- otherwise) that contradict the conditions of this License, they do not
- excuse you from the conditions of this License. If you cannot
- distribute so as to satisfy simultaneously your obligations under this
- License and any other pertinent obligations, then as a consequence you
- may not distribute the Program at all. For example, if a patent
- license would not permit royalty-free redistribution of the Program by
- all those who receive copies directly or indirectly through you, then
- the only way you could satisfy both it and this License would be to
- refrain entirely from distribution of the Program.
- If any portion of this section is held invalid or unenforceable under
- any particular circumstance, the balance of the section is intended to
- apply and the section as a whole is intended to apply in other
- circumstances.
- It is not the purpose of this section to induce you to infringe any
- patents or other property right claims or to contest validity of any
- such claims; this section has the sole purpose of protecting the
- integrity of the free software distribution system, which is
- implemented by public license practices. Many people have made
- generous contributions to the wide range of software distributed
- through that system in reliance on consistent application of that
- system; it is up to the author/donor to decide if he or she is willing
- to distribute software through any other system and a licensee cannot
- impose that choice.
- This section is intended to make thoroughly clear what is believed to
- be a consequence of the rest of this License.
- @item
- If the distribution and/or use of the Program is restricted in
- certain countries either by patents or by copyrighted interfaces, the
- original copyright holder who places the Program under this License
- may add an explicit geographical distribution limitation excluding
- those countries, so that distribution is permitted only in or among
- countries not thus excluded. In such case, this License incorporates
- the limitation as if written in the body of this License.
- @item
- The Free Software Foundation may publish revised and/or new versions
- of the General Public License from time to time. Such new versions will
- be similar in spirit to the present version, but may differ in detail to
- address new problems or concerns.
- Each version is given a distinguishing version number. If the Program
- specifies a version number of this License which applies to it and ``any
- later version'', you have the option of following the terms and conditions
- either of that version or of any later version published by the Free
- Software Foundation. If the Program does not specify a version number of
- this License, you may choose any version ever published by the Free Software
- Foundation.
- @item
- If you wish to incorporate parts of the Program into other free
- programs whose distribution conditions are different, write to the author
- to ask for permission. For software which is copyrighted by the Free
- Software Foundation, write to the Free Software Foundation; we sometimes
- make exceptions for this. Our decision will be guided by the two goals
- of preserving the free status of all derivatives of our free software and
- of promoting the sharing and reuse of software generally.
- @iftex
- @heading NO WARRANTY
- @end iftex
- @ifinfo
- @center NO WARRANTY
- @end ifinfo
- @item
- BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW@. EXCEPT WHEN
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE@. THE ENTIRE RISK AS
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- REPAIR OR CORRECTION.
- @item
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGES.
- @end enumerate
- @iftex
- @heading END OF TERMS AND CONDITIONS
- @end iftex
- @ifinfo
- @center END OF TERMS AND CONDITIONS
- @end ifinfo
- @page
- @unnumberedsec How to Apply These Terms to Your New Programs
- If you develop a new program, and you want it to be of the greatest
- possible use to the public, the best way to achieve this is to make it
- free software which everyone can redistribute and change under these terms.
- To do so, attach the following notices to the program. It is safest
- to attach them to the start of each source file to most effectively
- convey the exclusion of warranty; and each file should have at least
- the ``copyright'' line and a pointer to where the full notice is found.
- @smallexample
- @var{one line to give the program's name and an idea of what it does.}
- Copyright (C) 19@var{yy} @var{name of author}
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- @end smallexample
- Also add information on how to contact you by electronic and paper mail.
- If the program is interactive, make it output a short notice like this
- when it starts in an interactive mode:
- @smallexample
- Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
- type `show w'. This is free software, and you are welcome
- to redistribute it under certain conditions; type `show c'
- for details.
- @end smallexample
- The hypothetical commands @samp{show w} and @samp{show c} should show
- the appropriate parts of the General Public License. Of course, the
- commands you use may be called something other than @samp{show w} and
- @samp{show c}; they could even be mouse-clicks or menu items---whatever
- suits your program.
- You should also get your employer (if you work as a programmer) or your
- school, if any, to sign a ``copyright disclaimer'' for the program, if
- necessary. Here is a sample; alter the names:
- @smallexample
- @group
- Yoyodyne, Inc., hereby disclaims all copyright
- interest in the program `Gnomovision'
- (which makes passes at compilers) written
- by James Hacker.
- @var{signature of Ty Coon}, 1 April 1989
- Ty Coon, President of Vice
- @end group
- @end smallexample
- This General Public License does not permit incorporating your program into
- proprietary programs. If your program is a subroutine library, you may
- consider it more useful to permit linking proprietary applications with the
- library. If this is what you want to do, use the GNU Library General
- Public License instead of this License.
- @node Intro, Architecture, Acknowledgments, Top
- @unnumbered Introduction
- You are reading about GNU SQL Server, the GNU implementation of
- relational database server.
- GNU SQL-Server (GSS) was implemented by small team of
- Russian programmers working in the Institute for System
- Programming of Russian Academy of Sciences with support of
- Free Software Foundation and Russian Foundation for Basic
- Research.
- The project was started at 1992. To this time we already had some
- version of an engine (we call it "The Subsystem for Data and
- Transaction Management" - SDTM) which was developed for
- the experimental object-based operating system CLASTOS. At the first
- step SDTM was ported to UNIX environment. In parallel we started
- implementation of the SQL compiler and SQL runtime library.
- At the first stage of the project we got the great help from Sergei
- Gaissarian who is one of the best experts in compilers in our institute.
- Now we really have a working prototype of the system and would
- like to give people a possibility to use it. Of course GSS is
- not so good as current commercial implementations: sometimes it's
- too slow and we know why; we don't have yet any advanced user
- interface (such as forms), etc. But GNU SQL Server is under the GNU General
- Public License and now you can improve it.
- In this manual we briefly describe the general architecture of the
- system, introduce our version of SQL and provide the information
- about GSS installation. If you have some questions don't
- hesitate to contact with us through e-mail: @emph{gss@@ispras.ru}.
- @node Architecture, Dialect , Intro , Top
- GSS is based on client-server architecture for DBMS
- organizations. The system is dedicated for use in distributed
- open systems in UNIX environments. In fact, we support two kinds
- of "clients and servers".
- The whole set of processes working with a data base may be
- broken up into several layers depending upon the distance from the
- data base. The most internal layer which is the closest to a data
- base consists of a set of processes of SDTM. These processes
- provide the services of Synchronizer (two-phase predicate locks),
- Logical Log (the log of updates at the logical level), Micro Log (the
- log for microoperations), Buffer (main memory bufferization,
- exchanges with disks, locks of pages), and Sorter (to make
- external sorts). SDTM also includes utilities to restore the data
- base after failures and crashes of modules for transactions. In
- fact, these modules represent some kind of runtime library. They
- implement the external interface of SDTM. All processes of this
- layer communicate with message queues and shared memory.
- The next layer consists of the server processes of the compiler and
- interpreter of SQL-statements. These processes contain modules of
- transactions and access the kernel and data through them. This
- layer provides services which are available with the mechanism of
- remote procedure calls.
- The server part of the system also contains the process of
- Administrator that monitors a state of all other processes of the
- server and creates by demand services of the compiler and
- interpreter. This process communicates with other processes of
- the internal layer with signals and messages and is accessible for
- external invocations via remote procedure calls. The
- Administrator may be registered as an Internet daemon, and it
- may unload all other parts of server if they aren't used for a
- long time.
- Client parts of the system may reside on any computer of a local
- network. The client part consists of the client part of the SQL
- compiler and the client part of the interpreter which are linked
- together with a user's program. The only requirement for an
- environment where a client part functions is that it should
- support the mechanism of remote procedure calls.
- The client part of the compiler (the precompiler) is responsible
- for selection of pure SQL-text and its transmission to the main
- (server) part of the compiler to convert into a procedural
- representation. After such processing, the user gets a pure
- C-program where SQL-code is replaced to calls of the
- runtime-library of the client part of the query interpreter. A
- corresponded procedural code of SQL-statements is stored within a
- data base.
- At runtime, the server part of the interpreter is provided with
- reference to previously compiled and stored within data base code
- together with parameters of a corresponded SQL-statement. Using
- this reference, the server part of the interpreter retrieves the
- code from data base and perform it with appropriate invocations
- of SDTM.
- We use machine-independent internal representation of
- procedural SQL-code to provide more portability and reliability
- of the system. In principle, we could generate machine codes. But
- the main problem was that we often need to compile something
- dynamically (in runtime) and to load additional parts of code
- from the data base by linking them together with a running
- program. Standard loaders do not provide such facilities. So we
- would need to write a sufficient part of special code for each
- pair of processor and operating system. Moreover, the most
- overhead is paid not for interpretation but for data retrieval
- and may be for the analysis of retrieval conditions.
- @node Dialect, Server, Architecture, Top
- @center The Dialect of SQL of GNU SQL Server
- Activities for standardization of SQL had started practically
- simultaneously with its first commercial implementations. Original
- System R's SQL was not developed with enough care. Commercial dialects
- were so different that no one could be accepted as a standard.
- The first International Standard SQL-89 in many parts is not
- defined precisely enough and allows different interpretations. Also,
- this standard doesn't include such important things as schema
- manipulation and dynamic SQL facilities. A much more complete and
- precise SQL standard was adopted in 1992 but it still omit a lot
- of useful functionality.
- @menu
- * Dialect Intro:: Requirements to the SQL Dialect
- * Data description:: Definition of operating parameters
- * Data types:: Data type correspondence
- * Schema:: Schema manipulations and consistency constraints
- * Access:: Data access control
- @end menu
- @node Dialect Intro, Data description, Dialect, Dialect
- @section Dialect Intro
- The dialect of the SQL of GSS is
- oriented to embedded C and uses an ASCII-compatible set of
- characters. The dialect supports data types that are adequate
- to the base set of types of C, and also strings of various
- length. Statements for data definitions allow us to create and
- to drop relations and views, and also to grant privileges
- to other users. Supported constraints allow us to prevent
- entrance of NULL-values, and to define constraints of
- uniqueness on tables. The language also allows us to declare check
- constraints on a table (conditions that should be true on
- every tuple of the relation) and referential constraints.
- The set of statements for data manipulations includes statements
- to insert, update and delete tuples from relations. The select
- statement may include unions (possibly, with elimination of
- duplicates), joins, and nested subqueries. A result table may be
- sorted in ascendant or descendant order. A result table may be
- processed tuple by tuple through a sequential cursor.
- The SQL dialect is oriented for use in a UNIX-environment. This
- environment provides the implementation with an authorization
- identifier (user name) and a name of the module which is associated
- with a given C-program with embedded SQL. The last name is formed
- as the name of the corresponding source file qualified with the
- user name.
- The dialect does not support any explicit statement to connect a
- data base. A connection is provided automatically to an SQL-server
- specified at a phase of compilation. A name of the SQL-server is
- defined as a network name of a computer where the server is
- installed.
- Below we consider some issues of the dialect with some details.
- @node Data description, Data types, Dialect Intro, Dialect
- @section Data description
- @emph{Data description}
- SQL statements manipulate the following data elements: constants
- (numbers and strings), parameters (variables of a host
- C-program), columns, tables, and user defined schemes.
- Identifiers which are used to name these elements may be
- represented in traditional form ([A-Za-z][A-Za-z0-9]* e.g. A0z9)
- or as a double quoted string ("This is an identifier too"). Names
- of host variables should also satisfy the naming rules of the C
- programming language. The dialect of SQL does not restrict the
- length of identifiers of host variables but any name of a table,
- column, or user-defined schema should not be longer than 18
- characters. Literal strings of characters are restricted by
- single quotes ('this is an example of such literal') and may
- contain any symbol of the character set used. Strings are sorted
- according to codes of characters (thus if the KOI-8 - Russian
- extension of ASCII - is in use than sorting will not always
- provide the desired ordering).
- Parameters and columns of any type and expressions constructed
- from them may have a NULL-value in addition to all the usual values of
- a given data type. In indexes, a NULL-value is considered as a
- value that is less than every non-NULL value of the same type. To
- fetch into a host variable a column or expression that may have
- NULL-value one should use an additional indicator variable that gets
- a value of -1 if a value of the main variable is NULL.
- @node Data types, Schema, Data description, Dialect
- @section Data types
- @center Data types
- In the current version we support only those data types that may
- be directly mapped into data types of standard C programming
- language. The correspondence between SQL data types and C data
- types is shown below:
- @example
- SQL data type C data type
- CHAR(ACTOR)([length]) char [length]
- INT(EGER) long
- SMALLINT short
- REAL float
- DOUBLE PRECISION double
- @end example
- The system also partially supports the SQL FLOAT data type: depending
- on required precision it is mapped onto either a float or a double
- data type of C. But if too high precision is required (which may
- not be emulated by double) then an error message is generated.
- The same method is used for the SQL DECIMAL data type if a scale is
- defined as zero. Processing of such data types as DATETIME and
- CHARVAR have not yet been implemented.
- @node Schema, Access, Data types, Dialect
- @section Schema
- @center Schema manipulations and consistency constraints
- By definition, user schema is a totality of all stored objects of
- a given user: tables, views, modules (a set of compiled
- SQL-statements that correspond to one user's program) and
- triggers. The user schema is actually created when the first object
- of this user is created. SQL CREATE SCHEMA statement does not
- create anything itself, it just defines a context (default
- authority identifier) for all the nested statements for table and
- view creation.
- SQL CREATE TABLE statement specifies table name, column
- description and integrity constraints that should be applied to a
- given table. Each column is specified by its name, data type and
- optionally by a default value. Our dialect of SQL allows three
- kinds of integrity constraints: primary and alternative key
- constraints (unique constraints), referential constraints (for
- foreign keys), and check constraints. In the case of referential
- constraints there should exist a unique constraint for an
- appropriate set of the referred table. All unique and check
- constraints are checked on each row update of a given table.
- Foreign key constraints are checked on each row update both of
- referring and referred tables.
- For each check or referential constraint an appropriate trigger
- is created within a data base. The only function of this trigger
- is to check a constraint and to undo SQL statements that violate
- the constraint. Any explicit triggers are not allowed.
- The statement DROP TABLE is successively executed only if there
- are not any references (foreign keys) belonging to it. Views, i.e.
- stored named queries, that are treated as tables are supported. Our
- version of SQL does not support modules explicitly: there is not any
- special language construction to create explicit modules. In fact,
- implicit modules are created and maintained by the SQL compiler.
- @node Access, , Schema, Dialect
- @section Access
- @center Data access control
- Each (registered) user may create objects with any authorization
- identifier that may differ from his/her own identifier. But only
- this creator (owner) may modify or drop these objects.
- Immediately after creation only the owner has rights for any
- operation with this object, and all other users cannot do
- anything. But later the owner can grant all or part of his/her
- rights to other user(s) with the SQL GRANT PRIVILEGES statement,
- including WITH GRANT OPTION.
- @c Any grantor may also revoke
- @c previously granted privileges with SQL REVOKE PRIVILEGES
- @c statement. Of course, the REVOKE statement will revoke privileges of
- @c all users that are grantees of a grantee of the recent grantor.
- According to SQL-89 standard our dialect supports SELECT, INSERT,
- DELETE, UPDATE, and REFERENCE privileges.
- @node Server, Client, Dialect, Top
- To start the server you need to run SQL server top routine 'gsqls' from the
- @cite{dbhome} directory (let's say /usr/local/gnusql/0.7b3/i586-unknown-linux )
- ( or @cite{sqlser} subdirectory of distribution). If you want to run it in background,
- you have to redirect output streams to log. if you configured it
- to use debugger, you need to give administrator answers: i.e. whether or
- not you start debugger for each started subservice.
- @example
- Example:
- gsql@{kml@}/home/gsql/gss/sqlser(45): ls -l
- -rwxrwxr-x 1 vera sql 266032 Oct 4 14:31 gsqls
- drwxrwxr-x 2 vera sql 512 Oct 4 14:32 bin
- drwxrwxr-x 2 vera sql 512 Oct 1 14:08 client
- drwxrwxr-x 2 vera sql 512 Oct 4 12:43 db
- drwxrwxr-x 2 vera sql 512 Oct 4 12:48 jarchive
- drwxrwxr-x 2 vera sql 512 Sep 30 07:41 jrnls
- drwxrwxr-x 5 vera sql 512 Sep 30 07:41 repository
- drwxrwxr-x 2 vera sql 512 Sep 30 07:41 segs
- gsql@{kml@}/home/gsql/gss/sqlser(45): gsqls >&log &
- @end example
- In the example above we are starting server in the directory
- where we created it. It was not created to support debugging so
- we don't worry about the input stream. Both output streams are
- redirected to log. Server output now produces a lot of 'for any case'
- information which we prefer not to turn off in the test release.
- TO BE FILLED LATER
- @node Client, Bugs , Server, Top
- @center Compiling and running DB applications
- To create any database application you need to write a C program containing
- either embedded SQL operators or runtime system calls supporting dynamic SQL.
- Both cases require processing your program by the SQL compiler. The Compiler connects
- the SQL server, sends SQL code there and produces pure C code with runtime
- library calls substitution as well as identification of SQL compiled code
- stored in the database. @footnote{Currently the server doesn't check dependencies
- for compiled code; this; this will be done in the future.}
- gsqlc [options] files...
- Option @cite{-hHOSTNAME} gives the name of the host where the database
- server resides. This option overrides the value of the environment
- variable @emph{GSSHOST}. If both of them are omitted the local host
- is supposed to run the DB server.
- Option @cite{-rMODE} gives the mode of file processing. The possible values
- of @cite{MODE} are: @emph{C},@emph{SQL},@emph{MODULE}, @emph{SCHEMA}.
- If this option is omitted the compiler interprets extension @emph{.ec} as
- a C program with embedded SQL, and @emph{.sql} as pure SQL code -
- either schema or module definition.
- Options @cite{-dPASSES_IDS} asks the compiler to produce compiler tree
- dumps after given passes of compilation. PASSES_IDS is a set if characters
- representing each pass. Pass identification can be found in the file
- @emph{src/include/options.def} in the distribution directory.
- To link your program you should tell the linker to use the runtime
- library (either @emph{sqlser/client/*.a} or @emph{'-lgss'}).
- If you configured the package to use a debugger, the running application program will
- ask you if you want to start the debugger for the starting transaction process. You
- can override this request by setting the @emph{NEEDGDB} environment variable to
- "n".
- Too see examples of using SQL in a program see the examples in the distribution
- @emph{test} subdirectory.
- @node Bugs, Key Index, Client, Top
- @section Reporting Bugs
- @cindex bugs
- At sometimes you may encounter a bug in the SQL Server. Although we cannot
- promise we can or will fix the bug, and we might not even agree that it
- is a bug, we want to do hear about any problems you encounter. Often we agree
- they are bugs and we want to fix them.
- To make it possible for us to fix a bug, you must report it. In order
- to do so effectively, you must know when and how to do it.
- @menu
- * Criteria: Bug Criteria. Have you really found a bug?
- * Understanding Bug Reporting:: How to report a bug effectively.
- * Checklist:: Steps to follow for a good bug report.
- * Sending Patches:: How to send a patch for GNU SQL Server.
- @end menu
- @node Bug Criteria
- @subsection When Is There a Bug
- If the SQL Server or client runtime library executes an illegal instruction,
- or dies with an operating system error message that indicates a problem
- in the program (as opposed to something like ``disk full''), then it is
- certainly a bug.
- If the client programs reports: "service crash" then it is certainly a bug.
- If a database stores the wrong data or can't find yours, that is a bug. But be
- sure you know for certain what it ought to be. If you aren't familiar
- with SQL or don't know for certain how the statement is supposed to work,
- then it might actually be working right. Rather than jump to conclusions,
- show the problem to someone who knows for certain.
- If after a careful rereading of the manual you still do not understand
- how to do some typical job, that indicates a bug in the manual, which
- you should report. The manual's job is to make everything clear to
- people who are not SQL experts---including you. It is just as
- important to report documentation bugs as program bugs.
- ( We aer in the very beginning of the manual and your notes will be very
- helpfull -- at least we will understand what should we describe and
- what is obvious for everybody. /kml )
- @node Understanding Bug Reporting
- @subsection Understanding Bug Reporting
- @findex GSS-version
- When you decide that there is a bug, it is important to report it and to
- report it in a way which is useful. What is most useful is an exact
- description of what SQL statements you executed and what kind and amount
- of data your database had stored when you started a transaction. Information
- about concurrent transactions can be extremely helpful.
- The most important principle in reporting a bug is to report @emph{facts},
- not hypotheses or categorizations. It is always easier to report the
- facts, but people prefer to strain to speculate explanations of their own
- and report their speculations instead. If the explanations are based
- on guesses about how GSS is implemented, they will be useless; we will
- have to try to figure out what the facts must have been to lead to such
- speculations. Sometimes this is impossible. But in any case, it is
- unnecessary work for us to do when we could be doing something constructive.
- @node Checklist
- @subsection Checklist for Bug Reports
- @cindex reporting bugs
- The best way to send a bug report is to mail it electronically to the
- GNU SQL Server maintainers at @samp{bug-gnu-sql@@prep.ai.mit.edu}. (If you
- want to suggest a change as an improvement, use @samp{gss@@ispras.ru}.)
- If you'd like to read the bug reports, you can find them on the
- newsgroup @samp{it has not created yet} or subscribe for bug report mail list.
- ( see @samp{http://www.ispras.ru/~gsql} for details; keep in mind, however,
- that as a spectator you should not criticize anything about what you see there.
- The purpose of bug reports is to give information to the SQL server
- maintainers. Spectators are welcome only as long as they do not
- interfere with this. In particular, some bug reports contain large
- amounts of data; spectators should not complain about this.
- Please do not post bug reports using netnews; mail is more reliable
- than netnews about reporting your correct address, which we may need in
- order to ask you for more information.
- If you can't send electronic mail, then mail the bug report on paper
- or machine-readable media to this address:
- @format
- GNU SQL Server Bugs
- Free Software Foundation
- 59 Temple Place, Suite 330
- Boston, MA 02111-1307 USA
- @end format
- We do not promise to fix the bug; but if the bug is serious,
- or ugly, or easy to fix, chances are we will want to.
- To enable maintainers to investigate a bug, your report
- should include all these things:
- @itemize @bullet
- @item
- The version number of the SQL server. Without this, we won't know
- whether there is any point in looking for the bug in the current version
- of the GNU SQL server.
- You can get the version number from the server log. At start time it
- reports that "GNU SQL server (version xxxxx) ".
- @item
- The type of machine you are using, and the operating system name and
- version number.
- @item
- The operands given to the @code{configure} command when the SQL Server was
- installed.
- @item
- A complete list of any modifications you have made to the GSS source.
- (We may not have time to investigate the bug unless it happens in an
- unmodified SQL Server. But if you've made modifications and you don't
- tell us, you are sending us on a wild goose chase.)
- Be precise about these changes. A description in English is not
- enough---send a context diff for them.
- Adding files of your own, or porting to another machine, is a
- modification of the source.
- @item
- Details of any other deviations from the standard procedure for installing
- the GNU SQL Server.
- @item
- The complete text of any files needed to reproduce the bug.
- @item
- The precise log of client program and server output. If would be a good
- idea if you comment them by timestamp or syncronization marks.
- @item
- A description of what behavior you observe that you believe is
- incorrect.
- Even if the problem you experience is a fatal signal, you should still
- say it explicitly. Suppose something strange is going on, such as, your
- copy of the source is out of sync, or you have encountered a bug in the
- C library on your system. (This has happened!) Your copy might crash
- and the copy here might not. If you @emph{said} to expect a crash, then
- when GSS here fails to crash, we would know that the bug was not
- happening. If you don't say to expect a crash, then we would not know
- whether the bug was happening---we would not be able to draw any
- conclusion from our observations.
- @item
- If the manifestation of the bug is an SQL Server error message, it is
- important to report the precise text of the error message.
- This use of the debugger is possible only if you know how to make the
- bug happen again. If you can't make it happen again, at least copy
- the whole error message.
- @end itemize
- Here are some things that are not necessary in a bug report:
- @itemize @bullet
- @item
- A system call trace of SQL server or client execution.
- System call traces are very useful for certain special kinds of
- debugging, but in most cases they give little useful information. It is
- therefore strange that many people seem to think that @emph{the} way to
- report information about a crash is to send a system call trace.
- In most programs, a backtrace is normally far, far more informative than
- a system call trace. Even in the SQL server, a simple backtrace is
- generally more informative.
- @item
- A patch for the bug.
- A patch for the bug is useful if it is a good one. But don't omit the
- other information that a bug report needs, such as the test case, on the
- assumption that a patch is sufficient. We might see problems with your
- patch and decide to fix the problem another way, or we might not
- understand it at all. And if we can't understand what bug you are
- trying to fix, or why your patch should be an improvement, we will not
- install it.
- @ifinfo
- @xref{Sending Patches}, for guidelines on how to make it easy for us to
- understand and install your patches.
- @end ifinfo
- @item
- A guess about what the bug is or what it depends on.
- Such guesses are usually wrong. Even experts can't guess right about
- such things without first using the debugger to find the facts.
- @end itemize
- @node Sending Patches
- @subsection Sending Patches for the GNU SQL Server
- @cindex sending patches for the GNU SQL Server
- @cindex patches, sending
- If you would like to write bug fixes or improvements for GNU SQL Server,
- that is very helpful. When you send your changes, please follow these
- guidelines to make it easy for the maintainers to use them. If you
- don't follow these guidelines, your information might still be useful,
- but using it will take extra work. Maintaining the GNU SQL Server is a
- lot of work in the best of circumstances, and we can't keep up unless
- you do your best to help.
- @itemize @bullet
- @item
- Send an explanation with your changes of what problem they fix or what
- improvement they bring about. For a bug fix, just include a copy of the
- bug report, and explain why the change fixes the bug.
- (Referring to a bug report is not as good as including it, because then
- we will have to look it up, and we have probably already deleted it if
- we've already fixed the bug.)
- @item
- Always include a proper bug report for the problem you think you have
- fixed. We need to convince ourselves that the change is right before
- installing it. Even if it is correct, we might have trouble
- understanding it if we don't have a way to reproduce the problem.
- @item
- Include all the comments that are appropriate to help people reading the
- source in the future understand why this change was needed.
- @item
- Don't mix together changes made for different reasons.
- Send them @emph{individually}.
- If you make two changes for separate reasons, then we might not want to
- install them both. We might want to install just one. If you send them
- all jumbled together in a single set of diffs, we have to do extra work
- to disentangle them---to figure out which parts of the change serve
- which purpose. If we don't have time for this, we might have to ignore
- your changes entirely.
- If you send each change as soon as you have written it, with its own
- explanation, then two changes never get tangled up, and we can consider
- each one properly without any extra work to disentangle them.
- @item
- Send each change as soon as that change is finished. Sometimes people
- think they are helping us by accumulating many changes to send them all
- together. As explained above, this is absolutely the worst thing you
- could do.
- Since you should send each change separately, you might as well send it
- right away. That gives us the option of installing it immediately if it
- is important.
- @item
- Use @samp{diff -c} to make your diffs. Diffs without context are hard
- to install reliably. More than that, they are hard to study; we must
- always study a patch to decide whether we want to install it. Unidiff
- format is better than contextless diffs, but not as easy to read as
- @samp{-c} format.
- If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when
- making diffs of C code. This shows the name of the function that each
- change occurs in.
- @item
- Write the change log entries for your changes. This is both to save us
- the extra work of writing them, and to help explain your changes so we
- can understand them.
- The purpose of the change log is to show people where to find what was
- changed. So you need to be specific about what functions you changed;
- in large functions, it's often helpful to indicate where within the
- function the change was.
- On the other hand, once you have shown people where to find the change,
- you need not explain its purpose in the change log. Thus, if you add a
- new function, all you need to say about it is that it is new. If you
- feel that the purpose needs explaining, it probably does---but put the
- explanation in comments in the code. It will be more useful there.
- Please read the @file{ChangeLog} files in the @file{top}
- directory to see what kinds of information to put in, and to learn the
- style that we use. If you would like your name to appear in the header
- line, showing who made the change, send us the header line.
- @item
- When you write the fix, keep in mind that we can't install a change that
- would break other systems. Please think about what effect your change
- will have if compiled on another type of system.
- Sometimes people send fixes that @emph{might} be an improvement in
- general---but it is hard to be sure of this. It's hard to install
- such changes because we have to study them very carefully. Of course,
- a good explanation of the reasoning by which you concluded the change
- was correct can help convince us.
- The safest changes are changes to the configuration files for a
- particular machine. These are safe because they can't create new bugs
- on other machines.
- Please help us keep up with the workload by designing the patch in a
- form that is clearly safe to install.
- @end itemize
- @include gnu.texi
- @ifinfo
- @include ask.texi
- @end ifinfo
- @node Key Index, Command Index, Bugs , Top
- @unnumbered Key (Character) Index
- @printindex ky
- @node Command Index, Variable Index, Key Index, Top
- @unnumbered Command and Function Index
- @printindex fn
- @node Variable Index, Concept Index, Command Index, Top
- @unnumbered Variable Index
- @printindex vr
- @node Concept Index, , Variable Index, Top
- @unnumbered Concept Index
- @printindex cp
- @summarycontents
- @contents
- @bye