![]() | ![]() | ![]() | ![]() |
Small. Fast. Reliable.
Choose any three.
Moving From SQLite 3.5.9 to 3.6.0SQLite version 3.6.0 contains many changes. As is the custom with the SQLite project, most changes are fully backwards compatible. However, a few of the changes in version 3.6.0 are incompatible and might require modifications to application code and/or makefiles. This document is a briefing on the changes in SQLite 3.6.0 with special attention to the incompatible changes. Key Points: 1.0 Incompatible ChangesIncompatible changes are covered first since they are the most important to maintainers and programmers. 1.1 Overview Of Incompatible Changes
1.2 Changes To The VFS LayerSQLite version 3.5.0 introduced a new OS interface layer that provided an abstraction of the underlying operating system. This was an important innovation and has proven to be helpful in porting and maintaining SQLite. However, the developers have discovered some minor flaws in the original "virtual file system" design introduced in version 3.5.0 and so SQLite 3.6.0 includes some small incompatible changes to address these flaws. Key Point: The incompatible changes in the SQLite operating-system interface for version 3.6.0 only affect the rare applications that make use of the virtual file system interface or that supply a application-defined mutex implementation or that make use of other obscure compile-time options. The changes introduced by SQLite version 3.6.0 will have zero impact on the vast majority of SQLite applications that use the built-in interfaces to Unix, Windows, and OS/2 and that use the standard build configuration. 1.3 Changes In The Way The IN Operator Handles NULLsAll versions of SQLite up to and including version 3.5.9 have mishandled NULL values on the right-hand side of IN and NOT IN operators. Specifically, SQLite has previously ignored NULLs on the right-hand side of IN and NOT IN. Suppose we have a table X1 defined as follows: CREATE TABLE x1(x INTEGER); INSERT INTO x1 VALUES(1); INSERT INTO x1 VALUES(2); INSERT INTO x1 VALUES(NULL); Given the definition of X1 above, the following expressions have historically evaluated to FALSE in SQLite, though the correct answer is actually NULL: 3 IN (1,2,NULL) 3 IN (SELECT * FROM x1) Similarly, the following expressions have historically evaluated to TRUE when in fact NULL is also the correct answer here: 3 NOT IN (1,2,NULL) 3 NOT IN (SELECT * FROM x1) The historical behavior of SQLite is incorrect according to the SQL:1999 standard and it is inconsistent with the behavior of MySQL and PostgreSQL. Version 3.6.0 changes the behavior of the IN and NOT IN operators to conform to the standard and to give the same results as other SQL database engines. Key Point: The change to the way NULL values are handled by the IN and NOT IN operators is technically a bug fix, not a design change. However, maintainers should check to insure that applications do not depend on the older, buggy behavior prior to upgrading to version 3.6.0. 1.4 Changes To Column Naming RulesThe column names reported by join subqueries have been modified slightly in order to work more like other database engines. Consider the following query: CREATE TABLE t1(a); CREATE TABLE t2(x); SELECT * FROM (SELECT t1.a FROM t1 JOIN t2 ORDER BY t2.x LIMIT 1) ORDER BY 1; In version 3.5.9 the query above would return a single column named "t1.a". In version 3.6.0 the column name is just "a". SQLite has never made any promises about the names of columns in the result set of SELECT statement unless the column contains an AS clause. So this change to column name is technically not an incompatibility. SQLite is merely changing from one undefined behavior to another. Nevertheless, many applications depend on the unspecified column naming behavior of SQLite and so this change is discussed under the incompatible changes subheading. 1.5 Changes To Compile-Time OptionsCompile-time options to SQLite are controlled by C-preprocessor macros. SQLite version 3.6.0 changes the names of some of these macros so that all C-preprocessor macros that are specific to SQLite begin with the "SQLITE_" prefix. This is done to reduce the risk of name collisions with other software modules. Key Point: Changes to compile-time options have the potential to affect makefiles in projects that do customized builds of SQLite. These changes should have zero impact on application code and for most projects which use a standard, default build of SQLite. 2.0 Fully Backwards-Compatible EnhancementsIn addition to the incompatible changes listed above, SQLite version 3.6.0 adds the following backwards compatible changes and enhancements:
This page last modified 2008/11/01 13:26:49 UTC |