adding all of botlist, initial add
[botlist.git] / botlist_testserver / hsqldb / doc / changelog_1_7_2.txt
blob9b9eff272fe373d6b77c7cb690c67e08a730c951
1 HSQLDB 1.7.2 CHANGE LOG\r
2 \r
3 \r
4 The development of 1.7.2 began in late 2002 with a plan to release the new version within 6 months. Several alpha versions, culminating in ALPHA_M, were released in the first three months and featured most of the intended enhancements. However, when newly written code for system tables was introduced, many changes had to be made to internal code to accommodate the reporting requirements. This was followed from around April 2003 with efforts to separate query compilation from execution. Other developments to allow multiple databases, better query processing, more advanced SQL keywords, etc. took place simultaneously, resulting in an extended scope for 1.7.2 and extensive addition and rewrite of several key classes. The next alpha version was released in September, followed by a further six, until the first Release Candidate became available at the end of 2003. Since then, all efforts have been focused on fixing bugs and inconsistencies, with 7 additional Release Candidates issued.\r
5 \r
6 As a result, 1.7.2 features major changes to the database engine. Existing applications that work with previous versions may need modifications to work with the new version. Changes are listed here and in the rest of the documentation.\r
7 \r
8 I would like to thank all developers, testers and users who have contributed to this effort.\r
9 \r
11 June 2004\r
13 Fred Toussi\r
15 Maintainer, HSQLDB Project\r
16 http://hsqldb.sourceforge.net\r
19 ----------------------------------------------------\r
20 ----------------------------------------------------\r
22 SQL ENHANCEMENTS AND CHANGES\r
25 ----------------\r
27 DDL\r
29 Some new restrictions have been imposed:\r
31 CONSTRAINT names must be unique within each database (same with INDEX names).\r
32 Size / precision / scale values for several types are now disallowed. Allowed types are: CHAR(n), VARCHAR(n), DOUBLE(n), DECIMAL(n,m)\r
34 In column default value specification, functions such as CURRENT_TIME, CURRENT_DATA, etc. should not be enclosed in quotes. New function CURRENT_USER can also be used.\r
36 SQL keywords are not allowed as table or column names unless they are double-quoted. \r
38 ----------------\r
40 VIEW\r
43 View definitions can now have a column name list:\r
45 CREATE VIEW <viewname> [(<colnmae>, ...)] AS SELECT ....\r
47 ALTER TABLE commands take into account the views that reference the table and prevent illegal changes.\r
51 ----------------\r
53 CHECK\r
57 Support for CHECK constraints that apply to the modified/inserted row only. This can be added via ALTER TABLE ADD CHECK() or in table definition.\r
61 ----------------\r
63 QUERY PROCESSING\r
67 Query processing has been extensively enhanced in this release and better SQL standard compliance has been achieved. Major implications of the recent changes are as follows:\r
69 Columns in correlated subqueries are resolved independently first. If there is an unresolved column, then the surrounding context is used to resolve it. This is opposite the resolution order previously enforced in the engine.\r
71 Some ambiguities and errors in ORDER BY clauses are now caught.\r
73 UNION and other set queries accept only one ORDER BY clause at the end. In this clause, column indexes or column names in the first select are allowed as sort specification e.g.:\r
75 SELECT .. UNION SELECT .. ORDER BY 1 DESC, 5, 3\r
77 The implemntation of UNION, EXCEPT and INTERSECT set operations has been rewritten to comply with SQL standards.\r
79 When multiple set operations are present in a query, they are now evaluated from left to right, with INTERSECT taking precedence over the rest.\r
81 It is now possible to use parentheses around multiple (or single) select statements with set operations to change the order of evalation.E.g.:\r
83 ((SELECT * FROM A EXCEPT SELECT * FROM B) INTERSECT SELECT * FROM D UNION SELECT * FROM E)\r
85 The above applies to all cases where a SELECT can be used except a single value select inside another select. Eg.\r
87 SELECT a, b, SELECT asinglevalue FROM anothertable WHERE ..., FROM atable JOIN ... \r
89 ----------------\r
91 IMPROVEMENTS TO UPDATE AND INSERT\r
95 Certain types of UPDATES and INSERTS that previously failed due to blanket application of UNIQUE constraints now work.\r
97 Examples include UPDATE ... SET col = col + 1 where col is an identity column or INSERT a self referencing row under FOREIGN key constraints.\r
101 ----------------\r
103 AGGREGATES, GROUP BY, HAVING\r
107 DISTINCT aggregates are now supported.\r
109 Aggregates on all numeric type columns are now supported. Expressions are allowed as aggregate function parameter.\r
111 SUM returns a BIGINT for TINYINT, SMALLINT and INTEGER columns. It returns a DECIMAL for BIGINT columns (scale 0). SUM of a DECIMAL column has the same scale as the column.\r
113 AVG returns the same type as the column or the expression in its argument.\r
115 Aggregates with GROUP BY do not return any rows if table is empty\r
117 Fully enforced GROUP BY rules including support for HAVING conditions\r
120 ----------------\r
122 JOINS\r
126 Extensive rewrite of join processing abolishes the requirement for an index on any joined columns.\r
128 Problems with OUTER and INNER joins returning incorrect results have been fixed and results are correct in all cases.\r
130 When two tables are joined, rows resulting from joining null values in the joined columns are no longer returned.\r
132 Most expressions are supported in the join condition (JOIN <table> ON ....).\r
134 Outer join conditions can now include most comparison operators, as well as OR logical operators. For example:\r
136 LEFT OUTER JOIN atable ON a=b AND c>d OR a=2 ...\r
138 Illegal forward table references are no longer allowed in join conditions.\r
140 There are many other small improvements and fixes, including:\r
144 ----------------\r
146 NULLS\r
150 Support for multiple rows with null fields under unique constraints.\r
152 Exclusion of NULL values from results of queries with range conditions. \r
156 ----------------\r
158 FOREIGN KEY\r
162 Full support for triggered actions, including foreign keys that reference the same table.\r
164 FORIEGN KEY ... ON UPDATE { CASCADE | SET NULL | SET DEFAULT } ON DELETE { CASCADE | SET NULL | SET DEFAULT }\r
166 Strict treatment of foreign key constraint requirements is now enforced. A foreign key declaration _requires_ a unique constraint to exist on the columns of the referenced table. This applies both to old and new databases. Duplicate foreign keys (with exactly the same column sets) are now disallowed.\r
170 ----------------\r
172 SEQUENCE\r
176 Support for sequences. Identity columns are now automatic sequence primary key columns that can be defined as INTEGER or BIGINT as follows:\r
178 GENERATED BY DEFAULT AS IDENTITY (START WITH <n>, INCREMENT BY <m>)\r
180 Named sequence objects can be defined with:\r
182 CREATE SEQUENCE <sequencename> [AS {INTEGER | BIGINT}] [START WITH <startvalue>] [INCREMENT BY <incrementvalue>];\r
184 And the next value can be retrieved with the following expression in SELECT, INSERT and UPDATE queries:\r
186 NEXT VALUE FOR <sequencename>\r
190 ----------------\r
192 SQL FUNCTIONS\r
195 Added support for a range of SQL style functions:\r
198 CASE .. WHEN .. THEN .. [WHEN .. THEN ..] ELSE .. END\r
200 CASE WHEN .. THEN .. [WHEN .. THEN ..] ELSE ... END\r
202 NULLIF(.. , ..)\r
204 SUBSTRING(.. FROM .. FOR ..)\r
206 POSITION(.. IN ..)\r
208 TRIM( {LEADING | TRAILING .. } FROM ..)\r
210 EXTRACT({DAY | TIME |..} FROM ..)\r
212 COALESCE(.. , ..)\r
216 ----------------\r
218 TRIGGER\r
222 It is now possible to execute triggers in the main execution thread. This allows uses for triggers that were not possible before, especially checking and modifying inserted values.\r
226 ----------------\r
228 DATETIME\r
232 Fixed the TIMESTAMPS, TIME and DATE normalisation issues.\r
236 ----------------\r
238 OTHER\r
242 IN value lists can now contain column values or expressions. See TestSelfQueries.txt for an example.\r
245 LIKE has been debugged and optimised when possible.\r
249 ----------------------------------------------------\r
250 ----------------------------------------------------\r
252 JDBC ENHANCEMENTS\r
256 JDBC support for savepoints.\r
258 Support for JDBC batch execution with multiple-results. Both Statement and PreparedStatement batch modes are supported.\r
260 SSL support for server mode operation.\r
262 After calling Statement.setMaxRows(int), the maximum row count restriction will no longer apply to result sets returned and used internally. (change in 1_7_2_5)\r
265 ----------------\r
267 CONNECTION PROPERTY\r
271 A new property, ifexists={true|false} can be specified for connections. It has an effect only on connections to in-process databases. The default is false and corresponds to current behaviour. \r
273 If set true, the connection is opened only if the database files have already been created -- otherwise no new database is created and the connection attempt will fail. Example:\r
275 jdbc:hsqldb:hsql:file:mydb;ifexists=true\r
277 This property is intended to reduce problems resulting from wrong URL's which get translated to unintended new database files. It is recommended to use this property for troubleshooting.\r
279 Database properties can be specified for the first connection to a new file: or mem: database. This allows properties such as enforce_strict_size to be specified for mem: databases, or for a new file: database.\r
281 jdbc:hsqldb:hsql:mem:test;sql.enforce_strict_size=true\r
285 ----------------\r
287 PREPARED STATEMENTS\r
291 Support for real PreparedStatements - major speedup. This has introduced the following changes from the previous versions.\r
293 The execute(String sql), executeUpdate(String sql) and executeQuery(String sql) commands are no-longer supported for PreparedStatements according to JDBC specs. Use an ordinary Statement for calling these methods.\r
295 The SQL for each call to the prepareStatement() method of Connection must consist of a single SQL query. For multiple statements use either multiple PreparedStatement objects or an ordinary Statement object.\r
297 Bug fixes ensure date / time, java object and binary values stored in in-process databases via prepared statements will not be altered if the object is modified outside the engine.\r
299 Full support for ResultSetMetaData\r
301 Full support for ParameterMetaData\r
303 Support for CLOB methods in ResultSet\r
307 ----------------\r
309 TRANSACTIONS VIA WEB SERVER\r
313 Uniform support for transactions via HSQL and HTTP (WebServer and Servlet) protocols\r
316 ----------------------------------------------------\r
317 ----------------------------------------------------\r
319 OTHER ENHANCEMENTS\r
323 ----------------------------------------------------\r
325 SPEED\r
329 Speed optimisation of joins with views and subqueries, using indexes to optimise join performance.\r
331 Improved index use for multiple key joins.\r
333 Further speed improvements in all logged modes\r
335 INSERT and UPDATE ops are faster by 5-20% in MEMORY tables, less in CACHED tables.\r
337 General speedup of CACHED table operation due to better management of the memory cache.\r
341 ----------------------------------------------------\r
343 DATABASE PACKAGING AND MODES\r
347 Two new options for databases: files_readonly and files_in_jar were added:\r
350 FILE READ-ONLY\r
353 If the property hsqldb.files_readonly=true is set in the database .properties file, no attempt is made to write the changes to data to file. Default, MEMORY tables can be read/write but TEXT and CACHED tables are treated as read-only.\r
356 FILES IN JAR\r
359 This option allows database files to be distributed in the application jar. We have changed the original contribution so that a special URL is used for this mode in the form of:\r
361 jdbc:hsqldb:res:<path in jar>\r
363 The URL type 'res' determines that the path that follows is a path into the JAR. The path must be all lowercase and begin with a forward slash.\r
365 The database can be readonly or files_readonly, depending on the value set in .properties file.\r
368 'OTHER' DATA TYPE\r
371 Change to handling of OTHER columns. It is no longer required that the classes for objects stored in OTHER columns to be available on the path of an HSQLDB engine running as a server. Classes must be available on the JDBC client's path.\r
374 ----------------------------------------------------\r
376 MULTIPLE IN-MEMORY AND SERVER DATABASES\r
380 Support for multiple memory-only databases within the same JVM\r
382 Support for simultaneous multiple servers on different ports, multiple internal connections and multiple databases within the same JVM\r
384 Each HSQLDB server or webserver can now serve up to 10 different databases.\r
386 The server.properties and webserver.properties method for defining the databases has changed. The following properties should be used:\r
388 server.database.0   path_of_the_first_database\r
389 server.dbname.0 alias_for_the_first_database\r
391 Up to 10 databases can be defined but they must start from 0. The same applies to command line arguments for Server and WebServer.\r
393 The URL's for connecting to servers should have the alias of the database at the end. For example, to connect to the HSQL protocol server on the localhost use:\r
395 jdbc:hsqldb:hsql://localhost/alias_for_the_database\r
397 where alias_for_the_database is the same string as defined in server.properties as server.dbname.n\r
399 If not explicitly set, the default for server.dbname.0 is "" (empty string) so that old URL types continue to work.\r
401 Multiple memory-only database are supported by the use of:\r
403 jdbc:hsqldb:mem:alias_for_the_first_database\r
404 jdbc:hsqldb:mem:alias_for_the_second_database\r
406 Examples: jdbc:hsqldb:mem:db1 jdbc:hsqldb:mem:mydb\r
408 The connection type, 'file:', can be used for file database connections. Example below:\r
410 jdbc:hsqldb:file:mydb;ifexists=true\r
412 The URL for connecting to a Servlet HTTP server must have a forward-slash at the end. Servlet serves only one database.\r
414 jdbc:hsqldb:hsql://localhost:8080/servlet/HsqlServlet/\r
417 ----------------------------------------------------\r
419 DATABASE METADATA\r
422 System table support and java.sql.DatabaseMetadate have been overhauled.\r
424 Use SELECT * FROM SYSTEM_TABLES to see the full list.\r
428 ----------------------------------------------------\r
430 TEXT TABLES\r
433 Enhanced TEXT table handling and reporting of errors in CSV (source) files\r
435 TEXT TABLES encoding of the source file can now be specified. UTF-8 and other encodings can be used.\r
439 ----------------------------------------------------\r
441 MEMORY USE AND OBJECT POOLING\r
444 An Object pool has been incorporated. This reduces memory usage to varying degrees depending on the contents of database tables and speeds up the database in most cases. Currently the size of the pool is hard-coded but it will be user adjustable in a future version.\r
448 ----------------------------------------------------\r
450 PERSISTENCE\r
453 ----------------\r
455 CHECKPOINT DEFRAG\r
457 Defragments the *.data file without shutting down the database\r
460 ----------------\r
462 SET SCRIPTFORMAT {TEXT | BINARY | COMPRESSED }\r
464 Changes the format of the *.script file and performs a checkpoint.\r
466 Database script can be stored in binary or compressed binary formats, resulting in smaller size and faster loading.\r
469 ----------------\r
471 The *.script file now contains only the DDL and data that is written at CHECKPOINT or SHUTDOWN. The COMPRESSED format has the side benefit of hiding the DDL and the admin password.\r
473 The *.log file now contains the statements executed since the last startup or CHECKPOINT. This file is in plain text format.\r
475 ----------------\r
477 SET WRITE_DELAY {TRUE | FALSE}\r
479 SET WRITE_DELAY <n>\r
481 The behaviour of SET WRITE_DELAY has changed with the introduction of the sync() method to force the log to be written out completely to disk at given intervals.\r
483 SET WRITE_DELAY {TRUE | FALSE} is interpreted as synch every 60 seconds or 1 second. SET WRITE_DELAY <n> where n is an integer is interpreted as synch every n seconds. The current default is 60 seconds which seems to provide the right balance. Under heavy INSERT/DELETE/UPDATE test conditions, the performance impact of SET WRITE_DELAY 1 is probably about 15% over that of SET WRITE_DELAY 300.\r
485 Crash recovery has been modified so that any line in the *.log file that is not properly written (and causes an error) ends the redo process. A message is reported to the user, instead of stopping engine operation.\r
487 ----------------\r
489 NIO ACCESS FOR *.data FILES\r
491 New nio access layer for .data files speeds up most CACHED TABLE related operations very significantly. 90% speedups in TestCacheSize tests have been observed.\r
493 There must be enough available memory in the machine to allow a memory-mapped buffer for the entire *.data file. Beyond this size, the engine reverts to non-nio access.\r
497 ----------------------------------------------------\r
499 BUILD\r
501 Reduction in JDK / JRE dependencies (see readmebuild.txt)\r
503 The supplied JAR is now compiled with JDK 1.4 and requires a JRE 1.4 or later to work. You can rebuild the JAR with JDK 1.3.x in order to use it with JRE 1.3 or earlier.\r
507 ----------------------------------------------------\r
509 DOCUMENTATION\r
512 Documentation is now maintained mainly in XML format with HTML and PDF versions available.\r
516 ----------------------------------------------------\r
518 UTILITIES\r
521 The SQL Tool is a powerful new utility in 1.7.2 and allows processing SQL commands via the shell or scripts.\r
523 The Transfer Tool utility saw a major upgrade just before the 1.7.2 release cycle. In this release some minor updates and bug fixes, together with significant speedup, have been intoduced.\r
525 The Database Manager has been enhanced slightly to include a command to save the result set in CSV format. The Swing version of Database Manager allows the user to sort the rows of the result set on any column.\r
527 The connection dialogue in the AWT version of Database Manager and Transfer Tool allows saving and recalling connection URL's together with the user name and password.\r
530 ----------------------------------------------------\r
532 END\r