''Rel'' is an OpenSource project to develop a true RelationalDatabase with a RelationalLanguage that implements and extends TutorialDee. ''Rel'' is maintained by DaveVoorhis, and is available on SourceForge at http://dbappbuilder.sourceforge.net/Rel.html HughDarwen's text, ''An Introduction to Relational Database Theory'', features exercises using ''Rel''. Download the book from http://bookboon.com/uk/student/it/an-introduction-to-relational-database-theory First-class (FirstClassFunction) anonymous (AnonymousFunction) and higher-order operators (HigherOrderFunction) are a work-in-progress in ''Rel''. See http://dbappbuilder.sourceforge.net/docs/AnonymousAndFirstClassOperatorsInTutorialD.pdf ---- '''Releases:''' ''Note: Rel was first released in 2004. Only releases since 2008 are included here.'' June 21, 2008: Rel version 0.3.5 Alpha * fix: aggregate operators SUM, AVG, MIN, MAX, UNION, D_UNION, and INTERSECT now return correct types in all cases * fix: OUTPUT now appends newline to output * feature: implemented user-defined Java-based types and operators * feature: database now contained in the Database subdirectory * refactor: moved built-in operator definition to R''''''elDatabase * note: This version does not include support for external relvars. That will be available in version 0.3.6. June 26, 2008: Rel version 0.3.6 Alpha * fix: changed replaceAll() to replace() in D''''''irClassLoader to hopefully address problem loading user-defined Java-based operators under Windows Vista. * feature: database directory may now be specified via command switch to Rel and DBrowser, or via DBrowser user interface. * note: This is a maintenance release. It still doesn't include support for external relvars. Stay tuned for version 0.3.7... July 11, 2008: Rel version 0.3.7 Alpha * feature: relvar updates now report number of tuples affected * feature: extensive DBrowser changes, including tabular formatting of relations and tuples. * note: This is a maintenance release. It still doesn't include support for external relvars. Stay tuned for version 0.3.9... (Yes, 9. 0.3.8 will be another maintenance release) July 15, 2008: Rel version 0.3.8 Alpha * fix: DBrowser toolbars no longer tear off to form a blank floating window. * fix: If a Java-based type was created, dropped, and then re-created with revisions, the original type definition would be used instead of the revised version. This has been corrected. * feature: DBrowser now has Backup button to automate generating a backup script. * feature: Installer now creates Start menu entries and desktop icons on Linux and MicrosoftWindows systems. * note: This is a maintenance release. It still doesn't include support for external relvars. Stay tuned for version 0.3.9. July 29, 2008: Rel version 0.3.9 Alpha * fix: fixed memory leak when switching from Enhanced/non-enhanced display in DBrowser * fix: DBrowser "splash" window widened to display under OpenJDK without the text bleeding outside the window. * feature: added free memory display in DBrowser * feature: provided unhandled exception reporting in DBrowser * feature: Under UNIX/Linux, changed "Uninstall" menu entry to "Uninstall Rel", to avoid ambiguity when merged with other menu entries. * feature: DBrowser window now preserves screen position and dimensions across invocations. * feature: Implemented DBrowser Monitor window * feature: 'r ORDER ()' now implemented as relational operator * feature: minor grammar tweak to avoid extraneous parentheses. E.g. (union {sys.Catalog}) = (union {sys.Catalog}) can now be expressed as union {sys.Catalog} = union {sys.Catalog} * feature: 'FOR r; ; END FOR;' now implemented to iterate tuples of a relation. Should be considered shorthand for LOAD array FROM r and associated iteration, local variables, etc. * note: D''''''atabaseToScript.d revised to use FOR and ORDER. * note: This is a maintenance release. You know the drill... July 30, 2008: Rel version 0.3.10 Alpha * fix: DBrowser: command-line parameter values with spaces are now supported. * fix: DBrowser Monitor no longer closes when supplied with an incorrect number of arguments. * fix: DBrowser: ':' and ' ' in suggested backup file name will be changed to '_'. * feature: DBrowser: more error-checking has been implemented in the Backup process. * note: This is a maintenance release. Yeah, yeah, yeah... August 1, 2008: Rel version 0.3.11 Alpha * fix: Rel: assigning a relvar to itself could result in locking up, as it perpetually tried to insert newly-inserted tuples into itself. This has been corrected. * fix: Rel: updating a key value in a relvar could result in locking up, as updated tuples moved ahead of the internal cursor to be updated again, forever. This has been corrected. * fix: Rel: inserting a substituted relvar into itself could result in locking up, as the newly-inserted tuples appeared in the source relvar, which were then copied into the target relvar, which then appeared in the source relvar, which were then copied into the target relvar, which then appeared in the source relvar, etc. This has been corrected. * fix: Rel: INIT clause of REAL relvar definition would define the relvar correctly, but not assign any tuples. This has been corrected. * fix: DBrowser: A thread race condition that caused un-enhanced display to sometimes duplicate or drop text has been corrected. * feature: Rel: relation JOIN performance has been improved. * feature: Rel: CPU consumption during external Java compilation has been reduced. * feature: Rel: Tuple update notices are now consolidated and deferred until the end of execution, to avoid cluttering output with results of individual operations. * note: This is a maintenance release. The usual conditions apply. August 3, 2008: Rel version 0.3.12 Alpha * feature: Alter ORDER() to return an ARRAY. * feature: Alter FOR to iterate ARRAY tuples. * feature: Alter LOAD ... FROM ... to load ARRAY from ARRAY. * feature: Alter R''''''elClient parser to recognise ARRAYs. * fix: Attempt to JOIN RELATION {TUPLE {x 1, y 2.3}} to RELATION {TUPLE {y 2.3, x 1}} could fail. Fixed. * enhancement: Removed 'Serializable' from J''''''oinMap, O''''''rderMap, N''''''ativeFunction and N''''''ativeProcedure because unnecessary. * enhancement: provided user-friendly index-out-of-bounds messages for ARRAY * enhancement: lowered operator precedence of ORDER to below WHERE, and [...] (array dereference) to below ORDER. This allows formation of natural expressions, e.g., sys.Catalog WHERE Owner<>"Rel" ORDER (ASC Name) [2] * enhancement: JOIN can now emit tuples before indexing is complete. * note: This is a maintenance release. Etc. October 16, 2008: Rel version 0.3.13 Alpha * fix: In some cases, an expression that used the result of one WHERE operator as input to another WHERE operator would generate bogus results or throw an exception. This has been corrected. * fix: JOINing relations with relation-valued attributes could cause an exception. This has been corrected. * fix: If a database update resulted in a database constraint violation, it would display bogus tuple update notices and/or carry erroneous tuple update counts to subsequent updates. This has been corrected. * enhancement: When using DBrowser in un-enhanced mode, literal CHARACTER values are now output with delimiters. This is done to be consistent with the view that un-enhanced output can be fed to the input and parsed. * enhancement: A character LENGTH operator has been added to the O''''''peratorsChar.d script. * enhancement: When using DBrowser in enhanced mode, literal CHARACTER values are displayed without delimiters. * enhancement: Error messages have been made more readable. Extraneous token names have been removed and un-terminated character strings no longer generate an error message with confusing internal debugging information. * note: The usual... March 25, 2009: Rel version 0.3.14 Alpha * fix: DBrowser: Pressing ctrl-tab in the entry panel resulted in a stack overflow. This has been corrected. * fix: DBrowser: User-selected font settings now load on start-up. * fix: DBrowser: User-selected font size (but not style) now applies to enhanced output. * fix: Rel: UNION, D_UNION, MAX, MIN and INTERSECT aggregate operators now correctly throw an error when given a relation of cardinality 0. * note: ~Sigh~ ---- '''April 14, 2009: Rel version 0.3.15 Alpha''' This version of Rel is the first to support user-defined types using TutorialDee syntax. Code like the following now works: TYPE D''''''epartmentName POSSREP {name CHAR}; TYPE E''''''mployeeName POSSREP {name CHAR}; VAR Departments REAL RELATION { name D''''''epartmentName, city CHAR } key {name}; VAR Employees REAL RELATION { name E''''''mployeeName, dept D''''''epartmentName } key {name}; POSSREP constraints are supported. E.g.: TYPE posint POSSREP {x INTEGER CONSTRAINT x > 0}; Recursive types are supported (though the syntax for these is likely to change somewhat in an upcoming release, in order to remain compatible with the inheritance model in DateAndDarwensTypeSystem), for example: TYPE stringtree POSSREP node {left stringtree, right stringtree} POSSREP leaf {string CHAR}; VAR x INIT(node(leaf('l'), leaf('r'))); WRITELN x; However, support for user-defined types is *very* preliminary, is mostly incomplete (inheritance and specialisation by constraint are not implemented yet), and is probably buggy. '''Fixes and Features:''' * Fix: DBrowser: In enhanced mode, adjacent tuple or relation-valued attributes were displayed one above the other, instead of beside each other. Corrected. * Fix: Rel: A bug that would cause this... SUMMARIZE RELATION {TUPLE {a 'A', x 0}} BY {a} ADD ( SUM(x) as xx, SUM(xx) as xxx ) ...or this... EXTEND sys.Catalog ADD ( 1 AS p, 2 AS q, EXTEND sys.Catalog ADD (q AS y) AS r ) ...to generate an internal error has been corrected. * Fix: Rel: In sys.Catalog, the C''''''reationSequence column value for relvars was incorrect relative to other objects such as operators and types. Corrected. * Enhancement: Rel: The sys.Types relvar now contains the built-in primitive types. * Enhancement: Rel: A new sys.O''''''peratorsBuiltin relvar contains built-in operator names. * Enhancement: Rel: The sys.Operators relvar now has a R''''''eturnsType column. * Enhancement: Scripts: D''''''ateBookSampleRelvars.d has been corrected and revised to use POSSREPs. * Enhancement: Scripts: Views.d has been revised to use new Dependencies relvars. ---- '''May 25, 2009: Rel version 0.3.16 Alpha''' This version of Rel includes a number of enhancements, the most significant being preliminary (and undoubtedly buggy) support for single inheritance and specialization by constraint. Constructs like the following may now be explored: TYPE B''''''aseType POSSREP {x INTEGER, y INTEGER}; TYPE D''''''erivedType1 IS { B''''''aseType CONSTRAINT THE_x(B''''''aseType) = 0 AND THE_y(B''''''aseType) > 5 POSSREP {a = THE_y(B''''''aseType)} }; TYPE D''''''erivedType2 IS { B''''''aseType CONSTRAINT THE_x(B''''''aseType) > 5 AND THE_y(B''''''aseType) = 0 POSSREP {a = THE_x(B''''''aseType)} }; An extension has been provided to facilitate experimenting with user-defined types. Types with multiple POSSREPs support an INIT section that can be used to define POSSREPs in terms of each other. This is a possibly temporary mechanism to take the place of "highly protected operators not part of D". (TTM 3rd ed., pg 382, etc.) For example: TYPE blah POSSREP blah1 {x INTEGER, y INTEGER} POSSREP blah2 {a INTEGER, b INTEGER} INIT blah1 (a := x * 2, b := y * 2) blah2 (x := a / 2, y := b / 2); A user-defined type with multiple POSSREPs and no INIT section defines a tagged union type. This may be used to create (for example) recursive types. E.g.: TYPE S''''''tringTree POSSREP node {string CHAR, left S''''''tringTree, right S''''''tringTree} POSSREP nothing {}; Additional enhancements include: * Rel: Support for the jikes Java compiler has been removed. This has been replaced with an alternative mechanism for invoking the Java compiler. * Rel: TYPE definitions are now cached to improve performance. * Rel: Operators spawned by user-defined types may not be explicitly dropped. * Rel: Dropping a user-defined type will now attempt to implicitly drop its spawned operators. * Rel: SET is now available to manipulate system environment settings. To see the available attributes and values, enter the following: SET x x; * Scripts: In the O''''''peratorsChar.d script in the Scripts folder, the ambiguous and somewhat dysfunctional IS_NUMERIC operator has been replaced with IS_DIGITS, which only returns true if supplied CHAR consists strictly of 0-9. * DBrowser: Startup error messages now wrap within the message box to prevent the message box from being wider than screen. This update also fixes two bugs in DBrowser, the interactive command-line client: * Negative RATIONAL and INTEGER literals returned by Rel are now recognised and correctly displayed. * Relation-valued attributes with cardinality 0 now display correctly in enhanced mode. ---- '''May 31, 2009: Rel version 0.3.17 Alpha''' This version of Rel fixes two bugs found shortly after the release of version 0.3.16: * Dynamic dispatch did not consistently resolve operator invocations based on the most specific type of arguments. In many cases, it mistakenly used the declared type. * Sometimes, attempting to create a relvar with attributes of user-defined types threw an exception. Also, the sys.Operators relvar has been reorganised to capture the implementation versions of operators in a relation-valued attribute. This is experimental, and may change in a future update. To allow for this change, the D''''''atabaseToScript.d script in the Scripts folder has been revised. ---- '''December 29, 2009: Rel version 0.3.18 Alpha''' This version of Rel fixes several bugs and makes a change to the TYPE semantics to better conform to the model defined in TheThirdManifesto. 1. The supplied batch files for Windows systems referenced parameters as $n (UNIX/Linux syntax) instead of %n. This has been corrected. 2. Creating a relvar using a user-defined Java-based TYPE, e.g., 'VAR TEST BASE RELATION {X Date} KEY{X};' where Date is a 'FOREIGN Java' type, caused an exception. This has been fixed. 3. Given: TYPE DATE POSSREP {c CHAR CONSTRAINT LENGTH(c) = 8 AND IS_DIGITS(c)}; VAR TEST BASE RELATION {ID INTEGER, D DATE} KEY {ID}; The following threw an internal error instead of the appropriate type mismatch error: TEST := RELATION { TUPLE {ID 1, D "15061989"} }; This has been corrected. 4. In order to more closely confirm to The Third Manifesto's documented model, the implicit tagged UNION construct (a Rel-specific extension) has been removed. Where this was previously supported: TYPE List POSSREP Node {data INTEGER, next List} POSSREP Nothing {}; You should use this: TYPE List UNION; TYPE Node IS {List POSSREP {data INTEGER, next List}}; TYPE Nothing IS {List POSSREP {}}; ---- '''February 28, 2010: Rel version 0.3.19 Alpha''' This release fixes three bugs. 1. Specifying valid but very large INTEGER literals caused an internal exception. This has been corrected. 2. Specifying valid but very large RATIONAL literals caused an internal exception. This has been corrected. 3. Attempting to select a value of a user-defined TYPE, where the type defines a CONSTRAINT expression that references a user-defined Java-based operator, would always cause a constraint failure if the operator and the type were defined -- and the value selected -- all in the same transaction. This has been corrected. ---- '''April 5, 2010: Rel version 0.3.20 Alpha''' This version of Rel makes major changes to the type system. It is now possible to create subtypes of the built-in INTEGER, BOOLEAN, RATIONAL, and CHARACTER types. The <, <=, >, >=, =, <>, AND, OR, XOR, NOT, +, -, *, and / symbolic operators have been mapped to named operators, all of which have a name prefixed with OP_. Any 'a + b' is translated to 'OP_PLUS(a, b)', 'a - b' becomes 'OP_MINUS(a, b)', 'a >= b' turns into 'OP_GREATERTHANOREQUALS(a, b)' and so on. This makes it straightforward to create appropriate operators for user-defined types and subtypes, simply by defining new OP_ operators. At this time, there is a slight overall performance penalty associated with being able to subtype the built-in types, and a noticeable performance hit associated with using subtyping-by-constraint on the INTEGER, BOOLEAN, and CHARACTER types. For teaching purposes (Rel is mainly used as a teaching tool) this shouldn't be a problem. If you're using Rel to run your company payroll, however, the performance hit may be of concern. This version of Rel makes no attempt to optimise performance. As such, it is advisable to do appropriate testing before using this version of Rel in production settings. Future updates will implement appropriate optimisations. Also, this version is the first to implement TCLOSE. However, it is quite inefficient as it is based on the TRANCLO() example from page 175 of The Third Manifesto, 3rd Edition. However, for teaching-oriented examples and the like, performance should be acceptable. ---- '''June 4, 2010: Rel version 1.0.0 Beta''' This version of ''Rel'' represents an important milestone. It has been updated from 'Alpha' to 'Beta' status and the version number set to 1.0.0. Whilst not yet at a point where it should be used to host the company payroll, the new version number and status reflect that fact that ''Rel'' is increasingly stable and usable as a "real" DBMS and not just a teaching tool. This release includes two bug fixes: 1) RelVar definitions with both a defined heading and an INIT section did not correctly map the INIT expression to the heading if the order of attributes differed. E.g., in the following, company_name and department_name wound up reversed: VAR Department BASE RELATION {company_name CHAR, department_name CHAR} INIT (RELATION { TUPLE {department_name "Research and Development", company_name "General Electronics"}, TUPLE {department_name "Management", company_name "Ads are Us"}, TUPLE {department_name "Management", company_name "General Electronics"}}) KEY {department_name, company_name}; 2) In DBrowser, Enhanced mode now correctly displays user-defined TYPE values with relation-valued components. Previously, these caused unpredictable display quirks. This release also includes one minor enhancement: 1) Given the following: TYPE Point POSSREP { x INTEGER , y INTEGER }; TYPE Line UNION; TYPE Line2p IS { Line POSSREP { p1 Point , p2 Point } }; TYPE L''''''ineInfinite IS { Line POSSREP { points RELATION { p Point } } }; An expression like the following... RELATION { TUPLE {x 1, y Line2p(Point(2, 2), Point(3,3))}, TUPLE {x 2, y L''''''ineInfinite(RELATION { TUPLE {p Point(3,4)}, TUPLE {p Point(4,2)}, TUPLE {p Point(6,7)}})} } ...generates a type "not compatible" error because Line2p is neither a subtype or supertype of L''''''ineInfinite. Due to user confusion over how to correct this, the error message has been extended to recommend that the user specify an explicit relation heading. E.g., the following will not generate an error because Line2p and L''''''ineInfinite are both subtypes of Line: RELATION {x INTEGER, y Line} { TUPLE {x 1, y Line2p(Point(2, 2), Point(3,3))}, TUPLE {x 2, y L''''''ineInfinite(RELATION { TUPLE {p Point(3,4)}, TUPLE {p Point(4,2)}, TUPLE {p Point(6,7)}})} } ---- '''July 12, 2010: Rel version 1.0.1 Beta''' This version of Rel is a maintenance release. The following bugs have been fixed: 1) Given a relation with a relation-valued attribute having cardinality 0, e.g.: EXTEND S {S#} ADD (RELATION {TUPLE {S# S#}} COMPOSE SP AS SP_result) Ungrouping this relation caused a Java exception, e.g.: EXTEND S {S#} ADD (RELATION {TUPLE {S# S#}} COMPOSE SP AS SP_result) UNGROUP (SP_result) This has been corrected. 2) A bug in RENAME made it possible to create duplicate attribute names. E.g.: sys.Catalog RENAME (Definition AS Name) This has been corrected. 3) Due to a bug in the mechanisms that compare values of user-defined types when used in relvar attributes, certain expressions like S JOIN SP JOIN P returned bogus results. This has been corrected. 4) GROUP with multiple AS clauses, or performing GROUP on a relation with relation-valued attributes, e.g... (sys.Catalog GROUP ({isVirtual, Name} as Blah, {Owner} as Blah2)) ...threw a Java exception. This has been corrected. 5) DBrowser incorrectly displayed RATIONAL values of NaN, -Infinity and Infinity. This has been corrected. ---- '''July 14, 2010: Rel version 1.0.2 Beta''' This version of Rel is a maintenance release. A bug has been fixed in the Rel DBMS. In some cases, the superset operator '>=' did not work correctly. E.g... WITH (S WHERE CITY = 'London') AS S1, (SP RENAME (P# AS P#1)) AS SP1: (P WHERE ((SP1 WHERE P#1=P#) {S#}) >= (S1 {S#})) ...returned bogus results. This has been corrected. ---- '''July 26, 2010: Rel version 1.0.3 Beta''' This version of Rel is a maintenance release. A Java exception could occur when performing a JOIN on relations with common attributes that belong to a user-defined TYPE with at least one relation-valued component. This has been corrected. ---- '''September 12, 2010: Rel version 1.0.4 Beta''' This version of Rel provides two enhancements and several bug fixes. '''Enhancements:''' 1. Inference of most specific common supertype (excluding Alpha) has been implemented, such that evaluating... RELATION { TUPLE {x Triangle(Point(0,0), Point(2,3), Point(7,4))} TUPLE {x Square(Point(1,1), Point(4,3))} } ...returns... RELATION {x Shape} { TUPLE {x Triangle(Point(0,0), Point(2,3), Point(7,4))} TUPLE {x Square(Point(1,1), Point(4,3))} } ...assuming the existence of types 'Triangle' and 'Square' which are subtypes of 'Shape'. 2. Selectors are now generated for immediate subtypes of built-in types, as per Date & Darwen's "Database Explorations" (ISBN 978-1-4269-3723-1), Chapter 21, page 348 "Selectors for System Defined Types". E.g., the following... TYPE P''''''osInt IS {INTEGER CONSTRAINT INTEGER >= 0}; ...will automatically create a selector called P''''''osInt which accepts an INTEGER as its sole argument and returns a P''''''osInt value. '''Bug Fixes:''' 1. A derived POSSREP definition list should be allowed to be empty when defining a type whose immediate supertype is a built-in type. However, Rel previously required at least one POSSREP. E.g., the following legitimate definition was not allowed: TYPE P''''''osInt IS {INTEGER CONSTRAINT INTEGER >= 0}; This has been fixed. 2. A bug has been corrected that could, in rare circumstances, cause a database to fail to open due to an internal "LOG INTEGRITY" error. 3. A bug has been corrected that could, in rare circumstances, cause corruption of user-defined type values when inserted into a RelVar immediately after any Rel error (e.g., a syntax error) has been generated. ---- '''November 7, 2010: Rel version 1.0.5 Beta''' This is a maintenance release featuring two bug fixes: 1. A bug in the way relation literals were parsed allowed the following... RELATION {x INTEGER, y INTEGER} { TUPLE {x 1, z 1} } ...to be accepted and yield: RELATION {x INTEGER, y INTEGER} TUPLE {x 1, y 1} } This has been corrected. 2. Due to a change in the way the third-party storage engine (Oracle Berkeley Java DB) generated exceptions -- introduced in Java DB version 4.0.71 -- Rel did not correctly handle an exception related to transactions and could wind up throwing its own internal exceptions. This was especially likely when attempting to drop a constraint or relvar immediately after a Rel error message had been generated. This has been corrected. ---- '''February 26, 2011: Rel version 1.0.6 Beta''' This is a minor release which provides two enhancements: 1. Previously, aggregate operator invocations like the following... SUM(sys.Catalog, C''''''reationSequence) ...could only reference an attribute. The following would not work: SUM(sys.Catalog, C''''''reationSequence + 1) In this release, aggregate operator invocations may specify an expression. Both of the above expressions will now work. This change is in accordance with the Tutorial D specification found in Date & Darwen's ''"Database Explorations - Essays on the Third Manifesto and Related Topics"''. 2. Short synonyms are now available for some common keywords. RELATION may be specified as REL, TUPLE as TUP, INTEGER as INT, RATIONAL as RAT, and BOOLEAN as BOOL. This is also in accordance with ''"Database Explorations ..."'' Note that DEE and DUM have always been available as synonyms for TABLE_DEE and TABLE_DUM, respectively. ---- '''October 19, 2011: Rel version 1.0.7 Beta''' This is a minor release which includes the following: 1. Enhancement: New built-in operator GET_UNIQUE_NUMBER returns an integer guaranteed to be unique in a given database. 2. Fix: Given TYPE POSINT IS {INTEGER CONSTRAINT INTEGER > 0}, MAX(RELATION {TUPLE {X 1}, TUPLE {X 2}}, X) failed due to a missing target. Fixed. 3. Fix: A longer default transaction timeout has been set, to reduce the likelihood of spurious timeouts in multithreaded client applications. 4. Fix: A number of bugs that prevented PRIVATE RELATION from working correctly have been fixed. ---- '''December 12, 2011: Rel version 1.0.8 Beta''' This is a minor release which includes the following: 1. Enhancement: Rel: Error reporting has been improved when Java-based built-in operators fail. E.g., SUBSTRING("blah", 1, 20) used to fail in an un-helpful manner. Now, the error message goes some way toward explaining and locating the problem. 2. Fix: Rel: The following failed with a low-level error; now fixed: var items private relation {id integer, name character} init( relation { tuple {id 1, name "hi"}, tuple {id 2, name "lo"}, tuple {id 3, name "do"}}) key {id}; var result private relation {r relation same_heading_as(items)} key {r}; var inner private relation same_heading_as(items) key {id}; insert inner relation {tuple from items where id = 1}; insert result relation {tuple {r inner}}; 3. Fix: Rel: Updating a relation-valued attribute, as in the following... var x private relation {a integer, b relation {c integer}} init (relation {tuple {a 1, b relation {tuple {c 2}}}}) key {a}; update x where a = 1 (b := update (b) (c := 33)); ...caused an error like the following: "ERROR: '%tuple23' has not been defined." This has been corrected. ---- '''June 4, 2012: ''Rel'' version 1.0.9 Beta''' This is a maintenance release which includes the following: * Fix: Unicode support is now explicitly provided in ''Rel'', DBrowser, and the R''''''elClient middleware. This should reduce the likelihood of errors or incorrect character translations when inputting unicode characters. * Fix: ''Rel'': A problem emitting escaped characters (special characters prefixed with a backslash, e.g., '\t') has been corrected, so that (for example) repeatedly backed up and restored ''Rel'' databases will no longer exhibit a harmless but awkward repetition of backslashes in certain string values. E.g., names like "O\\\\\\\\\\\\\\'Neil" should no longer occur. * Fix: ''Rel'': Replaced reference to "ca.mb.armchair.rel3.values.V''''''alueChar" with "ca.mb.armchair.rel3.values.V''''''alueCharacter" in F''''''oreignCompilerJava.java. This fixes problems creating new Java-based types which define methods/operators that use CHAR parameters. * Enhancement/Fix: R''''''elTest: Test suite has been redesigned to support execution of tests in random order. * Enhancement/Fix: ''Rel'': Updated to version 5.0.34 of Berkeley Java DB. As a side-effect of implementing this, occasional database corruptions leading to crashes -- typically referring to duplicate btree keys and the like -- should no longer occur. * Enhancement: ''Rel'': Temporary internal buffering of relations now dynamically switches from in-memory to disk-based storage based on cardinality. This will improve performance on low-cardinality queries whilst supporting very high cardinality queries. * Enhancement: ''Rel'': Implemented mechanism to ensure expected version of Berkeley Java DB is installed. This eliminates possible errors due to running an incompatible version of the Berkeley Java DB. * Enhancement: Scripts: T''''''ypeDate.d now implements THE_readable, which obtains a human-friendly date. * Enhancement: ''Rel'': Improved speed of compiling Java-based types and operators. * Enhancement: DBrowser: Crashes will now automatically open a dialog box to allow the user to send an error report to the developers. ---- '''February 26, 2013: ''Rel'' version 1.0.10 Beta''' This is a significant release, as it implements the latest '''Tutorial D''' syntax from Date and Darwen's book "Database Explorations: Essays on The Third Manifesto and related topics" (ISBN:978-1426937231) Prior to installing this version of ''Rel'', you must make a backup of your database(s). Then, install this update and load and attempt to execute your backup script(s). If your script successfully loads, you're done. If ''Rel'' complains of syntax errors, you'll need to edit the backup script -- based on the "Rel Version 1.0.10+ Syntax" article at http://dbappbuilder.sourceforge.net -- until the script successfully loads. Changes in this update: * Fix: Rel: Revised execution order of statements in multiple assignment to prevent counterintuitive behaviour. Assignments now execute from first to last. * Fix: Rel: Passing a non-boolean to the WHERE clause of an UPDATE would result in a crash. Fixed. * Enhancement: Rel: Added partial support for anonymous operators. This is a work-in-progress documented at http://dbappbuilder.sourceforge.net/docs/AnonymousAndFirstClassOperatorsInTutorialD.pdf * Enhancement: Rel: Updated to version 5.0.58 of Berkeley Java DB, which is used as the storage engine. * Enhancement: Rel: Various changes to support Tutorial D syntax from Database Explorations: EXTEND: old: EXTEND r ADD (p AS q, a AS b) new: EXTEND r : {q := p, b := a} UPDATE: old: UPDATE r (p := q, b := a) new: UPDATE r : {p := q, b := a} RENAME: old: r RENAME (a AS b) new: r RENAME {a AS b} SUMMARIZE: old: SUMMARIZE p ADD (SUM(x) AS y) new: SUMMARIZE p : {y := SUM(x)) WITH: old: WITH a AS b, x AS y : ... new: WITH (b := a, y := x) : ... WRAP: old: r WRAP ({a, b} AS c, {d, e} AS f) new (r WRAP ({a, b} AS c)) WRAP ({d, e} AS f) UNWRAP: old: r UNWRAP (a, b) new: (r UNWRAP (a)) UNWRAP (b) GROUP: old: r GROUP ({a, b} AS c, {d, e} AS f) new (r GROUP ({a, b} AS c)) GROUP ({d, e} AS f) UNGROUP: old: r UNGROUP (a, b) new: (r UNGROUP (a)) UNGROUP (b) Removed ANY and ALL synonyms for OR and AND. Implemented n-adic COMPOSE. Implemented XUNION, TIMES, I_MINUS, I_DELETE, D_INSERT and updated INSERT to silently ignore duplicate tuples. * Fix: Rel tests: revised T''''''estDelete0 and T''''''estRelvar26 to eliminate order-dependent testing. * Enhancement: Rel: POSSREP keyword ORDERED now recognised in addition to ORDINAL, but is a no-op. * Enhancement: Rel: Improved shutdown procedure is less likely to result in a corrupt database if there are problems encountered during shutdown. * Enhancement: Scripts: D''''''atabaseToScript.d, Views.d changed to accommodate support for Database Explorations syntax. * Enhancement: DBrowser: Splash screen disappears as soon as Ok appears. * Enhancement: DBrowser: Error messages that specify line and column now cause the cursor to move to the position of the error in the source. ---- '''July 17, 2014: ''Rel'' version 1.0.11 Beta''' This is a maintenance release featuring various enhancements and bug fixes. Prior to installing this version of Rel, you must make a backup of your database(s). Then, install this update and load and attempt to execute your backup script(s). If your script successfully loads, you're done. If ''Rel'' complains of syntax errors, you'll need to edit the backup script -- based on the "''Rel'' Version 1.0.11+ Syntax" article at http://dbappbuilder.sourceforge.net -- until the script successfully loads. Changes in this update: * Enhancement: DBrowser: Now displays human-friendly messages when attempting to open an already-open database, or when a connection attempt to a remote ''Rel'' server fails. * Enhancement: DBrowser: Now provides options to hide headings and declared types in headings in displayed output of relations. * Enhancement: DBrowser: Now provides a "Get File Path" button to simplify putting file paths in source code. This facilitates use of external data sources, described below. * Enhancement: Rel: Some minor syntax improvements have been made, in accordance with changes to Tutorial D. Formerly-required parentheses around WRAP, UNWRAP, GROUP, UNGROUP clauses have been removed. UNGROUP (a) and UNWRAP (a) are now UNGROUP a and UNWRAP a, respectively. * Enhancement: Rel: All error messages are now uniquely identified to disambiguate references to them. * Enhancement: Rel: Updated to version 6.0.11 of the Berkeley Java DB, which is used as a storage engine. * Enhancement: Rel: A student project has produced simple support for external CSV/XLS/XLSX/JDBC sources as relvars: e.g., VAR myvar EXTERNAL CSV "/home/dave/test.csv"; e.g., VAR myvar EXTERNAL XLS "/home/dave/test.xls" DUP_REMOVE; e.g., VAR myvar EXTERNAL XLS "/home/dave/test.xlsx" DUP_COUNT; e.g., VAR myvar EXTERNAL XLS "/home/dave/test.xlsx" AUTOKEY; e.g., VAR myvar EXTERNAL JDBC ",,,.,,"; * Enhancement: Rel: New relvar types can be provided as ''Rel'' plug-ins. Documentation for this feature will be provided in the future. * Enhancement: Rel: 'x RENAME {}' is now valid syntax. * Enhancement: Rel: Errors occurring in a database constraint are now treated as if the constraint evaluates to false, and the failing constraint is named in the error message. * Fix: DBrowser: Fixed minor errors parsing certain error messages. * Fix: Rel: Given the following, the UPDATE queries shown below failed. This has been corrected. VAR S BASE RELATION { SNO CHAR, SNAME CHAR, STATUS INTEGER, CITY CHAR } KEY {SNO}; VAR SP BASE RELATION { SNO CHAR, PNO CHAR, QTY INTEGER } KEY {SNO, PNO}; VAR SPQ BASE INIT( EXTEND S: {PQ := RELATION {TUPLE {SNO SNO}} COMPOSE SP} ) KEY{SNO}; UPDATE SPQ WHERE SNO = "S2": {INSERT PQ RELATION {TUPLE {PNO "P5", QTY 500}}}; UPDATE SPQ WHERE SNO = "S2": {UPDATE PQ WHERE PNO="P5": {QTY := 250}}; UPDATE SPQ WHERE SNO = "S2": {DELETE PQ WHERE PNO="P5"}; * Fix: Rel: The following should have returned true but returned false. This has been corrected. Internal changes to address this and similar errors in comparing relations with relation-valued attributes may have performance impact -- some queries may run faster, others slower. RELATION { TUPLE { SUPPLIES RELATION { TUPLE {PID "P5"} }}, TUPLE { SUPPLIES RELATION { TUPLE {PID "P2"} }}, TUPLE { SUPPLIES RELATION { TUPLE {PID "P4"} }} } = RELATION { TUPLE { SUPPLIES RELATION { TUPLE {PID "P5"} }}, TUPLE { SUPPLIES RELATION { TUPLE {PID "P2"} }}, TUPLE { SUPPLIES RELATION { TUPLE {PID "P4"} }} } * Fix: Rel: JOIN {}, TIMES {}, and COMPOSE {} now return DEE. * Fix: Rel: XUNION {}, D_UNION {}, UNION {} now return TUPLE {}. * Fix: Rel: XUNION {} {}, D_UNION {} {}, UNION {} {} return DUM. * Fix: Rel: INTERSECT {} and INTERSECT {} {} throw an error. * Fix: Rel: Type checking was too weak on comparison operators, allowing incorrect expressions like 'tuple{x 1} = tuple{y 2, x 1}' to return a result instead of throwing an error. Fixed. * Fix: Rel: RELATION {TUPLE {x 10, y DEE}} WHERE x = 100 UNGROUP y threw a fatal error. It should have thrown a type error due to an attempt to ungroup integer 100. This has been fixed. * Fix: Rel: Built-in operator name OP_GREATHERTHANOREQUALS corrected to OP_GREATERTHANOREQUALS. * Fix: Rel: Assignment to a real relvar altered its C''''''reationSequence. Fixed. * Fix: Rel: CAST_AS_INTEGER("blah") and CAST_AS_RATIONAL("blah") should have thrown semantic errors, not fatal errors. Fixed. '''Note:''' This release includes experimental support for a work-in-progress visual query language called Rev. Using an icons-on-strings data-flow style, it permits constructing queries visually and iteratively, and allows testing sub-expressions whilst constructing a query. To experiment with it, install the Rev package and it will appear as an additional tab in a DBrowser session. To remove it, delete the rev.jar file. Further documentation and video demonstrations will be provided in the future. ---- '''October 26, 2014: ''Rel'' version 1.0.12 Beta''' This is a maintenance release featuring some enhancements and bug fixes. * Enhancement: Rel: Updated storage engine to Oracle Berkeley DB Java Edition version 6.2.7. * Enhancement: Rel: Database resilience after power failures or system crashes has been considerably improved. In the majority of power failures or system crashes, it should be possible to load ''Rel'' and resume use without errors or data loss. * Fix: Rel: Updates to relation-valued parameters, which created side-effects, have been disallowed. * Fix: Rel: TREAT_AS_type() and IS_type() did not work correctly with static inheritance. This has been corrected. * Fix: Rel: The following caused ''Rel'' crashes due to a "hash error" on Temperature_NoReading(), etc. This has been corrected. TYPE Temperature UNION; TYPE Temperature_Normal IS {Temperature POSSREP {t INTEGER}}; TYPE Temperature_NoReading IS {Temperature POSSREP {}}; TYPE Temperature_OutOfRange IS {Temperature POSSREP {}}; VAR Readings REAL RELATION {timestamp INTEGER, temp Temperature} KEY {timestamp}; INSERT Readings REL { TUP {timestamp 12938, temp Temperature_Normal(33)}, TUP {timestamp 12940, temp Temperature_Normal(33)}, TUP {timestamp 12943, temp Temperature_Normal(34)}, TUP {timestamp 12948, temp Temperature_NoReading()}, TUP {timestamp 12955, temp Temperature_OutOfRange()} }; * Fix: Rel: Some CONSTRAINT failures displayed an un-helpful "Transaction is not active" error message instead of identifying the failing constraint. This has been corrected. ---- CategoryDatabase CategoryProject